summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-11-27 20:23:12 +0000
committerJens Arnold <amiconn@rockbox.org>2007-11-27 20:23:12 +0000
commit05784b52abb3d21dfe0e7b1e014e601ce1d10803 (patch)
tree47b0569fc6e68462c21cfd33cec521b5bf007a74
parentdb5206742eae1261627e48ac120a9b3a4b92d2bb (diff)
downloadrockbox-05784b52abb3d21dfe0e7b1e014e601ce1d10803.tar.gz
rockbox-05784b52abb3d21dfe0e7b1e014e601ce1d10803.zip
H10 button driver: Use atomic GPIO bit manipulation.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15839 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/iriver/h10/button-h10.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/firmware/target/arm/iriver/h10/button-h10.c b/firmware/target/arm/iriver/h10/button-h10.c
index ac09d245e6..fe5fff6592 100644
--- a/firmware/target/arm/iriver/h10/button-h10.c
+++ b/firmware/target/arm/iriver/h10/button-h10.c
@@ -34,15 +34,15 @@
34void button_init_device(void) 34void button_init_device(void)
35{ 35{
36 /* Enable REW, FF, Play, Left, Right, Hold buttons */ 36 /* Enable REW, FF, Play, Left, Right, Hold buttons */
37 GPIOA_ENABLE |= 0xfc; 37 GPIO_SET_BITWISE(GPIOA_ENABLE, 0xfc);
38 38
39 /* Enable POWER button */ 39 /* Enable POWER button */
40 GPIOB_ENABLE |= 0x1; 40 GPIO_SET_BITWISE(GPIOB_ENABLE, 0x01);
41 41
42 /* We need to output to pin 6 of GPIOD when reading the scroll pad value */ 42 /* We need to output to pin 6 of GPIOD when reading the scroll pad value */
43 GPIOD_ENABLE |= 0x40; 43 GPIO_SET_BITWISE(GPIOD_ENABLE, 0x40);
44 GPIOD_OUTPUT_EN |= 0x40; 44 GPIO_SET_BITWISE(GPIOD_OUTPUT_EN, 0x40);
45 GPIOD_OUTPUT_VAL |= 0x40; 45 GPIO_SET_BITWISE(GPIOD_OUTPUT_VAL, 0x40);
46} 46}
47 47
48bool button_hold(void) 48bool button_hold(void)
@@ -97,10 +97,10 @@ int button_read_device(void)
97 /* Read scroller */ 97 /* Read scroller */
98 if ( GPIOD_INPUT_VAL & 0x20 ) 98 if ( GPIOD_INPUT_VAL & 0x20 )
99 { 99 {
100 GPIOD_OUTPUT_VAL &=~ 0x40; 100 GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_VAL, 0x40);
101 udelay(250); 101 udelay(250);
102 data = adc_scan(ADC_SCROLLPAD); 102 data = adc_scan(ADC_SCROLLPAD);
103 GPIOD_OUTPUT_VAL |= 0x40; 103 GPIO_SET_BITWISE(GPIOD_OUTPUT_VAL, 0x40);
104 104
105 if(data < 0x224) 105 if(data < 0x224)
106 { 106 {