diff options
author | Diego Ismirlian <dismirlian@gmail.com> | 2019-10-03 14:00:34 -0300 |
---|---|---|
committer | Diego Ismirlian <dismirlian@gmail.com> | 2019-10-03 14:00:34 -0300 |
commit | ea844db44656f481cda59bc71234d54be37ed5bf (patch) | |
tree | 22c21b29afc393b5813b58776cfa728e90f1b916 /os/hal/include/hal_usbh.h | |
parent | 2800f71230de7684cb805701ac40791f5d0876b6 (diff) | |
parent | 75027a647490d62d875c8012c0eac83a441304a8 (diff) | |
download | ChibiOS-Contrib-ea844db44656f481cda59bc71234d54be37ed5bf.tar.gz ChibiOS-Contrib-ea844db44656f481cda59bc71234d54be37ed5bf.tar.bz2 ChibiOS-Contrib-ea844db44656f481cda59bc71234d54be37ed5bf.zip |
Merge branch 'master' into segger_systemview
Diffstat (limited to 'os/hal/include/hal_usbh.h')
-rw-r--r-- | os/hal/include/hal_usbh.h | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/os/hal/include/hal_usbh.h b/os/hal/include/hal_usbh.h index aa49205..6e83a44 100644 --- a/os/hal/include/hal_usbh.h +++ b/os/hal/include/hal_usbh.h @@ -242,6 +242,31 @@ struct usbh_port { _usbh_port_ll_data }; + +#if USBH_DEBUG_ENABLE +struct usbh_dq { + int rem; + int sz; + uint8_t *first; + uint8_t *next; + uint8_t *start; + uint8_t *end; +}; + +typedef struct usbh_dq usbh_dq_t; + +struct usbh_debug_helper { + uint8_t buff[USBH_DEBUG_BUFFER]; + THD_WORKING_AREA(thd_wa, 512); + usbh_dq_t dq; + systime_t first; + systime_t last; + bool ena; + bool on; + thread_reference_t tr; +}; +#endif + struct USBHDriver { usbh_status_t status; uint8_t address_bitmap[(USBH_MAX_ADDRESSES + 7) / 8]; @@ -255,15 +280,16 @@ struct USBHDriver { /* Low level part */ _usbhdriver_ll_data -#if USBH_DEBUG_ENABLE +#if USBH_DEBUG_ENABLE && USBH_DEBUG_MULTI_HOST /* debug */ - uint8_t dbg_buff[USBH_DEBUG_BUFFER]; - THD_WORKING_AREA(waDebug, 512); - input_queue_t iq; + struct usbh_debug_helper debug; #endif }; - +#if USBH_DEBUG_ENABLE && !USBH_DEBUG_MULTI_HOST +/* debug */ +extern struct usbh_debug_helper usbh_debug; +#endif /*===========================================================================*/ /* External declarations. */ @@ -289,10 +315,10 @@ extern "C" { /* Device-related */ #if USBH_DEBUG_ENABLE && USBH_DEBUG_ENABLE_INFO void usbhDevicePrintInfo(usbh_device_t *dev); - void usbhDevicePrintConfiguration(const uint8_t *descriptor, uint16_t rem); + void usbhDevicePrintConfiguration(const usbh_device_t *dev, const uint8_t *descriptor, uint16_t rem); #else # define usbhDevicePrintInfo(dev) do {} while(0) -# define usbhDevicePrintConfiguration(descriptor, rem) do {} while(0) +# define usbhDevicePrintConfiguration(dev, descriptor, rem) do {} while(0) #endif bool usbhDeviceReadString(usbh_device_t *dev, char *dest, uint8_t size, uint8_t index, uint16_t langID); |