diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2009-08-15 15:02:51 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2009-08-15 15:02:51 +0000 |
commit | 6932fa397ba9b9cc99ec248602f43aba8e1f86c9 (patch) | |
tree | fb954156a20423660c4a48c7c9750bfad5937192 /firmware/target/arm/as3525/sansa-clip/button-clip.c | |
parent | bd4fc82b3b97b2b3ba60af02e4cedc6b9ee26b7b (diff) | |
download | rockbox-6932fa397ba9b9cc99ec248602f43aba8e1f86c9.tar.gz rockbox-6932fa397ba9b9cc99ec248602f43aba8e1f86c9.zip |
Sansa Clip & m200v4 : calls backlight_hold_changed() when hold button is toggled
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22323 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sansa-clip/button-clip.c')
-rw-r--r-- | firmware/target/arm/as3525/sansa-clip/button-clip.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/firmware/target/arm/as3525/sansa-clip/button-clip.c b/firmware/target/arm/as3525/sansa-clip/button-clip.c index 0d4e3a6306..99a68a506d 100644 --- a/firmware/target/arm/as3525/sansa-clip/button-clip.c +++ b/firmware/target/arm/as3525/sansa-clip/button-clip.c | |||
@@ -22,6 +22,9 @@ | |||
22 | ****************************************************************************/ | 22 | ****************************************************************************/ |
23 | #include "button-target.h" | 23 | #include "button-target.h" |
24 | #include "as3525.h" | 24 | #include "as3525.h" |
25 | #ifndef BOOTLOADER | ||
26 | #include "backlight.h" | ||
27 | #endif | ||
25 | 28 | ||
26 | /* The Sansa Clip uses a button matrix that is scanned by selecting one of | 29 | /* The Sansa Clip uses a button matrix that is scanned by selecting one of |
27 | three rows and reading back the button states from the columns. | 30 | three rows and reading back the button states from the columns. |
@@ -124,5 +127,19 @@ int button_read_device(void) | |||
124 | 127 | ||
125 | bool button_hold(void) | 128 | bool button_hold(void) |
126 | { | 129 | { |
127 | return (GPIOA_PIN(3) != 0); | 130 | #ifndef BOOTLOADER |
131 | static bool hold_button_old = false; | ||
132 | #endif | ||
133 | bool hold_button = (GPIOA_PIN(3) != 0); | ||
134 | |||
135 | #ifndef BOOTLOADER | ||
136 | /* light handling */ | ||
137 | if (hold_button != hold_button_old) | ||
138 | { | ||
139 | hold_button_old = hold_button; | ||
140 | backlight_hold_changed(hold_button); | ||
141 | } | ||
142 | #endif /* BOOTLOADER */ | ||
143 | |||
144 | return hold_button; | ||
128 | } | 145 | } |