diff options
| author | hathach <[email protected]> | 2014-04-25 15:16:52 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2014-04-25 15:16:52 +0700 |
| commit | d00655f598905f7855a2c54081373843c918fa1e (patch) | |
| tree | 4c0ebb4708e7684630a6ceb0ce98b2d3f25123f3 /tinyusb | |
| parent | 1fb7106061624e27a82dad0f1edcf1caff1501c0 (diff) | |
cdc device app rename CDCD_APP_BUFFER_SIZE to SERIAL_BUFFER_SIZE
cdc host app add SERIAL_BUFFER_SIZE for buffer constant, add cdc data receive if cb with TUSB_EVENT_XFER_ERROR
minor change to keyboard & mouse host app
add ASSERT_FAILED & ASSERT_FAILED_MSG
add cast to fix IAR build error with dcd_lpc43xx.c
FreeRTOS
- merge FreeRTOSConfig for m0, m3, m4
- re-implement application hook
- support portmacro.h for m0
Diffstat (limited to 'tinyusb')
| -rw-r--r-- | tinyusb/common/assertion.h | 8 | ||||
| -rw-r--r-- | tinyusb/device/dcd_lpc43xx.c | 2 | ||||
| -rw-r--r-- | tinyusb/osal/osal_freeRTOS.h | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/tinyusb/common/assertion.h b/tinyusb/common/assertion.h index 3832c00c4..dd2fbdc67 100644 --- a/tinyusb/common/assertion.h +++ b/tinyusb/common/assertion.h @@ -68,9 +68,9 @@ extern "C" // Assert Helper
//--------------------------------------------------------------------+
#ifndef _TEST_
- #define ASSERT_MESSAGE(format, ...) _PRINTF("Assert at %s: %s: %d: " format "\n", __BASE_FILE__, __func__ , __LINE__, __VA_ARGS__)
+ #define _ASSERT_MESSAGE(format, ...) _PRINTF("Assert at %s: %s: %d: " format "\n", __BASE_FILE__, __func__ , __LINE__, __VA_ARGS__)
#else // TODO remove this
- #define ASSERT_MESSAGE(format, ...) _PRINTF("%d:note: Assert " format "\n", __LINE__, __VA_ARGS__)
+ #define _ASSERT_MESSAGE(format, ...) _PRINTF("%d:note: Assert " format "\n", __LINE__, __VA_ARGS__)
#endif
#ifndef _TEST_ASSERT_
@@ -84,7 +84,7 @@ extern "C" setup_statement;\
if (!(condition)) {\
hal_debugger_breakpoint();\
- ASSERT_MESSAGE(format, __VA_ARGS__);\
+ _ASSERT_MESSAGE(format, __VA_ARGS__);\
error_handler(error, handler_para);\
}\
}while(0)
@@ -108,6 +108,8 @@ extern "C" #define ASSERT(...) ASSERT_TRUE(__VA_ARGS__)
#define ASSERT_TRUE(condition , error) ASSERT_DEFINE( , (condition), error, "%s", "evaluated to false")
#define ASSERT_FALSE(condition , error) ASSERT_DEFINE( ,!(condition), error, "%s", "evaluated to true")
+#define ASSERT_FAILED(error) ASSERT_DEFINE( , false, error, "%s", "FAILED")
+#define ASSERT_FAILED_MSG(error, msg) ASSERT_DEFINE( , false, error, "FAILED: %s", msg)
//--------------------------------------------------------------------+
// Pointer Assert
diff --git a/tinyusb/device/dcd_lpc43xx.c b/tinyusb/device/dcd_lpc43xx.c index 60d8e2fc7..46fb62fc0 100644 --- a/tinyusb/device/dcd_lpc43xx.c +++ b/tinyusb/device/dcd_lpc43xx.c @@ -524,7 +524,7 @@ void xfer_complete_isr(uint8_t coreid, uint32_t reg_complete) //------------- Free QTD and shift array list -------------//
p_qtd->used = 0; // free QTD
- memmove(p_qhd->list_qtd_idx, p_qhd->list_qtd_idx+1, DCD_QTD_PER_QHD_MAX-1);
+ memmove( (void*) p_qhd->list_qtd_idx, (void*) (p_qhd->list_qtd_idx+1), DCD_QTD_PER_QHD_MAX-1);
p_qhd->list_qtd_idx[DCD_QTD_PER_QHD_MAX-1]=0;
if (p_qtd->int_on_complete)
diff --git a/tinyusb/osal/osal_freeRTOS.h b/tinyusb/osal/osal_freeRTOS.h index 934b9bbad..26e7743be 100644 --- a/tinyusb/osal/osal_freeRTOS.h +++ b/tinyusb/osal/osal_freeRTOS.h @@ -100,6 +100,7 @@ static inline void osal_task_delay(uint32_t msec) // Semaphore API //--------------------------------------------------------------------+ #define OSAL_SEM_DEF(name) +#define OSAL_SEM_REF(name) typedef xSemaphoreHandle osal_semaphore_handle_t; // create FreeRTOS binary semaphore with zero as init value TODO: omit semaphore take from vSemaphoreCreateBinary API, should double checks this @@ -129,6 +130,7 @@ static inline void osal_semaphore_reset(osal_semaphore_handle_t const sem_hdl) // MUTEX API (priority inheritance) //--------------------------------------------------------------------+ #define OSAL_MUTEX_DEF OSAL_SEM_DEF +#define OSAL_MUTEX_REF OSAL_SEM_REF typedef xSemaphoreHandle osal_mutex_handle_t; #define osal_mutex_create(x) xSemaphoreCreateMutex() |
