From 60f581e8f52fa0f7355b80b38fc2d57e78634ae4 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Mon, 2 Nov 2020 08:10:15 -0500 Subject: usb: Add ability to prompt user about what to do upon usb insertion v3: Add in config option v4: Bugfixes v5: Force a redraw upon exiting v6: keypress-in-chargeonly mode enables mass storage (and vice versa) v7: Fix bootloader builds v8: Update manual, and have bootloader respect keypresses v9: Change default to mass storage (ie no change in behavior) todo: * test-build dx50/dx90 * Switch from yes/no to proper menu? * prevent WPS progress bar from drawing over us Change-Id: I82e0ccb08497b7a5aa756ce77f1332ee963703a7 ... Change-Id: I7946cf240b18a4fa8ace5e25e1eb6e97b8b12d7c --- firmware/export/usb.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'firmware/export') diff --git a/firmware/export/usb.h b/firmware/export/usb.h index b7b846d5b3..edc37bd5b6 100644 --- a/firmware/export/usb.h +++ b/firmware/export/usb.h @@ -131,6 +131,15 @@ enum #endif }; +/* Supported usb modes. */ +enum +{ + USB_MODE_ASK = 0, + USB_MODE_MASS_STORAGE, + USB_MODE_CHARGE, + USB_MODE_ADB +}; + #ifdef HAVE_USB_POWER /*allow people to define this in config-target.h if they need it*/ #if !defined(USBPOWER_BTN_IGNORE) @@ -215,6 +224,7 @@ void usb_charging_maxcurrent_change(int maxcurrent); /* returns the maximum allowed USB current, based on USB charging mode and state */ int usb_charging_maxcurrent(void); #endif /* HAVE_USB_CHARGING_ENABLE */ +void usb_set_mode(int mode); #endif /* HAVE_USB_POWER */ #ifdef HAVE_USBSTACK /* USB driver call this function to notify that a transfer has completed */ -- cgit v1.2.3