diff options
| author | hathach <[email protected]> | 2013-02-04 00:03:08 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-02-04 00:03:08 +0700 |
| commit | 5f8839fff8ff12bbf172b5fb9a984867a0d1d8da (patch) | |
| tree | 0f983489c408ecea8d79661b40d42498a0e709ed /tinyusb/osal/osal_none.h | |
| parent | 3ac88f1b4ec4ab83682b5c1b1589970096bbc1c4 (diff) | |
refine ASSERT_DEFINE to allow special error_handler for os task
add device_addr0 for enumeration task
start to add osal port for freeRTOS
Diffstat (limited to 'tinyusb/osal/osal_none.h')
| -rw-r--r-- | tinyusb/osal/osal_none.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index 682f60efa..2056f5214 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -90,19 +90,12 @@ uint32_t osal_tick_get(void); state = 0;\ } -#define TASK_ASSERT_DEFINE(setup_statement, condition, error, format, ...) \ - do{\ - setup_statement;\ - if (!(condition)) {\ - ASSERT_MESSAGE(format, __VA_ARGS__);\ - state = 0; /* reset task loop */\ - break;\ - }\ - }while(0) +#define TASK_ASSERT_ERROR_HANDLER \ + state = 0; break; -#define TASK_ASSERT(condition, error) TASK_ASSERT_DEFINE( , (condition), error, "%s", "evaluated to false") +#define TASK_ASSERT(condition) ASSERT_DEFINE_WITH_HANDLER(TASK_ASSERT_ERROR_HANDLER, , (condition), (void) 0, "%s", "evaluated to false") #define TASK_ASSERT_STATUS(sts) \ - TASK_ASSERT_DEFINE(tusb_error_t status = (tusb_error_t)(sts),\ + ASSERT_DEFINE_WITH_HANDLER(TASK_ASSERT_ERROR_HANDLER, tusb_error_t status = (tusb_error_t)(sts),\ TUSB_ERROR_NONE == status, status, "%s", TUSB_ErrorStr[status]) //--------------------------------------------------------------------+ // Semaphore API |
