summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/usb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index be55622..8a99683 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -58,8 +58,10 @@ void screen_dump(void); /* Nasty again. Defined in apps/ too */
#if CONFIG_KEYPAD == RECORDER_PAD
#define USBPOWER_BUTTON BUTTON_F1
+#define USBPOWER_BTN_IGNORE BUTTON_ON
#elif CONFIG_KEYPAD == ONDIO_PAD
#define USBPOWER_BUTTON BUTTON_MENU
+#define USBPOWER_BTN_IGNORE BUTTON_OFF
#endif
#endif /* HAVE_USB_POWER */
@@ -225,7 +227,7 @@ static void usb_thread(void)
else
#endif
#ifdef HAVE_USB_POWER
- if(button_status() == USBPOWER_BUTTON)
+ if((button_status() & ~USBPOWER_BTN_IGNORE) == USBPOWER_BUTTON)
{
usb_state = USB_POWERED;
}