From 8eaad2326b26f542ba66ea305a40dd4c8e49f421 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 11 Mar 2013 12:00:25 +0700 Subject: add semphore reset & queue flush API modify test to check control pipe semaphore created with usbh_init --- tinyusb/host/ehci/ehci.c | 2 -- tinyusb/host/usbh.c | 19 ++++++++++++++++++- tinyusb/host/usbh_hcd.h | 10 +--------- 3 files changed, 19 insertions(+), 12 deletions(-) (limited to 'tinyusb/host') diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c index 46ea67bf1..faabb4a55 100644 --- a/tinyusb/host/ehci/ehci.c +++ b/tinyusb/host/ehci/ehci.c @@ -340,7 +340,6 @@ static inline ehci_qtd_t* get_control_qtds(uint8_t dev_addr) ATTR_ALWAYS_INLINE //--------------------------------------------------------------------+ // CONTROL PIPE API //--------------------------------------------------------------------+ -// TODO subject to pure function static void init_qtd(ehci_qtd_t* p_qtd, uint32_t data_ptr, uint16_t total_bytes) { memclr_(p_qtd, sizeof(ehci_qtd_t)); @@ -537,7 +536,6 @@ static inline ehci_qtd_t* get_control_qtds(uint8_t dev_addr) } -// TODO subject to pure function static void init_qhd(ehci_qhd_t *p_qhd, uint8_t dev_addr, uint16_t max_packet_size, uint8_t endpoint_addr, uint8_t xfer_type) { memclr_(p_qhd, sizeof(ehci_qhd_t)); diff --git a/tinyusb/host/usbh.c b/tinyusb/host/usbh.c index c84abbc5d..ad4bf3b2a 100644 --- a/tinyusb/host/usbh.c +++ b/tinyusb/host/usbh.c @@ -103,6 +103,13 @@ tusb_error_t usbh_init(void) ASSERT_STATUS( hcd_init() ); + //------------- Semaphore for Control Pipe -------------// + for(uint8_t i=0; i