mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
keep up with pio usb
This commit is contained in:
parent
98bbb0d402
commit
12debd7763
@ -32,7 +32,6 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
|
|||||||
${TOP}/lib/Pico-PIO-USB/pio_usb.c
|
${TOP}/lib/Pico-PIO-USB/pio_usb.c
|
||||||
${TOP}/lib/Pico-PIO-USB/pio_usb_host.c
|
${TOP}/lib/Pico-PIO-USB/pio_usb_host.c
|
||||||
${TOP}/lib/Pico-PIO-USB/pio_usb_device.c
|
${TOP}/lib/Pico-PIO-USB/pio_usb_device.c
|
||||||
${TOP}/lib/Pico-PIO-USB/pio_usb_hw.c
|
|
||||||
${TOP}/lib/Pico-PIO-USB/usb_crc.c
|
${TOP}/lib/Pico-PIO-USB/usb_crc.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit d15fffd950018c60cba5c98d676a4fafaeea2648
|
Subproject commit f656d703f3cee1e589eebb6606e204f59afb5611
|
@ -65,6 +65,7 @@ static inline void tu_print_var(uint8_t const* buf, uint32_t bufsize)
|
|||||||
// Log with Level
|
// Log with Level
|
||||||
#define TU_LOG(n, ...) TU_XSTRCAT(TU_LOG, n)(__VA_ARGS__)
|
#define TU_LOG(n, ...) TU_XSTRCAT(TU_LOG, n)(__VA_ARGS__)
|
||||||
#define TU_LOG_MEM(n, ...) TU_XSTRCAT3(TU_LOG, n, _MEM)(__VA_ARGS__)
|
#define TU_LOG_MEM(n, ...) TU_XSTRCAT3(TU_LOG, n, _MEM)(__VA_ARGS__)
|
||||||
|
#define TU_LOG_ARR(n, ...) TU_XSTRCAT3(TU_LOG, n, _ARR)(__VA_ARGS__)
|
||||||
#define TU_LOG_VAR(n, ...) TU_XSTRCAT3(TU_LOG, n, _VAR)(__VA_ARGS__)
|
#define TU_LOG_VAR(n, ...) TU_XSTRCAT3(TU_LOG, n, _VAR)(__VA_ARGS__)
|
||||||
#define TU_LOG_INT(n, ...) TU_XSTRCAT3(TU_LOG, n, _INT)(__VA_ARGS__)
|
#define TU_LOG_INT(n, ...) TU_XSTRCAT3(TU_LOG, n, _INT)(__VA_ARGS__)
|
||||||
#define TU_LOG_HEX(n, ...) TU_XSTRCAT3(TU_LOG, n, _HEX)(__VA_ARGS__)
|
#define TU_LOG_HEX(n, ...) TU_XSTRCAT3(TU_LOG, n, _HEX)(__VA_ARGS__)
|
||||||
@ -74,6 +75,7 @@ static inline void tu_print_var(uint8_t const* buf, uint32_t bufsize)
|
|||||||
// Log Level 1: Error
|
// Log Level 1: Error
|
||||||
#define TU_LOG1 tu_printf
|
#define TU_LOG1 tu_printf
|
||||||
#define TU_LOG1_MEM tu_print_mem
|
#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_VAR(_x) tu_print_var((uint8_t const*)(_x), sizeof(*(_x)))
|
||||||
#define TU_LOG1_INT(_x) tu_printf(#_x " = %ld\r\n", (unsigned long) (_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) )
|
#define TU_LOG1_HEX(_x) tu_printf(#_x " = %lX\r\n", (unsigned long) (_x) )
|
||||||
@ -82,6 +84,7 @@ static inline void tu_print_var(uint8_t const* buf, uint32_t bufsize)
|
|||||||
#if CFG_TUSB_DEBUG >= 2
|
#if CFG_TUSB_DEBUG >= 2
|
||||||
#define TU_LOG2 TU_LOG1
|
#define TU_LOG2 TU_LOG1
|
||||||
#define TU_LOG2_MEM TU_LOG1_MEM
|
#define TU_LOG2_MEM TU_LOG1_MEM
|
||||||
|
#define TU_LOG2_ARR TU_LOG1_ARR
|
||||||
#define TU_LOG2_VAR TU_LOG1_VAR
|
#define TU_LOG2_VAR TU_LOG1_VAR
|
||||||
#define TU_LOG2_INT TU_LOG1_INT
|
#define TU_LOG2_INT TU_LOG1_INT
|
||||||
#define TU_LOG2_HEX TU_LOG1_HEX
|
#define TU_LOG2_HEX TU_LOG1_HEX
|
||||||
@ -91,6 +94,7 @@ static inline void tu_print_var(uint8_t const* buf, uint32_t bufsize)
|
|||||||
#if CFG_TUSB_DEBUG >= 3
|
#if CFG_TUSB_DEBUG >= 3
|
||||||
#define TU_LOG3 TU_LOG1
|
#define TU_LOG3 TU_LOG1
|
||||||
#define TU_LOG3_MEM TU_LOG1_MEM
|
#define TU_LOG3_MEM TU_LOG1_MEM
|
||||||
|
#define TU_LOG3_ARR TU_LOG1_ARR
|
||||||
#define TU_LOG3_VAR TU_LOG1_VAR
|
#define TU_LOG3_VAR TU_LOG1_VAR
|
||||||
#define TU_LOG3_INT TU_LOG1_INT
|
#define TU_LOG3_INT TU_LOG1_INT
|
||||||
#define TU_LOG3_HEX TU_LOG1_HEX
|
#define TU_LOG3_HEX TU_LOG1_HEX
|
||||||
|
@ -119,8 +119,8 @@ void dcd_edpt_close_all (uint8_t rhport)
|
|||||||
bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
|
bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
|
||||||
{
|
{
|
||||||
(void) rhport;
|
(void) rhport;
|
||||||
pio_hw_endpoint_t *ep = pio_usb_device_get_ep(ep_addr);
|
endpoint_t *ep = pio_usb_device_get_ep(ep_addr);
|
||||||
return pio_usb_endpoint_transfer(ep, buffer, total_bytes);
|
return pio_usb_ll_endpoint_transfer(ep, buffer, total_bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Submit a transfer where is managed by FIFO, When complete dcd_event_xfer_complete() is invoked to notify the stack - optional, however, must be listed in usbd.c
|
// Submit a transfer where is managed by FIFO, When complete dcd_event_xfer_complete() is invoked to notify the stack - optional, however, must be listed in usbd.c
|
||||||
@ -137,7 +137,7 @@ bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t
|
|||||||
void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
|
void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
|
||||||
{
|
{
|
||||||
(void) rhport;
|
(void) rhport;
|
||||||
pio_hw_endpoint_t *ep = pio_usb_device_get_ep(ep_addr);
|
endpoint_t *ep = pio_usb_device_get_ep(ep_addr);
|
||||||
ep->stalled = true;
|
ep->stalled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
|
|||||||
void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
|
void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
|
||||||
{
|
{
|
||||||
(void) rhport;
|
(void) rhport;
|
||||||
pio_hw_endpoint_t *ep = pio_usb_device_get_ep(ep_addr);
|
endpoint_t *ep = pio_usb_device_get_ep(ep_addr);
|
||||||
ep->data_id = 0;
|
ep->data_id = 0;
|
||||||
ep->stalled = false;
|
ep->stalled = false;
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ static void __no_inline_not_in_flash_func(handle_endpoint_irq)(pio_hw_root_port_
|
|||||||
|
|
||||||
if (ep_all & mask)
|
if (ep_all & mask)
|
||||||
{
|
{
|
||||||
pio_hw_endpoint_t* ep = PIO_USB_HW_EP(ep_idx);
|
endpoint_t* ep = PIO_USB_HW_EP(ep_idx);
|
||||||
uint8_t const tu_rhport = port - PIO_USB_HW_RPORT(0) + 1;
|
uint8_t const tu_rhport = port - PIO_USB_HW_RPORT(0) + 1;
|
||||||
dcd_event_xfer_complete(tu_rhport, ep->ep_num, ep->actual_len, result, true);
|
dcd_event_xfer_complete(tu_rhport, ep->ep_num, ep->actual_len, result, true);
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ bool hcd_port_connect_status(uint8_t rhport)
|
|||||||
rhport = RHPORT_PIO(rhport);
|
rhport = RHPORT_PIO(rhport);
|
||||||
|
|
||||||
pio_hw_root_port_t *root = PIO_USB_HW_RPORT(rhport);
|
pio_hw_root_port_t *root = PIO_USB_HW_RPORT(rhport);
|
||||||
port_pin_status_t line_state = pio_hw_get_line_state(root);
|
port_pin_status_t line_state = pio_usb_ll_get_line_state(root);
|
||||||
|
|
||||||
return line_state != PORT_PIN_SE0;
|
return line_state != PORT_PIN_SE0;
|
||||||
}
|
}
|
||||||
@ -187,7 +187,7 @@ static void __no_inline_not_in_flash_func(handle_endpoint_irq)(pio_hw_root_port_
|
|||||||
|
|
||||||
if (ep_all & mask)
|
if (ep_all & mask)
|
||||||
{
|
{
|
||||||
pio_hw_endpoint_t* ep = PIO_USB_HW_EP(ep_idx);
|
endpoint_t* ep = PIO_USB_HW_EP(ep_idx);
|
||||||
hcd_event_xfer_complete(ep->dev_addr, ep->ep_num, ep->actual_len, result, true);
|
hcd_event_xfer_complete(ep->dev_addr, ep->ep_num, ep->actual_len, result, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user