Merge branch '2.3' into 2.4
# Conflicts: # radio/src/fonts/480x272/font_dblsize.png # radio/src/fonts/480x272/font_xxlsize.png # radio/src/gui/128x64/model_setup.cpp # radio/src/gui/128x64/radio_setup.cpp # radio/src/gui/480x272/model_receiver_options.cpp # radio/src/gui/480x272/model_setup.cpp # radio/src/gui/480x272/radio_calibration.cpp # radio/src/gui/480x272/radio_hardware.cpp # radio/src/gui/common/stdlcd/draw_functions.cpp # radio/src/gui/gui_common.cpp # radio/src/keys.h # radio/src/lua/interface.cpp # radio/src/pulses/afhds3.h # radio/src/rtos.h # radio/src/switches.cpp # radio/src/targets/common/arm/stm32/aux_serial_driver.cpp # radio/src/targets/horus/CMakeLists.txt # radio/src/targets/horus/lcd_driver.cpp # radio/src/targets/horus/startup_stm32f42_43xxx.s # radio/src/targets/taranis/CMakeLists.txt # radio/src/telemetry/crossfire.h # radio/src/telemetry/multi.cpp # radio/src/translations.cpp # radio/src/translations/it.h.txt # radio/src/translations/untranslated.h # radio/util/font2png.py # tools/commit-tests.sh
This commit is contained in:
+23
-6
@@ -519,14 +519,28 @@ swsrc_t getMovedSwitch()
|
||||
swsrc_t result = 0;
|
||||
|
||||
#if defined(PCBFRSKY)
|
||||
for (int i=0; i<NUM_SWITCHES; i++) {
|
||||
// Switches
|
||||
for (int i = 0; i < NUM_SWITCHES; i++) {
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
swarnstate_t mask = ((swarnstate_t)0x03 << (i*2));
|
||||
uint8_t prev = (switches_states & mask) >> (i*2);
|
||||
uint8_t next = (1024+getValue(MIXSRC_SA+i)) / 1024;
|
||||
swarnstate_t mask = ((swarnstate_t) 0x03 << (i * 2));
|
||||
uint8_t prev = (switches_states & mask) >> (i * 2);
|
||||
uint8_t next = (1024 + getValue(MIXSRC_SA + i)) / 1024;
|
||||
if (prev != next) {
|
||||
switches_states = (switches_states & (~mask)) | ((swarnstate_t)next << (i*2));
|
||||
result = 1+(3*i)+next;
|
||||
switches_states = (switches_states & (~mask)) | ((swarnstate_t) next << (i * 2));
|
||||
result = 1 + (3 * i) + next;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Multipos
|
||||
for (int i = 0; i < NUM_XPOTS; i++) {
|
||||
if (IS_POT_MULTIPOS(POT1 + i)) {
|
||||
StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[POT1 + i];
|
||||
if (IS_MULTIPOS_CALIBRATED(calib)) {
|
||||
uint8_t prev = potsPos[i] & 0x0F;
|
||||
uint8_t next = anaIn(POT1 + i) / (2 * RESX / calib->count);
|
||||
if (prev != next) {
|
||||
result = SWSRC_LAST_SWITCH + i * XPOTS_MULTIPOS_COUNT + next + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -683,6 +697,9 @@ void checkSwitches()
|
||||
}
|
||||
int x = SWITCH_WARNING_LIST_X;
|
||||
int y = SWITCH_WARNING_LIST_Y;
|
||||
#if defined(COLORLCD)
|
||||
lcdNextPos = SWITCH_WARNING_LIST_X;
|
||||
#endif
|
||||
int numWarnings = 0;
|
||||
for (int i=0; i<NUM_SWITCHES; ++i) {
|
||||
if (SWITCH_WARNING_ALLOWED(i) && !(g_model.switchWarningEnable & (1<<i))) {
|
||||
|
||||
Reference in New Issue
Block a user