summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--boards/board.c10
-rw-r--r--demos/device/src/app_os_prio.h2
-rw-r--r--demos/device/src/main.c7
-rw-r--r--tinyusb/osal/osal.h4
-rw-r--r--tinyusb/osal/osal_freeRTOS.h1
5 files changed, 9 insertions, 15 deletions
diff --git a/boards/board.c b/boards/board.c
index 75529f3a9..fa28a557c 100644
--- a/boards/board.c
+++ b/boards/board.c
@@ -71,11 +71,19 @@ void led_blinking_set_interval(uint32_t ms)
led_blink_interval_ms = ms;
}
+tusb_error_t led_blinking_subtask(void);
void led_blinking_task(void* param)
{
(void) param;
OSAL_TASK_LOOP_BEGIN
+ led_blinking_subtask();
+ OSAL_TASK_LOOP_END
+}
+
+tusb_error_t led_blinking_subtask(void)
+{
+ OSAL_SUBTASK_BEGIN
static uint32_t led_on_mask = 0;
@@ -92,7 +100,7 @@ void led_blinking_task(void* param)
// if ( BIT_TEST_(btn_mask, i) ) printf("button %d is pressed\n", i);
// }
- OSAL_TASK_LOOP_END
+ OSAL_SUBTASK_END
}
// TODO remove legacy cmsis code
diff --git a/demos/device/src/app_os_prio.h b/demos/device/src/app_os_prio.h
index 52d42efe3..5d932a41e 100644
--- a/demos/device/src/app_os_prio.h
+++ b/demos/device/src/app_os_prio.h
@@ -50,8 +50,6 @@
#define LOWER_PRIO(x) 0 // does not matter
#elif TUSB_CFG_OS == TUSB_OS_FREERTOS
#define LOWER_PRIO(x) ((x)-1) // freeRTOS lower number --> lower priority
-#elif TUSB_CFG_OS == TUSB_OS_CMSIS_RTX
- #define LOWER_PRIO(x) ((x)-1) // CMSIS-RTOS lower number --> lower priority
#else
#error Priority is not configured for this RTOS
#endif
diff --git a/demos/device/src/main.c b/demos/device/src/main.c
index de6250529..bb26d0368 100644
--- a/demos/device/src/main.c
+++ b/demos/device/src/main.c
@@ -79,10 +79,6 @@ void os_none_start_scheduler(void)
int main(void)
{
-#if TUSB_CFG_OS == TUSB_OS_CMSIS_RTX
- osKernelInitialize(); // CMSIS RTX requires kernel init before any other OS functions
-#endif
-
board_init();
print_greeting();
@@ -101,8 +97,6 @@ int main(void)
vTaskStartScheduler();
#elif TUSB_CFG_OS == TUSB_OS_NONE
os_none_start_scheduler();
-#elif TUSB_CFG_OS == TUSB_OS_CMSIS_RTX
- osKernelStart();
#else
#error need to start RTOS schduler
#endif
@@ -119,7 +113,6 @@ void print_greeting(void)
{
[TUSB_OS_NONE] = "None",
[TUSB_OS_FREERTOS] = "FreeRTOS",
- [TUSB_OS_CMSIS_RTX] = "CMSIS-RTX"
};
printf("\n\
diff --git a/tinyusb/osal/osal.h b/tinyusb/osal/osal.h
index 9f7a2b320..4f2fdad22 100644
--- a/tinyusb/osal/osal.h
+++ b/tinyusb/osal/osal.h
@@ -51,8 +51,6 @@
* @{ */
#define TUSB_OS_NONE 1 ///< No RTOS is used
#define TUSB_OS_FREERTOS 2 ///< FreeRTOS is used
-#define TUSB_OS_CMSIS_RTX 3 ///< CMSIS RTX is used
-#define TUSB_OS_UCOS3 4 ///< MicroC OS III is used (not supported yet)
/** @} */
#include "tusb_option.h"
@@ -71,8 +69,6 @@ static inline bool osal_task_create(osal_func_t code, const char* name, uint32_t
#else
#if TUSB_CFG_OS == TUSB_OS_FREERTOS
#include "osal_freeRTOS.h"
- #elif TUSB_CFG_OS == TUSB_OS_CMSIS_RTX
- #include "osal_cmsis_rtx.h"
#else
#error TUSB_CFG_OS is not defined or OS is not supported yet
#endif
diff --git a/tinyusb/osal/osal_freeRTOS.h b/tinyusb/osal/osal_freeRTOS.h
index 363aa1863..d8d42c033 100644
--- a/tinyusb/osal/osal_freeRTOS.h
+++ b/tinyusb/osal/osal_freeRTOS.h
@@ -69,7 +69,6 @@ static inline bool osal_task_create(osal_func_t code, const char* name, uint32_t
return xTaskCreate(code, (const signed char*) name, stack_size, param, prio, task_hdl);
}
-static inline void osal_task_delay(uint32_t msec) ATTR_ALWAYS_INLINE;
static inline void osal_task_delay(uint32_t msec)
{
vTaskDelay( (TUSB_CFG_TICKS_HZ * msec) / 1000 );