diff options
| author | hathach <[email protected]> | 2018-03-11 13:01:57 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-03-11 13:01:57 +0700 |
| commit | 0384e40320605aa7b2b28777f41feabcc3b3f130 (patch) | |
| tree | 7593065e5b6f8aa01ddda91db7297d8144d6d940 /tinyusb | |
| parent | c39b24001d57a128dc0d094c509ae4ed3998e617 (diff) | |
rename hal_* to tusb_hal_*
Diffstat (limited to 'tinyusb')
| -rw-r--r-- | tinyusb/common/assertion.h | 2 | ||||
| -rw-r--r-- | tinyusb/common/verify.h | 6 | ||||
| -rw-r--r-- | tinyusb/device/dcd.h | 1 | ||||
| -rw-r--r-- | tinyusb/host/ehci/ehci.c | 2 | ||||
| -rw-r--r-- | tinyusb/osal/osal_none.h | 8 | ||||
| -rw-r--r-- | tinyusb/tusb.c | 6 | ||||
| -rw-r--r-- | tinyusb/tusb_hal.h | 10 |
7 files changed, 17 insertions, 18 deletions
diff --git a/tinyusb/common/assertion.h b/tinyusb/common/assertion.h index 16c9b07e4..f91f00301 100644 --- a/tinyusb/common/assertion.h +++ b/tinyusb/common/assertion.h @@ -84,7 +84,7 @@ extern "C" do{\
setup_statement;\
if (!(condition)) {\
- hal_debugger_breakpoint();\
+ tusb_hal_dbg_breakpoint();\
_ASSERT_MESSAGE(format, __VA_ARGS__);\
error_handler(error, handler_para);\
}\
diff --git a/tinyusb/common/verify.h b/tinyusb/common/verify.h index f48e91662..3aec0a9f8 100644 --- a/tinyusb/common/verify.h +++ b/tinyusb/common/verify.h @@ -148,12 +148,12 @@ /*------------------------------------------------------------------*/ /* ASSERT - * basically VERIFY with hal_debugger_breakpoint as handler + * basically VERIFY with tusb_hal_dbg_breakpoint as handler * - 1 arg : return false if failed * - 2 arg : return error if failed *------------------------------------------------------------------*/ -#define ASSERT_1ARGS(cond) do { if (!(cond)) { hal_debugger_breakpoint(); _ASSERT_MESS() return false; } } while(0) -#define ASSERT_2ARGS(cond, _error) do { if (!(cond)) { hal_debugger_breakpoint(); _ASSERT_MESS() return _error;} } while(0) +#define ASSERT_1ARGS(cond) do { if (!(cond)) { tusb_hal_dbg_breakpoint(); _ASSERT_MESS() return false; } } while(0) +#define ASSERT_2ARGS(cond, _error) do { if (!(cond)) { tusb_hal_dbg_breakpoint(); _ASSERT_MESS() return _error;} } while(0) #define ASSERT_(...) GET_3RD_ARG(__VA_ARGS__, ASSERT_2ARGS, ASSERT_1ARGS)(__VA_ARGS__) diff --git a/tinyusb/device/dcd.h b/tinyusb/device/dcd.h index b786a92a1..a7aec4ef9 100644 --- a/tinyusb/device/dcd.h +++ b/tinyusb/device/dcd.h @@ -58,7 +58,6 @@ typedef enum USBD_BUS_EVENT_RESUME
}usbd_bus_event_type_t;
-// TODO move Hal
typedef struct {
uint8_t port;
uint8_t index; // must be zero to indicate control
diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c index f76b6c3f3..391dedb6d 100644 --- a/tinyusb/host/ehci/ehci.c +++ b/tinyusb/host/ehci/ehci.c @@ -647,7 +647,7 @@ static void qhd_xfer_error_isr(ehci_qhd_t * p_qhd) p_qhd->total_xferred_bytes += p_qhd->p_qtd_list_head->expected_bytes - p_qhd->p_qtd_list_head->total_bytes;
-// if ( TUSB_EVENT_XFER_ERROR == error_event ) hal_debugger_breakpoint(); // TODO skip unplugged device
+// if ( TUSB_EVENT_XFER_ERROR == error_event ) tusb_hal_dbg_breakpoint(); // TODO skip unplugged device
p_qhd->p_qtd_list_head->used = 0; // free QTD
qtd_remove_1st_from_qhd(p_qhd);
diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index 16e7021ac..229c51b99 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -53,7 +53,7 @@ //--------------------------------------------------------------------+
// TICK API
//--------------------------------------------------------------------+
-#define osal_tick_get hal_tick_get
+#define osal_tick_get tusb_hal_tick_get
//--------------------------------------------------------------------+
// TASK API
@@ -204,11 +204,11 @@ static inline void osal_queue_flush(osal_queue_t const queue_hdl) else\
return TUSB_ERROR_OSAL_WAITING;\
} else{\
- /*TODO mutex lock hal_usb_int_disable */\
+ /*TODO mutex lock tusb_hal_init_disable */\
memcpy(p_data, queue_hdl->buffer + (queue_hdl->rd_idx * queue_hdl->item_size), queue_hdl->item_size);\
queue_hdl->rd_idx = (queue_hdl->rd_idx + 1) % queue_hdl->depth;\
queue_hdl->count--;\
- /*TODO mutex unlock hal_usb_int_enable */\
+ /*TODO mutex unlock tusb_hal_init_enable */\
*(p_error) = TUSB_ERROR_NONE;\
}\
}while(0)
@@ -258,7 +258,7 @@ static inline void osal_semaphore_reset(osal_semaphore_t sem_hdl) else\
return TUSB_ERROR_OSAL_WAITING;\
} else{\
- if (sem_hdl->count) sem_hdl->count--; /*TODO mutex hal_usb_int_disable consideration*/\
+ if (sem_hdl->count) sem_hdl->count--; /*TODO mutex tusb_hal_init_disable consideration*/\
*(p_error) = TUSB_ERROR_NONE;\
}\
}while(0)
diff --git a/tinyusb/tusb.c b/tinyusb/tusb.c index cf94c1b23..b9af2092f 100644 --- a/tinyusb/tusb.c +++ b/tinyusb/tusb.c @@ -42,7 +42,7 @@ tusb_error_t tusb_init(void)
{
- VERIFY( hal_usb_init(), TUSB_ERROR_FAILED ) ; // hardware init
+ VERIFY( tusb_hal_init(), TUSB_ERROR_FAILED ) ; // hardware init
#if MODE_HOST_SUPPORTED
ASSERT_STATUS( usbh_init() ); // host stack init
@@ -53,11 +53,11 @@ tusb_error_t tusb_init(void) #endif
#if (TUSB_CFG_CONTROLLER_0_MODE)
- hal_usb_int_enable(0);
+ tusb_hal_init_enable(0);
#endif
#if (TUSB_CFG_CONTROLLER_1_MODE)
- hal_usb_int_enable(1);
+ tusb_hal_init_enable(1);
#endif
return TUSB_ERROR_NONE;
diff --git a/tinyusb/tusb_hal.h b/tinyusb/tusb_hal.h index 76a1e15c4..dd5d19e09 100644 --- a/tinyusb/tusb_hal.h +++ b/tinyusb/tusb_hal.h @@ -68,26 +68,26 @@ extern "C" { * \returns true if succeedded
* \note This function is invoked by \ref tusb_init as part of the initialization.
*/
-bool hal_usb_init(void);
+bool tusb_hal_init(void);
/** \brief Enable USB Interrupt on a specific USB Controller
* \param[in] port is a zero-based index to identify USB controller's ID
* \note Some MCUs such as NXP LPC43xx has multiple USB controllers. It is necessary to know which USB controller for
* those MCUs.
*/
-void hal_usb_int_enable(uint8_t port);
+void tusb_hal_init_enable(uint8_t port);
/** \brief Disable USB Interrupt on a specific USB Controller
* \param[in] port is a zero-based index to identify USB controller's ID
* \note Some MCUs such as NXP LPC43xx has multiple USB controllers. It is necessary to know which USB controller for
* those MCUs.
*/
-void hal_usb_int_disable(uint8_t port);
+void tusb_hal_init_disable(uint8_t port);
-uint32_t hal_tick_get(void);
+uint32_t tusb_hal_tick_get(void);
// for debug only, halt mcu if assert/verify is failed if debugger is attached
-void hal_debugger_breakpoint(void) ATTR_WEAK;
+void tusb_hal_dbg_breakpoint(void) ATTR_WEAK;
#ifdef __cplusplus
}
|
