summaryrefslogtreecommitdiff
path: root/apps/plugins/firmware_flash.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/firmware_flash.c')
-rw-r--r--apps/plugins/firmware_flash.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/apps/plugins/firmware_flash.c b/apps/plugins/firmware_flash.c
index 880b030748..972d998ca8 100644
--- a/apps/plugins/firmware_flash.c
+++ b/apps/plugins/firmware_flash.c
@@ -637,8 +637,6 @@ void DoUserDialog(char* filename)
637 tCheckROM result; 637 tCheckROM result;
638 bool is_romless; 638 bool is_romless;
639 639
640 rb->lcd_setfont(FONT_SYSFIXED);
641
642 /* this can only work if Rockbox runs in DRAM, not flash ROM */ 640 /* this can only work if Rockbox runs in DRAM, not flash ROM */
643 if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */ 641 if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */
644 { /* we're running from flash */ 642 { /* we're running from flash */
@@ -653,6 +651,13 @@ void DoUserDialog(char* filename)
653 return; /* exit */ 651 return; /* exit */
654 } 652 }
655 653
654 /* refuse to work if the power may fail meanwhile */
655 if (!rb->battery_level_safe())
656 {
657 rb->splash(HZ*3, true, "Battery too low!");
658 return; /* exit */
659 }
660
656 /* check boot ROM */ 661 /* check boot ROM */
657 result = CheckBootROM(); 662 result = CheckBootROM();
658 if (result == eUnknown) 663 if (result == eUnknown)
@@ -682,6 +687,8 @@ void DoUserDialog(char* filename)
682 return; /* exit */ 687 return; /* exit */
683 } 688 }
684 689
690 rb->lcd_setfont(FONT_SYSFIXED);
691
685 rc = GetFlashInfo(&FlashInfo); 692 rc = GetFlashInfo(&FlashInfo);
686 ShowFlashInfo(&FlashInfo); 693 ShowFlashInfo(&FlashInfo);
687 if (FlashInfo.size == 0) /* no valid chip */ 694 if (FlashInfo.size == 0) /* no valid chip */
@@ -881,6 +888,13 @@ void DoUserDialog(char* filename)
881 return; /* exit */ 888 return; /* exit */
882 } 889 }
883 890
891 /* refuse to work if the power may fail meanwhile */
892 if (!rb->battery_level_safe())
893 {
894 rb->splash(HZ*3, true, "Batt. too low!");
895 return; /* exit */
896 }
897
884 /* check boot ROM */ 898 /* check boot ROM */
885 result = CheckBootROM(); 899 result = CheckBootROM();
886 if (result == eUnknown) 900 if (result == eUnknown)