forked from len0rd/rockbox
Don't reboot unless we are connected to a charger
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2683 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
67c977fe0d
commit
7ec35e7828
1 changed files with 5 additions and 7 deletions
|
@ -29,6 +29,7 @@
|
||||||
#include "backlight.h"
|
#include "backlight.h"
|
||||||
#include "adc.h"
|
#include "adc.h"
|
||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
|
#include "power.h"
|
||||||
|
|
||||||
struct event_queue button_queue;
|
struct event_queue button_queue;
|
||||||
|
|
||||||
|
@ -127,15 +128,12 @@ static void button_tick(void)
|
||||||
/* initial repeat */
|
/* initial repeat */
|
||||||
count = REPEAT_INTERVAL_START;
|
count = REPEAT_INTERVAL_START;
|
||||||
}
|
}
|
||||||
/* If the OFF button is pressed long enough,
|
/* Reboot if the OFF button is pressed long enough
|
||||||
and we are still alive, then the unit must be
|
and we are connected to a charger. */
|
||||||
connected to a charger. Therefore we will
|
|
||||||
reboot and let the original firmware handle
|
|
||||||
the charging. */
|
|
||||||
#ifdef HAVE_RECORDER_KEYPAD
|
#ifdef HAVE_RECORDER_KEYPAD
|
||||||
if(btn == BUTTON_OFF)
|
if(btn == BUTTON_OFF && charger_inserted())
|
||||||
#elif HAVE_PLAYER_KEYPAD
|
#elif HAVE_PLAYER_KEYPAD
|
||||||
if(btn == BUTTON_STOP)
|
if(btn == BUTTON_STOP && charger_inserted())
|
||||||
#endif
|
#endif
|
||||||
system_reboot();
|
system_reboot();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue