diff options
Diffstat (limited to 'firmware/target')
| -rwxr-xr-x | firmware/target/coldfire/iaudio/x5/adc-x5.c | 2 | ||||
| -rwxr-xr-x | firmware/target/coldfire/iaudio/x5/button-x5.c | 16 | ||||
| -rw-r--r-- | firmware/target/coldfire/iaudio/x5/pcf50606-x5.c | 2 |
3 files changed, 12 insertions, 8 deletions
diff --git a/firmware/target/coldfire/iaudio/x5/adc-x5.c b/firmware/target/coldfire/iaudio/x5/adc-x5.c index e465f38..fc45da86 100755 --- a/firmware/target/coldfire/iaudio/x5/adc-x5.c +++ b/firmware/target/coldfire/iaudio/x5/adc-x5.c @@ -35,6 +35,7 @@ static int channelnum[] = unsigned short adc_scan(int channel) { + int level = set_irq_level(HIGHEST_IRQ_LEVEL); unsigned char data; pcf50606_write(0x2f, 0x80 | (channelnum[channel] << 1) | 1); @@ -42,6 +43,7 @@ unsigned short adc_scan(int channel) adcdata[channel] = data; + set_irq_level(level); return data; } diff --git a/firmware/target/coldfire/iaudio/x5/button-x5.c b/firmware/target/coldfire/iaudio/x5/button-x5.c index 287ee0e..84d1dbc 100755 --- a/firmware/target/coldfire/iaudio/x5/button-x5.c +++ b/firmware/target/coldfire/iaudio/x5/button-x5.c @@ -41,7 +41,7 @@ bool button_hold(void) bool remote_button_hold(void) { - return false; /* TODO X5 */ + return adc_scan(ADC_REMOTE) < 0x17; } int button_read_device(void) @@ -51,6 +51,7 @@ int button_read_device(void) static bool hold_button = false; static bool remote_hold_button = false; bool hold_button_old; + bool remote_hold_button_old; /* normal buttons */ hold_button_old = hold_button; @@ -90,14 +91,15 @@ int button_read_device(void) } /* remote buttons */ - - /* TODO: add light handling for the remote */ - - remote_hold_button = remote_button_hold(); + remote_hold_button_old = remote_hold_button; data = adc_scan(ADC_REMOTE); - if(data < 0x17) - remote_hold_button = true; + remote_hold_button = data < 0x17; + +#ifndef BOOTLOADER + if (remote_hold_button != remote_hold_button_old) + remote_backlight_hold_changed(remote_hold_button); +#endif if(!remote_hold_button) { diff --git a/firmware/target/coldfire/iaudio/x5/pcf50606-x5.c b/firmware/target/coldfire/iaudio/x5/pcf50606-x5.c index dde20d8..032c308 100644 --- a/firmware/target/coldfire/iaudio/x5/pcf50606-x5.c +++ b/firmware/target/coldfire/iaudio/x5/pcf50606-x5.c @@ -177,7 +177,7 @@ void pcf50606_init(void) and_l(~0x00000001, &GPIO_ENABLE); or_l(0x00000001, &GPIO_FUNCTION); or_l(0x00000100, &GPIO_INT_EN); /* GPI0 H-L */ - INTPRI5 |= 0x00000006; /* INT32 - Priority 6 */ + INTPRI5 |= (6 << 0); /* INT32 - Priority 6 */ pcf50606_write(0x39, 0x00); /* GPOOD0 = green led OFF */ pcf50606_write(0x3a, 0x00); /* GPOOD1 = red led OFF */ |