mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-11 06:05:21 -05:00
Add the shutdown routine necessary when bootloader is flashed. Normal build/bootloader still operate as expected.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18651 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
143b8f1c30
commit
3ef51c5cbb
1 changed files with 12 additions and 1 deletions
|
|
@ -64,12 +64,23 @@ bool ide_powered(void)
|
||||||
|
|
||||||
void power_off(void)
|
void power_off(void)
|
||||||
{
|
{
|
||||||
|
int(*reboot_point)(void);
|
||||||
|
reboot_point=(void*)(unsigned char*) 0x00000000;
|
||||||
/* turn off backlight and wait for 1 second */
|
/* turn off backlight and wait for 1 second */
|
||||||
_backlight_off();
|
_backlight_off();
|
||||||
_buttonlight_off();
|
_buttonlight_off();
|
||||||
sleep(HZ);
|
sleep(HZ);
|
||||||
/* set SLEEP bit to on in CLKCON to turn off */
|
|
||||||
|
/* Rockbox never properly shutdown the player. When the sleep bit is set
|
||||||
|
* the player actually wakes up in some type of "zombie" state
|
||||||
|
* because the shutdown routine is not set up properly. So far the
|
||||||
|
* shutdown routines tried leave the player consuming excess power
|
||||||
|
* so we rely on the OF to shut everything down instead. (mmu apears to be
|
||||||
|
* reset when the sleep bit is set)
|
||||||
|
*/
|
||||||
CLKCON |=(1<<3);
|
CLKCON |=(1<<3);
|
||||||
|
|
||||||
|
reboot_point();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* SIMULATOR */
|
#else /* SIMULATOR */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue