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
This commit is contained in:
hathach
2014-04-25 15:16:52 +07:00
parent 1fb7106061
commit d00655f598
25 changed files with 316 additions and 916 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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()