summaryrefslogtreecommitdiff
path: root/apps/plugins/rockbox_flash.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/rockbox_flash.c')
-rw-r--r--apps/plugins/rockbox_flash.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/apps/plugins/rockbox_flash.c b/apps/plugins/rockbox_flash.c
index e01cc012ee..91d440e1e0 100644
--- a/apps/plugins/rockbox_flash.c
+++ b/apps/plugins/rockbox_flash.c
@@ -625,8 +625,6 @@ void DoUserDialog(char* filename)
625 UINT32 crc; 625 UINT32 crc;
626 bool show_greet = false; 626 bool show_greet = false;
627 627
628 rb->lcd_setfont(FONT_SYSFIXED);
629
630 /* this can only work if Rockbox runs in DRAM, not flash ROM */ 628 /* this can only work if Rockbox runs in DRAM, not flash ROM */
631 if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */ 629 if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */
632 { /* we're running from flash */ 630 { /* we're running from flash */
@@ -634,6 +632,13 @@ void DoUserDialog(char* filename)
634 return; /* exit */ 632 return; /* exit */
635 } 633 }
636 634
635 /* refuse to work if the power may fail meanwhile */
636 if (!rb->battery_level_safe())
637 {
638 rb->splash(HZ*3, true, "Battery too low!");
639 return; /* exit */
640 }
641
637 /* "allocate" memory */ 642 /* "allocate" memory */
638 sector = rb->plugin_get_buffer(&memleft); 643 sector = rb->plugin_get_buffer(&memleft);
639 if (memleft < SECTORSIZE) /* need buffer for a flash sector */ 644 if (memleft < SECTORSIZE) /* need buffer for a flash sector */
@@ -642,6 +647,8 @@ void DoUserDialog(char* filename)
642 return; /* exit */ 647 return; /* exit */
643 } 648 }
644 649
650 rb->lcd_setfont(FONT_SYSFIXED);
651
645 pos = (void*)GetSecondImage(); 652 pos = (void*)GetSecondImage();
646 rc = GetFlashInfo(&FlashInfo); 653 rc = GetFlashInfo(&FlashInfo);
647 654
@@ -824,6 +831,13 @@ void DoUserDialog(char* filename)
824 return; /* exit */ 831 return; /* exit */
825 } 832 }
826 833
834 /* refuse to work if the power may fail meanwhile */
835 if (!rb->battery_level_safe())
836 {
837 rb->splash(HZ*3, true, "Batt. too low!");
838 return; /* exit */
839 }
840
827 /* "allocate" memory */ 841 /* "allocate" memory */
828 sector = rb->plugin_get_buffer(&memleft); 842 sector = rb->plugin_get_buffer(&memleft);
829 if (memleft < SECTORSIZE) /* need buffer for a flash sector */ 843 if (memleft < SECTORSIZE) /* need buffer for a flash sector */