Update boot_detect.c

This commit is contained in:
rehius authored and GitHub committed 2024-09-01 14:36:07 +00:00
1 parent e307c02199
commit f1078f48cb
1 file changed
+10 -9
+10 -9
View File
@@ -25,7 +25,15 @@ bool wait_for_boot(int timeout_ms) {
{
if (reset_attempts > 4)
{
halt_with_error(0, 3);
if (was_read_zero) {
halt_with_error(1, 3);
}
else if (was_cmd1) {
halt_with_error(2, 3);
} else {
halt_with_error(3, 3);
}
return false;
}
reset_attempts++;
reset_cpu();
@@ -58,13 +66,6 @@ bool wait_for_boot(int timeout_ms) {
last_word = word;
}
}
if (was_read_zero) {
halt_with_error(1, 3);
}
else if (was_cmd1) {
halt_with_error(2, 3);
} else {
halt_with_error(3, 3);
}
halt_with_error(0, 3);
return false;
}