Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Prevent rebooting in early USB mode in case of a RAM disk

If disk_mount_all() fails at startup, the device should enter USB mode,
so the storage can be repartitioned/reformatted. After
unmounting/ejecting, the device is rebooted. Unfortunately if the
storage is a RAM disk, the data won't persist after a reboot, so this
patch tries to mount the storage again, instead of just rebooting.

Change-Id: I421a9fd8ae536bee07d292f27d1da0615456df62

authored by

Vencislav Atanasov and committed by
Solomon Peachy
b3e6b122 e80cf93b

+11 -3
+11 -3
apps/main.c
··· 608 608 #ifndef USB_NONE 609 609 lcd_puts(0, 2, "Insert USB cable"); 610 610 lcd_puts(0, 3, "and fix it."); 611 - #elif !defined(DEBUG) 611 + #elif !defined(DEBUG) && !(CONFIG_STORAGE & STORAGE_RAMDISK) 612 612 lcd_puts(0, 2, "Rebooting in 5s"); 613 613 #endif 614 614 lcd_update(); ··· 617 617 usb_start_monitoring(); 618 618 while(button_get(true) != SYS_USB_CONNECTED) {}; 619 619 gui_usb_screen_run(true); 620 - #else 620 + #elif !defined(DEBUG) && !(CONFIG_STORAGE & STORAGE_RAMDISK) 621 621 sleep(HZ*5); 622 622 #endif 623 - #if !defined(DEBUG) 623 + 624 + #if !defined(DEBUG) && !(CONFIG_STORAGE & STORAGE_RAMDISK) 624 625 system_reboot(); 626 + #else 627 + rc = disk_mount_all(); 628 + if (rc <= 0) { 629 + lcd_putsf(0, 4, "Error mounting: %08x", rc); 630 + lcd_update(); 631 + sleep(HZ*5); 632 + } 625 633 #endif 626 634 } 627 635 }