diff options
| author | hathach <[email protected]> | 2013-02-26 17:28:05 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-02-26 17:28:05 +0700 |
| commit | 49da21086004bd666564c5bd1bd2a0bb7938205d (patch) | |
| tree | cb57d60704f8cb41b7450108ea12b3ec7cabcd7a /tinyusb/common/assertion.h | |
| parent | ac744b0401b93bade7d71e38db9f911c9d213fde (diff) | |
add osal subtask support
add usbh_control_xfer_subtask as xfer and wait
fix potential error when update device info & open control pipe for new address
fix build error with hal_****.c
add STATIC_ASSSERT to perform compile time checking with sizeof later
update osal_queue_receive and osal_semaphore_wait for osal_none to support subtask
Diffstat (limited to 'tinyusb/common/assertion.h')
| -rw-r--r-- | tinyusb/common/assertion.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tinyusb/common/assertion.h b/tinyusb/common/assertion.h index f0f780fe9..67aeb90b9 100644 --- a/tinyusb/common/assertion.h +++ b/tinyusb/common/assertion.h @@ -58,6 +58,14 @@ extern "C" #include "tusb_option.h" +//--------------------------------------------------------------------+ +// Compile-time Assert +//--------------------------------------------------------------------+ +#ifdef __COUNTER__ +#define STATIC_ASSSERT(const_expr) enum { XSTRING_CONCAT(static_assert_, __COUNTER__) = 1/(!!(const_expr)) } +#else +#define STATIC_ASSSERT(const_expr) enum { XSTRING_CONCAT(static_assert_, __LINE__) = 1/(!!(const_expr)) } +#endif //#if ( defined CFG_PRINTF_UART || defined CFG_PRINTF_USBCDC || defined CFG_PRINTF_DEBUG ) #if TUSB_CFG_DEBUG #define _PRINTF(...) printf(__VA_ARGS__) |
