diff options
author | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-10-23 16:28:06 +0000 |
---|---|---|
committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-10-23 16:28:06 +0000 |
commit | d69c4995f67aef16ea5cc1ae881cbdfc38977e03 (patch) | |
tree | b2a2dd4e88a3baad225c7656a74ed02edd6f113b | |
parent | e9f7c1ade43857836fbeca927e90caa636fd7ee8 (diff) | |
download | rockbox-d69c4995f67aef16ea5cc1ae881cbdfc38977e03.tar.gz rockbox-d69c4995f67aef16ea5cc1ae881cbdfc38977e03.zip |
the flash plugins are now checking the battery level first
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5332 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugins/firmware_flash.c | 18 | ||||
-rw-r--r-- | apps/plugins/rockbox_flash.c | 18 |
2 files changed, 32 insertions, 4 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) |
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 */ |