diff options
Diffstat (limited to 'firmware/export')
| -rw-r--r-- | firmware/export/usb.h | 17 | ||||
| -rw-r--r-- | firmware/export/usb_core.h | 23 |
2 files changed, 16 insertions, 24 deletions
diff --git a/firmware/export/usb.h b/firmware/export/usb.h index 6779372..4dae7c2 100644 --- a/firmware/export/usb.h +++ b/firmware/export/usb.h @@ -24,13 +24,13 @@ /* Messages from usb_tick and thread states */ enum { - USB_INSERTED, - USB_EXTRACTED, - USB_REENABLE, - USB_POWERED, - USB_TRANSFER_COMPLETION, - USB_REQUEST_DISK, - USB_REQUEST_REBOOT + USB_INSERTED, + USB_EXTRACTED, + USB_REENABLE, + USB_POWERED, + USB_TRANSFER_COMPLETION, + USB_REQUEST_DISK, + USB_REQUEST_REBOOT }; @@ -69,7 +69,8 @@ enum { enum { USB_DRIVER_MASS_STORAGE, USB_DRIVER_SERIAL, - USB_DRIVER_CHARGING_ONLY + USB_DRIVER_CHARGING_ONLY, + USB_NUM_DRIVERS }; #endif #ifdef HAVE_USBSTACK diff --git a/firmware/export/usb_core.h b/firmware/export/usb_core.h index bb4ce6c..97712bc 100644 --- a/firmware/export/usb_core.h +++ b/firmware/export/usb_core.h @@ -21,7 +21,7 @@ #ifndef BOOTLOADER -//#define USB_SERIAL +#define USB_SERIAL #define USB_STORAGE #define USB_CHARGING_ONLY #else /* BOOTLOADER */ @@ -32,19 +32,8 @@ #include "usb.h" /* endpoints */ -enum { - EP_CONTROL = 0, -#ifdef USB_STORAGE - EP_MASS_STORAGE, -#endif -#ifdef USB_SERIAL - EP_SERIAL, -#endif -#ifdef USB_CHARGING_ONLY - EP_CHARGING_ONLY, -#endif - NUM_ENDPOINTS -}; +#define EP_CONTROL 0 +#define NUM_ENDPOINTS 3 extern int usb_max_pkt_size; @@ -54,7 +43,9 @@ void usb_core_control_request(struct usb_ctrlrequest* req); void usb_core_transfer_complete(int endpoint, bool in, int status, int length); void usb_core_bus_reset(void); bool usb_core_exclusive_connection(void); -void usb_core_enable_protocol(int driver,bool enabled); -void usb_core_handle_transfer_completion(struct usb_transfer_completion_event_data* event); +void usb_core_enable_driver(int driver,bool enabled); +bool usb_core_driver_enabled (int driver); +void usb_core_handle_transfer_completion( + struct usb_transfer_completion_event_data* event); #endif |