summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--firmware/export/config/gigabeats.h8
-rw-r--r--firmware/export/usb.h3
-rw-r--r--firmware/usb.c2
3 files changed, 7 insertions, 6 deletions
diff --git a/firmware/export/config/gigabeats.h b/firmware/export/config/gigabeats.h
index 2f1d241701..dbeff4aa04 100644
--- a/firmware/export/config/gigabeats.h
+++ b/firmware/export/config/gigabeats.h
@@ -190,20 +190,20 @@
#define FREQ cpu_frequency
+/* Button that exposures boot partition rather than data during session */
+#define USB_BL_INSTALL_MODE_BTN BUTTON_VOL_DOWN
+
/* define this if the unit can be powered or charged via USB */
#define HAVE_USB_POWER
#define USBPOWER_BUTTON BUTTON_MENU
#ifndef BOOTLOADER
-#define USBPOWER_BTN_IGNORE BUTTON_POWER
+#define USBPOWER_BTN_IGNORE USB_BL_INSTALL_MODE_BTN
#else
/* Disable charging-only mode detection in bootloader */
#define USBPOWER_BTN_IGNORE (BUTTON_MAIN | BUTTON_REMOTE)
#endif
-/* Button that exposures boot partition rather than data during session */
-#define USB_BL_INSTALL_MODE_BTN BUTTON_VOL_DOWN
-
/* define this if the unit has a battery switch or battery can be removed
* when running */
#define HAVE_BATTERY_SWITCH
diff --git a/firmware/export/usb.h b/firmware/export/usb.h
index 72315404e3..d4a6550a22 100644
--- a/firmware/export/usb.h
+++ b/firmware/export/usb.h
@@ -64,7 +64,8 @@ enum {
#elif CONFIG_KEYPAD == ONDIO_PAD
#define USBPOWER_BUTTON BUTTON_MENU
#define USBPOWER_BTN_IGNORE BUTTON_OFF
-#else
+/*allow people to define this in config-target.h if they need it*/
+#elif !defined(USBPOWER_BTN_IGNORE)
#define USBPOWER_BTN_IGNORE 0
#endif
#endif
diff --git a/firmware/usb.c b/firmware/usb.c
index b8e2b5298c..2f277ac200 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -347,7 +347,7 @@ static inline bool usb_power_button(void)
#ifdef USB_FIREWIRE_HANDLING
static inline bool usb_reboot_button(void)
{
- return (button_status() & ~USBPOWER_BTN_IGNORE) != USBPOWER_BUTTON;
+ return (button_status() & ~USBPOWER_BTN_IGNORE);
}
#endif
#else /* !HAVE_USB_POWER */