forked from len0rd/rockbox
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
This commit is contained in:
parent
e9f7c1ade4
commit
d69c4995f6
2 changed files with 32 additions and 4 deletions
|
@ -637,8 +637,6 @@ void DoUserDialog(char* filename)
|
||||||
tCheckROM result;
|
tCheckROM result;
|
||||||
bool is_romless;
|
bool is_romless;
|
||||||
|
|
||||||
rb->lcd_setfont(FONT_SYSFIXED);
|
|
||||||
|
|
||||||
/* this can only work if Rockbox runs in DRAM, not flash ROM */
|
/* this can only work if Rockbox runs in DRAM, not flash ROM */
|
||||||
if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */
|
if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */
|
||||||
{ /* we're running from flash */
|
{ /* we're running from flash */
|
||||||
|
@ -653,6 +651,13 @@ void DoUserDialog(char* filename)
|
||||||
return; /* exit */
|
return; /* exit */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* refuse to work if the power may fail meanwhile */
|
||||||
|
if (!rb->battery_level_safe())
|
||||||
|
{
|
||||||
|
rb->splash(HZ*3, true, "Battery too low!");
|
||||||
|
return; /* exit */
|
||||||
|
}
|
||||||
|
|
||||||
/* check boot ROM */
|
/* check boot ROM */
|
||||||
result = CheckBootROM();
|
result = CheckBootROM();
|
||||||
if (result == eUnknown)
|
if (result == eUnknown)
|
||||||
|
@ -682,6 +687,8 @@ void DoUserDialog(char* filename)
|
||||||
return; /* exit */
|
return; /* exit */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rb->lcd_setfont(FONT_SYSFIXED);
|
||||||
|
|
||||||
rc = GetFlashInfo(&FlashInfo);
|
rc = GetFlashInfo(&FlashInfo);
|
||||||
ShowFlashInfo(&FlashInfo);
|
ShowFlashInfo(&FlashInfo);
|
||||||
if (FlashInfo.size == 0) /* no valid chip */
|
if (FlashInfo.size == 0) /* no valid chip */
|
||||||
|
@ -881,6 +888,13 @@ void DoUserDialog(char* filename)
|
||||||
return; /* exit */
|
return; /* exit */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* refuse to work if the power may fail meanwhile */
|
||||||
|
if (!rb->battery_level_safe())
|
||||||
|
{
|
||||||
|
rb->splash(HZ*3, true, "Batt. too low!");
|
||||||
|
return; /* exit */
|
||||||
|
}
|
||||||
|
|
||||||
/* check boot ROM */
|
/* check boot ROM */
|
||||||
result = CheckBootROM();
|
result = CheckBootROM();
|
||||||
if (result == eUnknown)
|
if (result == eUnknown)
|
||||||
|
|
|
@ -625,8 +625,6 @@ void DoUserDialog(char* filename)
|
||||||
UINT32 crc;
|
UINT32 crc;
|
||||||
bool show_greet = false;
|
bool show_greet = false;
|
||||||
|
|
||||||
rb->lcd_setfont(FONT_SYSFIXED);
|
|
||||||
|
|
||||||
/* this can only work if Rockbox runs in DRAM, not flash ROM */
|
/* this can only work if Rockbox runs in DRAM, not flash ROM */
|
||||||
if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */
|
if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */
|
||||||
{ /* we're running from flash */
|
{ /* we're running from flash */
|
||||||
|
@ -634,6 +632,13 @@ void DoUserDialog(char* filename)
|
||||||
return; /* exit */
|
return; /* exit */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* refuse to work if the power may fail meanwhile */
|
||||||
|
if (!rb->battery_level_safe())
|
||||||
|
{
|
||||||
|
rb->splash(HZ*3, true, "Battery too low!");
|
||||||
|
return; /* exit */
|
||||||
|
}
|
||||||
|
|
||||||
/* "allocate" memory */
|
/* "allocate" memory */
|
||||||
sector = rb->plugin_get_buffer(&memleft);
|
sector = rb->plugin_get_buffer(&memleft);
|
||||||
if (memleft < SECTORSIZE) /* need buffer for a flash sector */
|
if (memleft < SECTORSIZE) /* need buffer for a flash sector */
|
||||||
|
@ -642,6 +647,8 @@ void DoUserDialog(char* filename)
|
||||||
return; /* exit */
|
return; /* exit */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rb->lcd_setfont(FONT_SYSFIXED);
|
||||||
|
|
||||||
pos = (void*)GetSecondImage();
|
pos = (void*)GetSecondImage();
|
||||||
rc = GetFlashInfo(&FlashInfo);
|
rc = GetFlashInfo(&FlashInfo);
|
||||||
|
|
||||||
|
@ -824,6 +831,13 @@ void DoUserDialog(char* filename)
|
||||||
return; /* exit */
|
return; /* exit */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* refuse to work if the power may fail meanwhile */
|
||||||
|
if (!rb->battery_level_safe())
|
||||||
|
{
|
||||||
|
rb->splash(HZ*3, true, "Batt. too low!");
|
||||||
|
return; /* exit */
|
||||||
|
}
|
||||||
|
|
||||||
/* "allocate" memory */
|
/* "allocate" memory */
|
||||||
sector = rb->plugin_get_buffer(&memleft);
|
sector = rb->plugin_get_buffer(&memleft);
|
||||||
if (memleft < SECTORSIZE) /* need buffer for a flash sector */
|
if (memleft < SECTORSIZE) /* need buffer for a flash sector */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue