diff options
| author | hathach <[email protected]> | 2022-04-27 20:52:56 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2022-04-27 20:52:56 +0700 |
| commit | ae5490e5a5cd8650a45578b4ac70dbe89b002fb1 (patch) | |
| tree | e8aa3de0a30163bff20ae5d4079270ed00e5e3fc /src | |
| parent | 4a661dead0899cb154325a8257d19281f2536af3 (diff) | |
clean up
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/tusb_debug.h | 6 | ||||
| -rw-r--r-- | src/device/usbd.c | 2 | ||||
| -rw-r--r-- | src/host/usbh.c | 6 | ||||
| -rw-r--r-- | src/portable/raspberrypi/pio_usb/dcd_pio_usb.c | 1 | ||||
| -rw-r--r-- | src/portable/raspberrypi/pio_usb/hcd_pio_usb.c | 1 |
5 files changed, 7 insertions, 9 deletions
diff --git a/src/common/tusb_debug.h b/src/common/tusb_debug.h index 1ea2c19f5..ac5bee6ec 100644 --- a/src/common/tusb_debug.h +++ b/src/common/tusb_debug.h @@ -57,7 +57,7 @@ void tu_print_mem(void const *buf, uint32_t count, uint8_t indent); #define tu_printf printf #endif -static inline void tu_print_var(uint8_t const* buf, uint32_t bufsize) +static inline void tu_print_arr(uint8_t const* buf, uint32_t bufsize) { for(uint32_t i=0; i<bufsize; i++) tu_printf("%02X ", buf[i]); } @@ -75,8 +75,8 @@ static inline void tu_print_var(uint8_t const* buf, uint32_t bufsize) // Log Level 1: Error #define TU_LOG1 tu_printf #define TU_LOG1_MEM tu_print_mem -#define TU_LOG1_ARR(_x, _n) tu_print_var((uint8_t const*)(_x), _n) -#define TU_LOG1_VAR(_x) tu_print_var((uint8_t const*)(_x), sizeof(*(_x))) +#define TU_LOG1_ARR(_x, _n) tu_print_arr((uint8_t const*)(_x), _n) +#define TU_LOG1_VAR(_x) tu_print_arr((uint8_t const*)(_x), sizeof(*(_x))) #define TU_LOG1_INT(_x) tu_printf(#_x " = %ld\r\n", (unsigned long) (_x) ) #define TU_LOG1_HEX(_x) tu_printf(#_x " = %lX\r\n", (unsigned long) (_x) ) diff --git a/src/device/usbd.c b/src/device/usbd.c index 4c2cd3abd..e545e8056 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -265,7 +265,7 @@ static inline usbd_class_driver_t const * get_driver(uint8_t drvid) //--------------------------------------------------------------------+ enum { RHPORT_INVALID = 0xFFu }; -static volatile uint8_t _usbd_rhport = RHPORT_INVALID; +static uint8_t _usbd_rhport = RHPORT_INVALID; // Event queue // usbd_int_set() is used as mutex in OS NONE config diff --git a/src/host/usbh.c b/src/host/usbh.c index 4df60626a..a0d9d83d3 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -410,7 +410,7 @@ void tuh_task_ext(uint32_t timeout_ms, bool in_isr) case HCD_EVENT_DEVICE_ATTACH: // TODO due to the shared _usbh_ctrl_buf, we must complete enumerating // one device before enumerating another one. - TU_LOG2("[rh%d] USBH DEVICE ATTACH\r\n", event.rhport); + TU_LOG2("[%u:] USBH DEVICE ATTACH\r\n", event.rhport); enum_new_device(&event); break; @@ -799,7 +799,7 @@ bool usbh_edpt_xfer_with_callback(uint8_t dev_addr, uint8_t ep_addr, uint8_t * b static bool usbh_edpt_control_open(uint8_t dev_addr, uint8_t max_packet_size) { - TU_LOG2("[%u] Open EP0 with Size = %u\r\n", dev_addr, max_packet_size); + TU_LOG2("[%u:%u] Open EP0 with Size = %u\r\n", usbh_get_rhport(dev_addr), dev_addr, max_packet_size); tusb_desc_endpoint_t ep0_desc = { @@ -1279,7 +1279,7 @@ static void process_enumeration(tuh_xfer_t* xfer) if (_dev0.hub_addr == 0) { // connected directly to roothub -#if !CFG_TUH_RPI_PIO_USB // skip this reset for pio-usb +#if !CFG_TUH_RPI_PIO_USB // FIXME skip this reset for pio-usb hcd_port_reset( _dev0.rhport ); osal_task_delay(RESET_DELAY); hcd_port_reset_end(_dev0.rhport); diff --git a/src/portable/raspberrypi/pio_usb/dcd_pio_usb.c b/src/portable/raspberrypi/pio_usb/dcd_pio_usb.c index 3daa39a8b..fb10087b5 100644 --- a/src/portable/raspberrypi/pio_usb/dcd_pio_usb.c +++ b/src/portable/raspberrypi/pio_usb/dcd_pio_usb.c @@ -29,7 +29,6 @@ #if CFG_TUD_ENABLED && (CFG_TUSB_MCU == OPT_MCU_RP2040) && CFG_TUD_RPI_PIO_USB #include "pico.h" -#include "hardware/pio.h" #include "pio_usb.h" #include "pio_usb_ll.h" diff --git a/src/portable/raspberrypi/pio_usb/hcd_pio_usb.c b/src/portable/raspberrypi/pio_usb/hcd_pio_usb.c index f6caabb54..3c7378561 100644 --- a/src/portable/raspberrypi/pio_usb/hcd_pio_usb.c +++ b/src/portable/raspberrypi/pio_usb/hcd_pio_usb.c @@ -29,7 +29,6 @@ #if CFG_TUH_ENABLED && (CFG_TUSB_MCU == OPT_MCU_RP2040) && CFG_TUH_RPI_PIO_USB #include "pico.h" -#include "hardware/pio.h" #include "pio_usb.h" #include "pio_usb_ll.h" |
