diff options
Diffstat (limited to 'firmware/target/arm/pbell/vibe500/button-vibe500.c')
-rw-r--r-- | firmware/target/arm/pbell/vibe500/button-vibe500.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/firmware/target/arm/pbell/vibe500/button-vibe500.c b/firmware/target/arm/pbell/vibe500/button-vibe500.c index c95e996ef8..7beaeeba81 100644 --- a/firmware/target/arm/pbell/vibe500/button-vibe500.c +++ b/firmware/target/arm/pbell/vibe500/button-vibe500.c | |||
@@ -63,12 +63,12 @@ void button_int(void) | |||
63 | val = ((data[1] >> 4) << 8) | data[2]; /* position */ | 63 | val = ((data[1] >> 4) << 8) | data[2]; /* position */ |
64 | 64 | ||
65 | if (val > 0) | 65 | if (val > 0) |
66 | { | 66 | { |
67 | int scr_pos = val >> 8; /* split the scrollstrip into 16 regions */ | 67 | int scr_pos = val >> 8; /* split the scrollstrip into 16 regions */ |
68 | if ((old_pos<scr_pos)&&(old_pos!=-1)) int_btn = BUTTON_DOWN; | 68 | if ((old_pos<scr_pos)&&(old_pos!=-1)) int_btn = BUTTON_DOWN; |
69 | if ((old_pos>scr_pos)&&(old_pos!=-1)) int_btn = BUTTON_UP; | 69 | if ((old_pos>scr_pos)&&(old_pos!=-1)) int_btn = BUTTON_UP; |
70 | old_pos = scr_pos; | 70 | old_pos = scr_pos; |
71 | } | 71 | } |
72 | else old_pos=-1; | 72 | else old_pos=-1; |
73 | } | 73 | } |
74 | } | 74 | } |
@@ -94,13 +94,13 @@ int button_read_device(void) | |||
94 | if (!hold_button) | 94 | if (!hold_button) |
95 | { | 95 | { |
96 | /* Read Record, OK, C */ | 96 | /* Read Record, OK, C */ |
97 | state = GPIOA_INPUT_VAL; | 97 | state = GPIOA_INPUT_VAL; |
98 | if ((state & 0x01)==0) buttons|=BUTTON_REC; | 98 | if ((state & 0x01)==0) buttons|=BUTTON_REC; |
99 | if ((state & 0x40)==0) buttons|=BUTTON_OK; | 99 | if ((state & 0x40)==0) buttons|=BUTTON_OK; |
100 | if ((state & 0x08)==0) buttons|=BUTTON_CANCEL; | 100 | if ((state & 0x08)==0) buttons|=BUTTON_CANCEL; |
101 | 101 | ||
102 | /* Read POWER button */ | 102 | /* Read POWER button */ |
103 | if ((GPIOD_INPUT_VAL & 0x40)==0) buttons|=BUTTON_POWER; | 103 | if ((GPIOD_INPUT_VAL & 0x40)==0) buttons|=BUTTON_POWER; |
104 | } | 104 | } |
105 | else return BUTTON_NONE; | 105 | else return BUTTON_NONE; |
106 | return buttons; | 106 | return buttons; |