summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/button.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index 4657e1d84b..e70246314d 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -29,6 +29,7 @@
29#include "backlight.h" 29#include "backlight.h"
30#include "adc.h" 30#include "adc.h"
31#include "serial.h" 31#include "serial.h"
32#include "power.h"
32 33
33struct event_queue button_queue; 34struct event_queue button_queue;
34 35
@@ -127,15 +128,12 @@ static void button_tick(void)
127 /* initial repeat */ 128 /* initial repeat */
128 count = REPEAT_INTERVAL_START; 129 count = REPEAT_INTERVAL_START;
129 } 130 }
130 /* If the OFF button is pressed long enough, 131 /* Reboot if the OFF button is pressed long enough
131 and we are still alive, then the unit must be 132 and we are connected to a charger. */
132 connected to a charger. Therefore we will
133 reboot and let the original firmware handle
134 the charging. */
135#ifdef HAVE_RECORDER_KEYPAD 133#ifdef HAVE_RECORDER_KEYPAD
136 if(btn == BUTTON_OFF) 134 if(btn == BUTTON_OFF && charger_inserted())
137#elif HAVE_PLAYER_KEYPAD 135#elif HAVE_PLAYER_KEYPAD
138 if(btn == BUTTON_STOP) 136 if(btn == BUTTON_STOP && charger_inserted())
139#endif 137#endif
140 system_reboot(); 138 system_reboot();
141 } 139 }