Skip to content

Commit 24360b6

Browse files
committed
Added suspendI2CTasks in boot menus
1 parent 67b474f commit 24360b6

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

radio/src/bootloader/boot_menu.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
#define SEL_CLEAR_FLASH_STORAGE_MENU_LEN 2
4242
#endif
4343

44+
bool suspendI2CTasks = false;
45+
4446
void pollInputs()
4547
{
4648
keysPollingCycle();
@@ -109,6 +111,7 @@ void bootloaderMenu()
109111
if (usbPlugged()) {
110112
state = ST_USB;
111113
#if !defined(SIMU)
114+
suspendI2CTasks = true;
112115
usbStart();
113116
#endif
114117
}
@@ -119,6 +122,7 @@ void bootloaderMenu()
119122
vpos = 0;
120123
#if !defined(SIMU)
121124
usbStop();
125+
suspendI2CTasks = false;
122126
#endif
123127
state = ST_START;
124128
}

radio/src/bootloader/boot_uf2.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
#define FRAME_INTERVAL_MS 20
3636

37+
bool suspendI2CTasks = false;
38+
3739
void bootloaderUF2()
3840
{
3941
BootloaderState state = ST_START;
@@ -71,6 +73,7 @@ void bootloaderUF2()
7173
if (usbPlugged()) {
7274
state = ST_USB;
7375
#if !defined(SIMU)
76+
suspendI2CTasks = true;
7477
usbStart();
7578
#endif
7679
} else if (pwrOffPressed()) {
@@ -83,6 +86,8 @@ void bootloaderUF2()
8386
if (usbPlugged() == 0) {
8487
#if !defined(SIMU)
8588
usbStop();
89+
suspendI2CTasks = false;
90+
8691
#endif
8792
state = (state == ST_FLASH_DONE) ? ST_REBOOT : ST_START;
8893
} else {

radio/src/edgetx.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ uint8_t latencyToggleSwitch = 0;
104104
#endif
105105

106106
volatile uint8_t rtc_count = 0;
107+
bool suspendI2CTasks = false;
107108

108109
#if defined(DEBUG_LATENCY)
109110
void toggleLatencySwitch()
@@ -169,8 +170,6 @@ void checkValidMCU(void)
169170
static bool evalFSok = false;
170171
#endif
171172

172-
bool suspendI2CTasks = false;
173-
174173
void per10ms()
175174
{
176175
DEBUG_TIMER_START(debugTimerPer10ms);

0 commit comments

Comments
 (0)