diff --git a/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp b/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp index b67a118fb..48980afb5 100644 --- a/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp +++ b/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp @@ -82,6 +82,7 @@ namespace Open9xSky9x { #include "radio/src/curves.cpp" #include "radio/src/targets/sky9x/pulses_driver.cpp" #include "radio/src/pulses/pulses_arm.cpp" +#include "radio/src/tasks_arm.cpp" #include "radio/src/stamp.cpp" #include "radio/src/maths.cpp" #include "radio/src/vario.cpp" diff --git a/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp b/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp index 51352a1b2..df99ad17b 100644 --- a/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp +++ b/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp @@ -88,6 +88,7 @@ inline int geteepromsize() { #include "radio/src/targets/taranis/trainer_driver.cpp" #include "radio/src/targets/taranis/uart3_driver.cpp" #include "radio/src/pulses/pulses_arm.cpp" +#include "radio/src/tasks_arm.cpp" #include "radio/src/stamp.cpp" #include "radio/src/maths.cpp" #include "radio/src/vario.cpp" diff --git a/radio/src/gui/menu_model.cpp b/radio/src/gui/menu_model.cpp index 7dc1e2d61..5006c4db0 100644 --- a/radio/src/gui/menu_model.cpp +++ b/radio/src/gui/menu_model.cpp @@ -2078,7 +2078,7 @@ void menuModelPhaseOne(uint8_t event) static const pm_uint8_t mstate_tab_fm1[] PROGMEM = {0, 0, 0, (uint8_t)-1, 1, 1, 1, 1, 1}; static const pm_uint8_t mstate_tab_others[] PROGMEM = {0, 0, 3, IF_ROTARY_ENCODERS(NUM_ROTARY_ENCODERS-1) 0, 0, (uint8_t)-1, 2, 2, 2, 2, 2}; - if (!check(event, 0, NULL, 0, (s_currIdx == 0) ? mstate_tab_fm1 : mstate_tab_others, DIM(mstate_tab_others)-1, ITEM_MODEL_PHASE_MAX - 1 - (s_currIdx==0 ? (ITEM_MODEL_PHASE_FADE_IN-ITEM_MODEL_PHASE_SWITCH) : 0))) return; + check(event, 0, NULL, 0, (s_currIdx == 0) ? mstate_tab_fm1 : mstate_tab_others, DIM(mstate_tab_others)-1, ITEM_MODEL_PHASE_MAX - 1 - (s_currIdx==0 ? (ITEM_MODEL_PHASE_FADE_IN-ITEM_MODEL_PHASE_SWITCH) : 0)); TITLE(STR_MENUFLIGHTPHASE); diff --git a/radio/src/gui/menus.h b/radio/src/gui/menus.h index 4907ed5b1..0cc6854db 100644 --- a/radio/src/gui/menus.h +++ b/radio/src/gui/menus.h @@ -299,7 +299,7 @@ void title(const pm_char * s); #define MENU_FLAGS(title, tab, menu, flags, lines_count, ...) \ MENU_TAB(__VA_ARGS__); \ - MENU_CHECK_FLAGS(tab, menu, flags, lines_count)); \ + MENU_CHECK_FLAGS(tab, menu, flags, lines_count); \ TITLE(title) #define SIMPLE_MENU_NOTITLE(tab, menu, lines_count) \ @@ -309,9 +309,10 @@ void title(const pm_char * s); SIMPLE_MENU_NOTITLE(tab, menu, lines_count); \ TITLE(title) -#define SUBMENU_NOTITLE(lines_count, ...) \ +#define SUBMENU_NOTITLE(lines_count, ...) { \ MENU_TAB(__VA_ARGS__); \ - check(event, 0, NULL, 0, mstate_tab, DIM(mstate_tab)-1, (lines_count)-1); + check(event, 0, NULL, 0, mstate_tab, DIM(mstate_tab)-1, (lines_count)-1); \ + } #define SUBMENU(title, lines_count, ...) \ MENU_TAB(__VA_ARGS__); \ diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 16068bbef..22525814f 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -3383,7 +3383,7 @@ void opentxInit(OPENTX_INIT_ARGS) uart3Init(g_eeGeneral.uart3Mode, MODEL_TELEMETRY_PROTOCOL()); #endif -#if defined(CPUARM) +#if defined(CPUARM) && !defined(SIMU) init_trainer_capture(); #endif diff --git a/radio/src/tasks_arm.cpp b/radio/src/tasks_arm.cpp index b4597a247..219776b49 100755 --- a/radio/src/tasks_arm.cpp +++ b/radio/src/tasks_arm.cpp @@ -161,7 +161,9 @@ void menusTask(void * pdata) lcdRefresh(); lcdSetRefVolt(0); +#if !defined(SIMU) SysTick->CTRL = 0; // turn off systick +#endif pwrOff(); // Only turn power off if necessary }