diff options
author | Jens Arnold <amiconn@rockbox.org> | 2008-03-17 23:47:38 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2008-03-17 23:47:38 +0000 |
commit | ed3ff1b0b5122e898f7310a9b5ed112a22e2828c (patch) | |
tree | 10838a643bc95d0792e4bda21ad14a343b374751 /firmware/target/coldfire/iaudio/m5/power-m5.c | |
parent | 4071826c813f8e06e93e22049aee07ffc95c3460 (diff) | |
download | rockbox-ed3ff1b0b5122e898f7310a9b5ed112a22e2828c.tar.gz rockbox-ed3ff1b0b5122e898f7310a9b5ed112a22e2828c.zip |
Various coldfire fixes: (1) iAudio Bootloader: Check the status of main & remote power button vs. the respective hold switch, and shut down when on hold. On X5/M5 this check is not strictly necessary for the main unit, but left there to keep things uniform. (2) M3: Stop reading the ADC properly before leaving the bootloader, on RoLo, and on reboot, to make it work reliably after those transitions. (3) Disable all interrupt sources on system init to avoid premature ISR calls after enabling interrupts in general. (4) iAudios: Proper implementation of ide_powered(), avoiding nasty HDD clicks in the bootloader when powering down, e.g. because of Hold. (5) Slight optimisations.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16689 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/coldfire/iaudio/m5/power-m5.c')
-rw-r--r-- | firmware/target/coldfire/iaudio/m5/power-m5.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware/target/coldfire/iaudio/m5/power-m5.c b/firmware/target/coldfire/iaudio/m5/power-m5.c index d33cbec8be..939cae02f2 100644 --- a/firmware/target/coldfire/iaudio/m5/power-m5.c +++ b/firmware/target/coldfire/iaudio/m5/power-m5.c | |||
@@ -38,23 +38,23 @@ void power_init(void) | |||
38 | 38 | ||
39 | bool charger_inserted(void) | 39 | bool charger_inserted(void) |
40 | { | 40 | { |
41 | return (GPIO1_READ & 0x01000000)?true:false; | 41 | return (GPIO1_READ & 0x01000000) != 0; |
42 | } | 42 | } |
43 | 43 | ||
44 | void ide_power_enable(bool on) | 44 | void ide_power_enable(bool on) |
45 | { | 45 | { |
46 | /* GPOOD3 */ | 46 | /* GPOOD3 */ |
47 | int level = set_irq_level(HIGHEST_IRQ_LEVEL); | 47 | int level = set_irq_level(HIGHEST_IRQ_LEVEL); |
48 | if(on) | 48 | pcf50606_write(0x3c, on ? 0x07 : 0x00); |
49 | pcf50606_write(0x3c, 0x07); | ||
50 | else | ||
51 | pcf50606_write(0x3c, 0x00); | ||
52 | set_irq_level(level); | 49 | set_irq_level(level); |
53 | } | 50 | } |
54 | 51 | ||
55 | bool ide_powered(void) | 52 | bool ide_powered(void) |
56 | { | 53 | { |
57 | return false; | 54 | int level = set_irq_level(HIGHEST_IRQ_LEVEL); |
55 | int value = pcf50606_read(0x3c); | ||
56 | set_irq_level(level); | ||
57 | return (value & 0x07) != 0; | ||
58 | } | 58 | } |
59 | 59 | ||
60 | void power_off(void) | 60 | void power_off(void) |