This commit is contained in:
andreika-git 2024-03-19 23:27:49 +02:00 committed by rusefillc
parent dd156340b2
commit 837ce54faa
1 changed files with 4 additions and 1 deletions

View File

@ -84,8 +84,11 @@ int main(void) {
// Init openblt itself // Init openblt itself
BootInit(); BootInit();
#if (BOOT_BACKDOOR_ENTRY_TIMEOUT_MS > 0)
blt_bool stayInBootloader = checkIfRebootIntoOpenBltRequested(); blt_bool stayInBootloader = checkIfRebootIntoOpenBltRequested();
blt_bool wasConnected = BLT_FALSE; blt_bool wasConnected = BLT_FALSE;
#endif // BOOT_BACKDOOR_ENTRY_TIMEOUT_MS
while (true) { while (true) {
#if (BOOT_BACKDOOR_ENTRY_TIMEOUT_MS > 0) #if (BOOT_BACKDOOR_ENTRY_TIMEOUT_MS > 0)
BootTask(); BootTask();
@ -97,7 +100,7 @@ int main(void) {
wasConnected = BLT_TRUE; wasConnected = BLT_TRUE;
continue; continue;
} }
if (stayInBootloader) if (stayInBootloader || wasConnected)
continue; continue;
blt_bool isTimeout = (TIME_I2MS(chVTGetSystemTime()) >= BOOT_BACKDOOR_ENTRY_TIMEOUT_MS); blt_bool isTimeout = (TIME_I2MS(chVTGetSystemTime()) >= BOOT_BACKDOOR_ENTRY_TIMEOUT_MS);
#else #else