diff --git a/demos/host/host_cmsis_rtx/host_cmsis_rtx.uvopt b/demos/host/host_cmsis_rtx/host_cmsis_rtx.uvopt index 1c67808d1..895dbdf77 100644 --- a/demos/host/host_cmsis_rtx/host_cmsis_rtx.uvopt +++ b/demos/host/host_cmsis_rtx/host_cmsis_rtx.uvopt @@ -132,10 +132,6 @@ Segger\JL2CM3.dll - - 0 - DLGUARM - 0 DLGTARM @@ -668,10 +664,10 @@ 1 0 0 - 16 + 6 0 - 33 - 41 + 34 + 49 0 ..\..\..\tinyusb\tusb.c tusb.c @@ -1022,7 +1018,7 @@ 0 25 0 - 144 + 153 161 0 ..\..\bsp\lpc43xx\startup_keil\startup_LPC43xx.s @@ -1046,7 +1042,7 @@ 0 0 0 - 211 + 212 217 0 ..\..\..\vendor\cmsis_rtos_rtx\RTX_Conf_CM.c diff --git a/demos/host/src/cdc_serial_app.c b/demos/host/src/cdc_serial_app.c index f676bc043..197d60a84 100644 --- a/demos/host/src/cdc_serial_app.c +++ b/demos/host/src/cdc_serial_app.c @@ -49,7 +49,7 @@ //--------------------------------------------------------------------+ // MACRO CONSTANT TYPEDEF //--------------------------------------------------------------------+ -OSAL_TASK_DEF("cdc serial app", cdc_serial_app_task, 128, CDC_SERIAL_APP_TASK_PRIO); +OSAL_TASK_DEF(cdc_serial_app_task, 128, CDC_SERIAL_APP_TASK_PRIO); OSAL_QUEUE_DEF(queue_def, QUEUE_SERIAL_DEPTH, uint8_t); static osal_queue_handle_t queue_hdl; diff --git a/demos/host/src/keyboard_app.c b/demos/host/src/keyboard_app.c index 91b81406c..27d5c0cfe 100644 --- a/demos/host/src/keyboard_app.c +++ b/demos/host/src/keyboard_app.c @@ -55,7 +55,7 @@ //--------------------------------------------------------------------+ // INTERNAL OBJECT & FUNCTION DECLARATION //--------------------------------------------------------------------+ -OSAL_TASK_DEF("keyboard app", keyboard_app_task, 128, KEYBOARD_APP_TASK_PRIO); +OSAL_TASK_DEF(keyboard_app_task, 128, KEYBOARD_APP_TASK_PRIO); OSAL_QUEUE_DEF(queue_kbd_def, QUEUE_KEYBOARD_REPORT_DEPTH, tusb_keyboard_report_t); static osal_queue_handle_t queue_kbd_hdl; diff --git a/demos/host/src/main.c b/demos/host/src/main.c index 5c0534bf7..ebbacfc4a 100644 --- a/demos/host/src/main.c +++ b/demos/host/src/main.c @@ -72,7 +72,7 @@ // INTERNAL OBJECT & FUNCTION DECLARATION //--------------------------------------------------------------------+ OSAL_TASK_FUNCTION( led_blinking_task ) (void* p_task_para); -OSAL_TASK_DEF("led blinking", led_blinking_task, 128, LED_BLINKING_APP_TASK_PRIO); +OSAL_TASK_DEF(led_blinking_task, 128, LED_BLINKING_APP_TASK_PRIO); void print_greeting(void); static inline void wait_blocking_ms(uint32_t ms); diff --git a/demos/host/src/mouse_app.c b/demos/host/src/mouse_app.c index 1c6049729..425be056f 100644 --- a/demos/host/src/mouse_app.c +++ b/demos/host/src/mouse_app.c @@ -56,7 +56,7 @@ //--------------------------------------------------------------------+ // INTERNAL OBJECT & FUNCTION DECLARATION //--------------------------------------------------------------------+ -OSAL_TASK_DEF("mouse app", mouse_app_task, 128, MOUSE_APP_TASK_PRIO); +OSAL_TASK_DEF(mouse_app_task, 128, MOUSE_APP_TASK_PRIO); OSAL_QUEUE_DEF(queue_mouse_def, QUEUE_MOUSE_REPORT_DEPTH, tusb_mouse_report_t); static osal_queue_handle_t queue_mouse_hdl; diff --git a/readme.md b/readme.md index c93ce10a7..d7ffe27eb 100644 --- a/readme.md +++ b/readme.md @@ -29,6 +29,7 @@ tinyusb is designed to be OS-ware and run across OS vendors, thanks to its OS Ab - **None OS** - **FreeRTOS** +- **CMSIS RTX** ## Is It Ready ## @@ -44,7 +45,10 @@ coming soon ... ## Supported Toolchains ## -currently only lpcxpresso/redsuite is supported. However Keil & IAR are always on top of the list. +The following toolchain is supported + +- lpcxpresso/redsuite +- Keil ## Supported Boards ## diff --git a/tests/lpc18xx_43xx/test/test_osal_none.c b/tests/lpc18xx_43xx/test/test_osal_none.c index 46e7d090d..731b69b86 100644 --- a/tests/lpc18xx_43xx/test/test_osal_none.c +++ b/tests/lpc18xx_43xx/test/test_osal_none.c @@ -60,9 +60,9 @@ osal_mutex_handle_t mutex_hdl; void setUp(void) { memset(statements, 0, sizeof(statements)); - sem_hdl = osal_semaphore_create(OSAL_SEM_REF(sem)); - queue_hdl = osal_queue_create(&queue); - mutex_hdl = osal_mutex_create(OSAL_MUTEX_REF(mutex)); + sem_hdl = osal_semaphore_create (OSAL_SEM_REF(sem)); + queue_hdl = osal_queue_create (OSAL_QUEUE_REF(queue)); + mutex_hdl = osal_mutex_create (OSAL_MUTEX_REF(mutex)); } void tearDown(void) diff --git a/tinyusb/osal/osal.h b/tinyusb/osal/osal.h index cc6b7f700..d2287b3a5 100644 --- a/tinyusb/osal/osal.h +++ b/tinyusb/osal/osal.h @@ -89,9 +89,11 @@ uint32_t osal_tick_get(void); typedef uint32_t osal_task_t; tusb_error_t osal_task_create(osal_task_t *task); -#define OSAL_TASK_DEF(variable, name, code, stack_depth, prio) \ +#define OSAL_TASK_DEF(code, stack_depth, prio) \ osal_task_t variable +#define OSAL_TASK_REF(name) (&name) + #define OSAL_TASK_FUNCTION(task_name) \ void task_name @@ -176,6 +178,8 @@ typedef osal_queue_t * osal_queue_handle_t; #define OSAL_QUEUE_DEF(name, queue_depth, type) \ osal_queue_t name +#define OSAL_QUEUE_REF(name) (&name) + osal_queue_handle_t osal_queue_create (osal_queue_t *p_queue); void osal_queue_receive (osal_queue_handle_t const queue_hdl, void *p_data, uint32_t msec, tusb_error_t *p_error); tusb_error_t osal_queue_send (osal_queue_handle_t const queue_hdl, const void * data); diff --git a/tinyusb/osal/osal_freeRTOS.h b/tinyusb/osal/osal_freeRTOS.h index 8bdd58cd8..add9292f0 100644 --- a/tinyusb/osal/osal_freeRTOS.h +++ b/tinyusb/osal/osal_freeRTOS.h @@ -82,14 +82,16 @@ typedef struct { unsigned portBASE_TYPE prio; } osal_task_t; -#define OSAL_TASK_DEF(task_variable, task_name, task_code, task_stack_depth, task_prio) \ - osal_task_t task_variable = {\ - .name = task_name , \ +#define OSAL_TASK_DEF(task_code, task_stack_depth, task_prio) \ + osal_task_t osal_task_def_##task_code = {\ + .name = #task_code , \ .code = task_code , \ .stack_depth = task_stack_depth , \ .prio = task_prio \ } +#define OSAL_TASK_REF(name) (&osal_task_def_##name) + static inline tusb_error_t osal_task_create(osal_task_t *task) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline tusb_error_t osal_task_create(osal_task_t *task) { @@ -208,6 +210,8 @@ typedef xQueueHandle osal_queue_handle_t; .item_size = sizeof(type)\ } +#define OSAL_QUEUE_REF(name) (&name) + #define osal_queue_create(p_queue) \ xQueueCreate((p_queue)->depth, (p_queue)->item_size) diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index acc5bdb07..7a5b2ff78 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -88,7 +88,7 @@ static inline uint32_t osal_tick_get(void) // OSAL_TASK_LOOP_ENG // } //--------------------------------------------------------------------+ -#define OSAL_TASK_DEF(variable, name, code, stack_depth, prio) +#define OSAL_TASK_DEF(code, stack_depth, prio) #define osal_task_create(x) TUSB_ERROR_NONE #define OSAL_TASK_FUNCTION(task_func) \ @@ -267,6 +267,8 @@ typedef osal_queue_t * osal_queue_handle_t; .item_size = sizeof(type)\ } +#define OSAL_QUEUE_REF(name) (&name) + static inline osal_queue_handle_t osal_queue_create(osal_queue_t * const p_queue) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline osal_queue_handle_t osal_queue_create(osal_queue_t * const p_queue) { diff --git a/vendor/freertos/lpc43xx_m4_FreeRTOSConfig.h b/vendor/freertos/lpc43xx_m4_FreeRTOSConfig.h index 59151778b..e204478a2 100644 --- a/vendor/freertos/lpc43xx_m4_FreeRTOSConfig.h +++ b/vendor/freertos/lpc43xx_m4_FreeRTOSConfig.h @@ -80,7 +80,7 @@ #define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 16 ) #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16*1024 ) ) -#define configMAX_TASK_NAME_LEN ( 20 ) +#define configMAX_TASK_NAME_LEN ( 32 ) #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1