summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2024-06-11 10:14:36 -0400
committerSolomon Peachy <pizza@shaftnet.org>2024-06-11 15:21:02 -0400
commit4d9c7e20632ee9c98cf73c7c3751b9f495a720d8 (patch)
treeccf7a7de0c28b67675a89b6db00c67c8f9c76dd5
parentec23260fd1fc29f6de6705d08d2d1f182fd9891b (diff)
downloadrockbox-4d9c7e2063.tar.gz
rockbox-4d9c7e2063.zip
Improve the "No partition found" behavior.
(This is a different implementation of the fix in g#5726, by Vencislav Atanasov) The core problem is that the user is prompted to insert a USB cable to fix the partitioning etc but the code that monitors for USB insertion hasn't been started yet. Correct this. If no USB support is present, reboot after 5 seconds if it's not a debug build. If USB support is present, want for insertion first, then do the reboot-if-not-debug behavior. Change-Id: I87827e7fe2fe9a02298918c6ebc4d8a9fb33d624
-rw-r--r--apps/main.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/apps/main.c b/apps/main.c
index cf7d302fc9..edeeed7d8a 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -141,7 +141,7 @@
#if defined(WIN32)
#undef main
#endif
-#endif
+#endif /* SDL|MAEMO|PAMDORA */
/*#define AUTOROCK*/ /* define this to check for "autostart.rock" on boot */
@@ -432,7 +432,7 @@ static void init(void)
#endif
}
-#else /* CONFIG_PLATFORM & PLATFORM_HOSTED */
+#else /* ! (CONFIG_PLATFORM & PLATFORM_HOSTED) */
#include "errno.h"
@@ -551,7 +551,7 @@ static void init(void)
{
lcd_clear_display();
lcd_putsf(0, 1, "ATA error: %d", rc);
- lcd_puts(0, 3, "Press ON to debug");
+ lcd_puts(0, 3, "Press button to debug");
lcd_update();
while(!(button_get(true) & BUTTON_REL)); /* DO NOT CHANGE TO ACTION SYSTEM */
dbg_ports();
@@ -605,13 +605,24 @@ static void init(void)
lcd_clear_display();
lcd_puts(0, 0, "No partition");
lcd_puts(0, 1, "found.");
+#ifndef USB_NONE
lcd_puts(0, 2, "Insert USB cable");
lcd_puts(0, 3, "and fix it.");
+#elif !defined(DEBUG)
+ lcd_puts(0, 2, "Rebooting in 5s");
+#endif
lcd_update();
+#ifndef USB_NONE
+ usb_start_monitoring();
while(button_get(true) != SYS_USB_CONNECTED) {};
gui_usb_screen_run(true);
+#else
+ sleep(HZ*5);
+#endif
+#if !defined(DEBUG)
system_reboot();
+#endif
}
}