remove cmsis rtx support
This commit is contained in:
@@ -71,11 +71,19 @@ void led_blinking_set_interval(uint32_t ms)
|
|||||||
led_blink_interval_ms = ms;
|
led_blink_interval_ms = ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tusb_error_t led_blinking_subtask(void);
|
||||||
void led_blinking_task(void* param)
|
void led_blinking_task(void* param)
|
||||||
{
|
{
|
||||||
(void) param;
|
(void) param;
|
||||||
|
|
||||||
OSAL_TASK_LOOP_BEGIN
|
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;
|
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);
|
// 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
|
// TODO remove legacy cmsis code
|
||||||
|
|||||||
@@ -50,8 +50,6 @@
|
|||||||
#define LOWER_PRIO(x) 0 // does not matter
|
#define LOWER_PRIO(x) 0 // does not matter
|
||||||
#elif TUSB_CFG_OS == TUSB_OS_FREERTOS
|
#elif TUSB_CFG_OS == TUSB_OS_FREERTOS
|
||||||
#define LOWER_PRIO(x) ((x)-1) // freeRTOS lower number --> lower priority
|
#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
|
#else
|
||||||
#error Priority is not configured for this RTOS
|
#error Priority is not configured for this RTOS
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -79,10 +79,6 @@ void os_none_start_scheduler(void)
|
|||||||
|
|
||||||
int main(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();
|
board_init();
|
||||||
print_greeting();
|
print_greeting();
|
||||||
|
|
||||||
@@ -101,8 +97,6 @@ int main(void)
|
|||||||
vTaskStartScheduler();
|
vTaskStartScheduler();
|
||||||
#elif TUSB_CFG_OS == TUSB_OS_NONE
|
#elif TUSB_CFG_OS == TUSB_OS_NONE
|
||||||
os_none_start_scheduler();
|
os_none_start_scheduler();
|
||||||
#elif TUSB_CFG_OS == TUSB_OS_CMSIS_RTX
|
|
||||||
osKernelStart();
|
|
||||||
#else
|
#else
|
||||||
#error need to start RTOS schduler
|
#error need to start RTOS schduler
|
||||||
#endif
|
#endif
|
||||||
@@ -119,7 +113,6 @@ void print_greeting(void)
|
|||||||
{
|
{
|
||||||
[TUSB_OS_NONE] = "None",
|
[TUSB_OS_NONE] = "None",
|
||||||
[TUSB_OS_FREERTOS] = "FreeRTOS",
|
[TUSB_OS_FREERTOS] = "FreeRTOS",
|
||||||
[TUSB_OS_CMSIS_RTX] = "CMSIS-RTX"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
printf("\n\
|
printf("\n\
|
||||||
|
|||||||
@@ -51,8 +51,6 @@
|
|||||||
* @{ */
|
* @{ */
|
||||||
#define TUSB_OS_NONE 1 ///< No RTOS is used
|
#define TUSB_OS_NONE 1 ///< No RTOS is used
|
||||||
#define TUSB_OS_FREERTOS 2 ///< FreeRTOS 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"
|
#include "tusb_option.h"
|
||||||
@@ -71,8 +69,6 @@ static inline bool osal_task_create(osal_func_t code, const char* name, uint32_t
|
|||||||
#else
|
#else
|
||||||
#if TUSB_CFG_OS == TUSB_OS_FREERTOS
|
#if TUSB_CFG_OS == TUSB_OS_FREERTOS
|
||||||
#include "osal_freeRTOS.h"
|
#include "osal_freeRTOS.h"
|
||||||
#elif TUSB_CFG_OS == TUSB_OS_CMSIS_RTX
|
|
||||||
#include "osal_cmsis_rtx.h"
|
|
||||||
#else
|
#else
|
||||||
#error TUSB_CFG_OS is not defined or OS is not supported yet
|
#error TUSB_CFG_OS is not defined or OS is not supported yet
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -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);
|
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)
|
static inline void osal_task_delay(uint32_t msec)
|
||||||
{
|
{
|
||||||
vTaskDelay( (TUSB_CFG_TICKS_HZ * msec) / 1000 );
|
vTaskDelay( (TUSB_CFG_TICKS_HZ * msec) / 1000 );
|
||||||
|
|||||||
Reference in New Issue
Block a user