diff options
-rw-r--r-- | firmware/drivers/button.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index bd54dba523..7f680c6643 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <stdlib.h> | 23 | #include <stdlib.h> |
24 | #include "config.h" | 24 | #include "config.h" |
25 | #include "sh7034.h" | 25 | #include "sh7034.h" |
26 | #include "system.h" | ||
26 | #include "button.h" | 27 | #include "button.h" |
27 | #include "kernel.h" | 28 | #include "kernel.h" |
28 | #include "backlight.h" | 29 | #include "backlight.h" |
@@ -64,6 +65,14 @@ static void button_tick(void) | |||
64 | post = true; | 65 | post = true; |
65 | repeat = true; | 66 | repeat = true; |
66 | count = REPEAT_INTERVAL; | 67 | count = REPEAT_INTERVAL; |
68 | #ifdef HAVE_RECORDER_KEYPAD | ||
69 | /* If the OFF button is pressed long enough, and we are | ||
70 | still alive, then the unit must be connected to a | ||
71 | charger. Therefore we will reboot and let the original | ||
72 | firmware handle the charging. */ | ||
73 | if(btn == BUTTON_OFF) | ||
74 | system_reboot(); | ||
75 | #endif | ||
67 | } | 76 | } |
68 | } | 77 | } |
69 | if ( post ) | 78 | if ( post ) |