diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2006-09-10 02:00:40 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2006-09-10 02:00:40 +0000 |
commit | 3d2e10bcbd13ec48decafe49f32afcc12c5e185a (patch) | |
tree | 60c490e727a28fd2359c3d185cf2a4f5fd8c328b /firmware/drivers | |
parent | 24ca76ffec3e0d782f75ac1cca2c0b2c8b71f5db (diff) | |
download | rockbox-3d2e10bcbd13ec48decafe49f32afcc12c5e185a.tar.gz rockbox-3d2e10bcbd13ec48decafe49f32afcc12c5e185a.zip |
Added remote backlight on hold option to players with remote hold switch. Disabled IRQs while reading pcf50606 ADC. This seems to have stopped buttons becoming unresponsive when using remote. Maybe fixes other button glitches as well?
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10911 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/adc.c | 2 | ||||
-rw-r--r-- | firmware/drivers/button.c | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/firmware/drivers/adc.c b/firmware/drivers/adc.c index 1ebac066e7..d00f89958a 100644 --- a/firmware/drivers/adc.c +++ b/firmware/drivers/adc.c | |||
@@ -123,6 +123,7 @@ static int channelnum[] = | |||
123 | 123 | ||
124 | unsigned short adc_scan(int channel) | 124 | unsigned short adc_scan(int channel) |
125 | { | 125 | { |
126 | int level = set_irq_level(HIGHEST_IRQ_LEVEL); | ||
126 | unsigned char data; | 127 | unsigned char data; |
127 | 128 | ||
128 | pcf50606_write(0x2f, 0x80 | (channelnum[channel] << 1) | 1); | 129 | pcf50606_write(0x2f, 0x80 | (channelnum[channel] << 1) | 1); |
@@ -130,6 +131,7 @@ unsigned short adc_scan(int channel) | |||
130 | 131 | ||
131 | adcdata[channel] = data; | 132 | adcdata[channel] = data; |
132 | 133 | ||
134 | set_irq_level(level); | ||
133 | return data; | 135 | return data; |
134 | } | 136 | } |
135 | #else | 137 | #else |
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index f31ab33c87..5e6f6b4827 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c | |||
@@ -845,6 +845,7 @@ static int button_read(void) | |||
845 | static int prev_data = 0xff; | 845 | static int prev_data = 0xff; |
846 | static int last_valid = 0xff; | 846 | static int last_valid = 0xff; |
847 | bool hold_button_old; | 847 | bool hold_button_old; |
848 | bool remote_hold_button_old; | ||
848 | 849 | ||
849 | /* normal buttons */ | 850 | /* normal buttons */ |
850 | hold_button_old = hold_button; | 851 | hold_button_old = hold_button; |
@@ -916,12 +917,13 @@ static int button_read(void) | |||
916 | } | 917 | } |
917 | 918 | ||
918 | /* remote buttons */ | 919 | /* remote buttons */ |
920 | remote_hold_button_old = remote_hold_button; | ||
919 | remote_hold_button = remote_button_hold_only(); | 921 | remote_hold_button = remote_button_hold_only(); |
920 | 922 | ||
921 | if (remote_hold_button && !remote_button_hold_only()) | 923 | #ifndef BOOTLOADER |
922 | { | 924 | if (remote_hold_button != remote_hold_button_old) |
923 | remote_backlight_on(); | 925 | remote_backlight_hold_changed(remote_hold_button); |
924 | } | 926 | #endif |
925 | 927 | ||
926 | if (!remote_hold_button) | 928 | if (!remote_hold_button) |
927 | { | 929 | { |