From 63add701391ae30cd43bb2a06d87df3dda5803b8 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 9 May 2013 12:49:52 +0700 Subject: test clean up --- tinyusb/class/hid.h | 4 ++-- tinyusb/class/msc.h | 20 ++++++++++++++++++++ tinyusb/host/ehci/ehci.c | 3 ++- tinyusb/host/usbh.c | 2 +- tinyusb/osal/osal_none.h | 2 +- 5 files changed, 26 insertions(+), 5 deletions(-) (limited to 'tinyusb') diff --git a/tinyusb/class/hid.h b/tinyusb/class/hid.h index c526ab2b4..cf70f66aa 100644 --- a/tinyusb/class/hid.h +++ b/tinyusb/class/hid.h @@ -46,12 +46,12 @@ #ifndef _TUSB_HID_H_ #define _TUSB_HID_H_ +#include "common/common.h" + #ifdef __cplusplus extern "C" { #endif -#include "common/common.h" - enum { HID_SUBCLASS_NONE = 0, HID_SUBCLASS_BOOT = 1 diff --git a/tinyusb/class/msc.h b/tinyusb/class/msc.h index ad9f46c4b..53e2e93df 100644 --- a/tinyusb/class/msc.h +++ b/tinyusb/class/msc.h @@ -52,6 +52,26 @@ extern "C" { #endif +//--------------------------------------------------------------------+ +// USB Class Constant +//--------------------------------------------------------------------+ +enum { + MSC_SUBCLASS_RBC = 1 , + MSC_SUBCLASS_SFF_MMC , + MSC_SUBCLASS_QIC , + MSC_SUBCLASS_UFI , + MSC_SUBCLASS_SFF , + MSC_SUBCLASS_SCSI +}; + +// CBI only approved to use with full-speed floopy disk & should not used with highspeed or device other than floopy +enum { + MSC_PROTOCOL_CBI = 0, + MSC_PROTOCOL_CBI_NO_INTERRUPT = 1, + MSC_PROTOCOL_BOT = 0x50 +}; + + //--------------------------------------------------------------------+ // SCSI Primary Command (SPC-4) //--------------------------------------------------------------------+ diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c index 43dae3235..21c457c17 100644 --- a/tinyusb/host/ehci/ehci.c +++ b/tinyusb/host/ehci/ehci.c @@ -533,11 +533,12 @@ void async_list_process_isr(ehci_qhd_t * const async_head) void period_list_process_isr(uint8_t hostid, uint8_t interval_ms) { uint8_t max_loop = 0; + uint32_t const period_1ms_addr = (uint32_t) get_period_head(hostid, 1); ehci_link_t next_item = * get_period_head(hostid, interval_ms); // TODO abstract max loop guard for period while( !next_item.terminate && - !(interval_ms > 1 && align32(next_item.address) == (uint32_t) get_period_head(hostid, 1)) && + !(interval_ms > 1 && period_1ms_addr == align32(next_item.address)) && max_loop < (EHCI_MAX_QHD + EHCI_MAX_ITD + EHCI_MAX_SITD)) { switch ( next_item.type ) diff --git a/tinyusb/host/usbh.c b/tinyusb/host/usbh.c index cda5418ff..28c114e1e 100644 --- a/tinyusb/host/usbh.c +++ b/tinyusb/host/usbh.c @@ -243,7 +243,7 @@ void usbh_device_unplugged_isr(uint8_t hostid) usbh_class_drivers[class_code].close) { usbh_class_drivers[class_code].close(dev_addr); - } + } } } diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index 176342809..e542e519a 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -147,7 +147,7 @@ static inline volatile uint32_t osal_tick_get(void) #define SUBTASK_ASSERT(condition) \ ASSERT_DEFINE_WITH_HANDLER(_SUBTASK_ASSERT_ERROR_HANDLER, , , \ (condition), TUSB_ERROR_OSAL_TASK_FAILED, "%s", "evaluated to false") - +// TODO remove assert with handler by catching error in enum main task #define SUBTASK_ASSERT_WITH_HANDLER(condition, func_call) \ ASSERT_DEFINE_WITH_HANDLER(_SUBTASK_ASSERT_ERROR_HANDLER, func_call, ,\ condition, TUSB_ERROR_OSAL_TASK_FAILED, "%s", "evaluated to false") -- cgit v1.3.1