summaryrefslogtreecommitdiffstats
path: root/firmware/usb.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-12-24 00:37:27 -0500
committerSolomon Peachy <pizza@shaftnet.org>2020-12-24 00:40:01 -0500
commitb5e6c30a61047e89f6cb1299a81453a80b79cc37 (patch)
tree4582b58a3ffcc5d8263a76396c8f160a2876661c /firmware/usb.c
parentc842a136519e1f8ef81cd7e4a815690825193baa (diff)
downloadrockbox-b5e6c30a61047e89f6cb1299a81453a80b79cc37.tar.gz
rockbox-b5e6c30a61047e89f6cb1299a81453a80b79cc37.tar.bz2
rockbox-b5e6c30a61047e89f6cb1299a81453a80b79cc37.zip
USB: Reset poweroff timer for all USB events
Without this, if a device is left plugged in and idle, unplugging it will trigger an immediate shutdown. Change-Id: I65caaa0c1473562ec5d0bb776b01d4d222d69965
Diffstat (limited to 'firmware/usb.c')
-rw-r--r--firmware/usb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index c27af4a378..05597dff9b 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -41,6 +41,7 @@
#endif
#include "logf.h"
#include "screendump.h"
+#include "powermgmt.h"
#ifndef BOOTLOADER
#include "misc.h"
@@ -436,6 +437,8 @@ static void NORETURN_ATTR usb_thread(void)
{
queue_wait(&usb_queue, &ev);
+ reset_poweroff_timer(); /* Any USB event counts */
+
switch(ev.id)
{
/*** Main USB thread duties ***/