From 5c2cf01ac15aae5b54b138ad3bcb397200afdd48 Mon Sep 17 00:00:00 2001 From: rehius <128579193+rehius@users.noreply.github.com> Date: Sun, 1 Sep 2024 14:50:07 +0000 Subject: [PATCH] Update boot_detect.c --- boot_detect.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/boot_detect.c b/boot_detect.c index 2de6b2f..a83d7d0 100644 --- a/boot_detect.c +++ b/boot_detect.c @@ -20,7 +20,7 @@ bool wait_for_boot(int timeout_ms) { bool was_cmd1 = false; int reset_attempts = 0; - while(!time_reached(tio_full)) { + while(1) { if (time_reached(tio_cmd1)) { if (reset_attempts > 4) @@ -28,6 +28,9 @@ bool wait_for_boot(int timeout_ms) { if (was_read_zero) { halt_with_error(1, 3); } + else if (tio_cmd1 != tio_full) { + halt_with_error(0, 3); + } else if (was_cmd1) { halt_with_error(2, 3); } else { @@ -66,6 +69,4 @@ bool wait_for_boot(int timeout_ms) { last_word = word; } } - halt_with_error(0, 3); - return false; }