From ed3ff1b0b5122e898f7310a9b5ed112a22e2828c Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 17 Mar 2008 23:47:38 +0000 Subject: 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 --- firmware/target/coldfire/iaudio/x5/power-x5.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'firmware/target/coldfire/iaudio/x5/power-x5.c') diff --git a/firmware/target/coldfire/iaudio/x5/power-x5.c b/firmware/target/coldfire/iaudio/x5/power-x5.c index cfcb384a24..068b25f577 100644 --- a/firmware/target/coldfire/iaudio/x5/power-x5.c +++ b/firmware/target/coldfire/iaudio/x5/power-x5.c @@ -38,23 +38,23 @@ void power_init(void) bool charger_inserted(void) { - return (GPIO1_READ & 0x01000000)?true:false; + return (GPIO1_READ & 0x01000000) != 0; } void ide_power_enable(bool on) { /* GPOOD3 */ int level = set_irq_level(HIGHEST_IRQ_LEVEL); - if(on) - pcf50606_write(0x3c, 0x07); - else - pcf50606_write(0x3c, 0x00); + pcf50606_write(0x3c, on ? 0x07 : 0x00); set_irq_level(level); } bool ide_powered(void) { - return false; + int level = set_irq_level(HIGHEST_IRQ_LEVEL); + int value = pcf50606_read(0x3c); + set_irq_level(level); + return (value & 0x07) != 0; } void power_off(void) -- cgit v1.2.3