Don't auto-poweroff if USB is inserted
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2418 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8050404848
commit
1665811d33
3 changed files with 8 additions and 0 deletions
|
@ -31,6 +31,7 @@
|
|||
#include "button.h"
|
||||
#include "ata.h"
|
||||
#include "mpeg.h"
|
||||
#include "usb.h"
|
||||
#include "powermgmt.h"
|
||||
|
||||
#ifdef SIMULATOR
|
||||
|
@ -127,6 +128,7 @@ static void handle_auto_poweroff(void)
|
|||
last_charge_time = current_tick;
|
||||
|
||||
if(timeout &&
|
||||
!usb_inserted() &&
|
||||
(mpeg_stat == 0 ||
|
||||
mpeg_stat == (MPEG_STATUS_PLAY | MPEG_STATUS_PAUSE)))
|
||||
{
|
||||
|
|
|
@ -297,6 +297,11 @@ void usb_start_monitoring(void)
|
|||
usb_monitor_enabled = true;
|
||||
}
|
||||
|
||||
bool usb_inserted(void)
|
||||
{
|
||||
return usb_state == USB_INSERTED;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/* Dummy simulator functions */
|
||||
|
|
|
@ -26,5 +26,6 @@ void usb_start_monitoring(void);
|
|||
void usb_acknowledge(int id);
|
||||
void usb_wait_for_disconnect(struct event_queue *q);
|
||||
void usb_display_info(void);
|
||||
bool usb_inserted(void);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue