diff options
| author | Michael Sevakis <jethead71@rockbox.org> | 2007-07-07 03:51:50 +0000 |
|---|---|---|
| committer | Michael Sevakis <jethead71@rockbox.org> | 2007-07-07 03:51:50 +0000 |
| commit | 68f975be8524e89fe582b20f3231f161b6f85e26 (patch) | |
| tree | d89470a8f426c81299ff77590b5cb7a139aeaf91 | |
| parent | 276ff3bceb6bb365029b870d994a928c0c314e72 (diff) | |
| download | rockbox-68f975be8524e89fe582b20f3231f161b6f85e26.zip rockbox-68f975be8524e89fe582b20f3231f161b6f85e26.tar.gz rockbox-68f975be8524e89fe582b20f3231f161b6f85e26.tar.bz2 rockbox-68f975be8524e89fe582b20f3231f161b6f85e26.tar.xz | |
e200: Better power_off to lock the system down while waiting for PMU to cut power.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13809 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/target/arm/sandisk/sansa-e200/power-e200.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/firmware/target/arm/sandisk/sansa-e200/power-e200.c b/firmware/target/arm/sandisk/sansa-e200/power-e200.c index a01654f..dfa4211 100644 --- a/firmware/target/arm/sandisk/sansa-e200/power-e200.c +++ b/firmware/target/arm/sandisk/sansa-e200/power-e200.c @@ -18,6 +18,7 @@ ****************************************************************************/ #include <stdbool.h> +#include "system.h" #include "cpu.h" #include "i2c-pp.h" @@ -28,11 +29,25 @@ void power_init(void) void power_off(void) { char byte; + + /* Disable interrupts on this core */ + set_interrupt_status(IRQ_FIQ_DISABLED, IRQ_FIQ_STATUS); + + /* Mask them on both cores */ + CPU_INT_CLR = -1; + COP_INT_CLR = -1; + + /* Send shutdown command to PMU */ byte = i2c_readbyte(0x46, 0x20); byte &= ~0x1; pp_i2c_send(0x46, 0x20, byte); - - while(1); /* Wait for device to power off */ + + /* Halt everything and wait for device to power off */ + while (1) + { + CPU_CTL = PROC_SLEEP; + COP_CTL = PROC_SLEEP; + } } bool charger_inserted(void) |