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
BootInit();
#if (BOOT_BACKDOOR_ENTRY_TIMEOUT_MS > 0)
blt_bool stayInBootloader = checkIfRebootIntoOpenBltRequested();
blt_bool wasConnected = BLT_FALSE;
#endif // BOOT_BACKDOOR_ENTRY_TIMEOUT_MS
while (true) {
#if (BOOT_BACKDOOR_ENTRY_TIMEOUT_MS > 0)
BootTask();
@ -97,7 +100,7 @@ int main(void) {
wasConnected = BLT_TRUE;
continue;
}
if (stayInBootloader)
if (stayInBootloader || wasConnected)
continue;
blt_bool isTimeout = (TIME_I2MS(chVTGetSystemTime()) >= BOOT_BACKDOOR_ENTRY_TIMEOUT_MS);
#else