summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/button.c9
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 @@
#include <stdlib.h>
#include "config.h"
#include "sh7034.h"
+#include "system.h"
#include "button.h"
#include "kernel.h"
#include "backlight.h"
@@ -64,6 +65,14 @@ static void button_tick(void)
post = true;
repeat = true;
count = REPEAT_INTERVAL;
+#ifdef HAVE_RECORDER_KEYPAD
+ /* If the OFF button is pressed long enough, and we are
+ still alive, then the unit must be connected to a
+ charger. Therefore we will reboot and let the original
+ firmware handle the charging. */
+ if(btn == BUTTON_OFF)
+ system_reboot();
+#endif
}
}
if ( post )