Bsongis/x7d fixes (#4019)
* [X7D] Various fixes [Others] - Fixes the Mixer / Inputs MOVE / COPY problem on X9E - Adds the copy/paste/rename feature in SDCARD menu on X7D/SKY9X - Merges some duplicated code using the new directory structure - Cosmetics
This commit is contained in:
@@ -38,6 +38,7 @@ set(GUI_SRC
|
||||
bitmapbuffer.cpp
|
||||
curves.cpp
|
||||
bitmaps.cpp
|
||||
radio_sdmanager.cpp
|
||||
radio_hardware.cpp
|
||||
model_inputs.cpp
|
||||
model_mixes.cpp
|
||||
|
||||
@@ -45,8 +45,8 @@ add_definitions(-DEEPROM_VARIANT=0)
|
||||
|
||||
set(GUI_SRC
|
||||
${GUI_SRC}
|
||||
model_inputs.cpp
|
||||
model_mixes.cpp
|
||||
model_input_edit.cpp
|
||||
model_mix_edit.cpp
|
||||
model_display.cpp
|
||||
radio_diagkeys.cpp
|
||||
radio_diaganas.cpp
|
||||
|
||||
@@ -77,8 +77,8 @@ add_definitions(-DPCBTARANIS -DPPM_PIN_TIMER)
|
||||
add_definitions(-DAUDIO -DVOICE -DRTCLOCK)
|
||||
|
||||
set(GUI_SRC ${GUI_SRC}
|
||||
model_inputs.cpp
|
||||
model_mixes.cpp
|
||||
model_input_edit.cpp
|
||||
model_mix_edit.cpp
|
||||
model_display.cpp
|
||||
radio_diagkeys.cpp
|
||||
radio_diaganas.cpp
|
||||
|
||||
@@ -80,7 +80,7 @@ void adcInit()
|
||||
ADC1->SQR2 = (ADC_CHANNEL_POT4<<0) + (ADC_CHANNEL_SLIDER3<<5) + (ADC_CHANNEL_SLIDER4<<10) + (ADC_CHANNEL_BATT<<15); // conversions 7 and more
|
||||
ADC1->SQR3 = (ADC_CHANNEL_STICK_LH<<0) + (ADC_CHANNEL_STICK_LV<<5) + (ADC_CHANNEL_STICK_RV<<10) + (ADC_CHANNEL_STICK_RH<<15) + (ADC_CHANNEL_POT2<<20) + (ADC_CHANNEL_POT3<<25); // conversions 1 to 6
|
||||
#elif defined(PCBX7D)
|
||||
ADC1->SQR2 = (ADC_CHANNEL_POT3<<0) + (ADC_CHANNEL_SLIDER1<<5) + (ADC_CHANNEL_SLIDER2<<10) + (ADC_CHANNEL_BATT<<15); // conversions 7 and more
|
||||
ADC1->SQR2 = (ADC_CHANNEL_BATT<<0); // conversions 7 and more
|
||||
ADC1->SQR3 = (ADC_CHANNEL_STICK_LH<<0) + (ADC_CHANNEL_STICK_LV<<5) + (ADC_CHANNEL_STICK_RV<<10) + (ADC_CHANNEL_STICK_RH<<15) + (ADC_CHANNEL_POT1<<25) + (ADC_CHANNEL_POT2<<20); // conversions 1 to 6
|
||||
#else
|
||||
ADC1->SQR2 = (ADC_CHANNEL_POT3<<0) + (ADC_CHANNEL_SLIDER1<<5) + (ADC_CHANNEL_SLIDER2<<10) + (ADC_CHANNEL_BATT<<15); // conversions 7 and more
|
||||
|
||||
@@ -112,7 +112,7 @@ void backlightInit()
|
||||
BACKLIGHT_TIMER->PSC = BACKLIGHT_TIMER_FREQ / 50000 - 1; // 20us * 100 = 2ms => 500Hz
|
||||
BACKLIGHT_TIMER->CCMR1 = TIM_CCMR1_OC2M_1 | TIM_CCMR1_OC2M_2; // PWM
|
||||
BACKLIGHT_TIMER->CCER = TIM_CCER_CC2E;
|
||||
BACKLIGHT_TIMER->CCR2 = 0;
|
||||
BACKLIGHT_TIMER->CCR2 = 100;
|
||||
BACKLIGHT_TIMER->EGR = 0;
|
||||
BACKLIGHT_TIMER->CR1 = TIM_CR1_CEN; // Counter enable
|
||||
}
|
||||
|
||||
@@ -320,8 +320,8 @@ void checkTrainerSettings()
|
||||
|
||||
uint16_t getBatteryVoltage()
|
||||
{
|
||||
int32_t instant_vbat = anaIn(TX_VOLTAGE); // using filtered ADC value on purpose
|
||||
int32_t instant_vbat = anaIn(TX_VOLTAGE); // using filtered ADC value on purpose
|
||||
instant_vbat = (instant_vbat * BATT_SCALE * (128 + g_eeGeneral.txVoltageCalibration) ) / 26214;
|
||||
instant_vbat += 20; // add 0.2V because of the diode TODO check if this is needed, but removal will beak existing calibrations!!!
|
||||
instant_vbat += 20; // add 0.2V because of the diode TODO check if this is needed, but removal will beak existing calibrations!!!
|
||||
return (uint16_t)instant_vbat;
|
||||
}
|
||||
|
||||
@@ -394,9 +394,6 @@
|
||||
#define ADC_GPIOC_PINS ADC_GPIO_PIN_BATT
|
||||
#define ADC_CHANNEL_POT1 ADC_Channel_6
|
||||
#define ADC_CHANNEL_POT2 ADC_Channel_8
|
||||
#define ADC_CHANNEL_POT3 ADC_Channel_9
|
||||
#define ADC_CHANNEL_SLIDER1 ADC_Channel_14
|
||||
#define ADC_CHANNEL_SLIDER2 ADC_Channel_15
|
||||
#define ADC_CHANNEL_BATT ADC_Channel_10
|
||||
#else
|
||||
#define ADC_GPIO_PIN_POT1 GPIO_Pin_6 // PA.06
|
||||
|
||||
Reference in New Issue
Block a user