This commit is contained in:
andreika-git 2024-03-19 20:44:01 +02:00 committed by rusefillc
parent ba7c067b0a
commit 688bb5b142
1 changed files with 7 additions and 4 deletions

View File

@ -91,14 +91,17 @@ int main(void) {
// since BOOT_BACKDOOR_HOOKS_ENABLE==TRUE, BackDoorCheck() is not working
// so we have to manually check if we need to jump to the main firmware
if (ComIsConnected() == BLT_TRUE)
if (ComIsConnected() == BLT_TRUE) {
// remember we had connection attempt
wasConnected = BLT_TRUE;
continue;
}
if (stayInBootloader)
continue;
blt_bool isTimeout = (TIME_I2MS(chVTGetSystemTime()) >= BOOT_BACKDOOR_ENTRY_TIMEOUT_MS);
if (isTimeout == BLT_TRUE) {
waitedLongerThanTimeout = BLT_TRUE;
if (wasConnected == BLT_FALSE && stayInBootloader == BLT_FALSE) {
CpuStartUserProgram();
}
CpuStartUserProgram();
}
}
}