diff --git a/include/cmsis_rtos_v1/cmsis_os.h b/include/cmsis_rtos_v1/cmsis_os.h index 1e0cd44ce08..22c1f8fcfca 100644 --- a/include/cmsis_rtos_v1/cmsis_os.h +++ b/include/cmsis_rtos_v1/cmsis_os.h @@ -256,7 +256,7 @@ uint32_t osKernelSysTick (void); /// The RTOS kernel system timer frequency in Hz /// \note Reflects the system timer setting and is typically defined in a configuration file. -#define osKernelSysTickFrequency 100000000 +#define osKernelSysTickFrequency sys_clock_hw_cycles_per_sec /// Convert a microseconds value to a RTOS kernel system timer value. /// \param microsec time value in microseconds. diff --git a/lib/cmsis_rtos_v1/cmsis_kernel.c b/lib/cmsis_rtos_v1/cmsis_kernel.c index 26362d49dd0..58be2d34bc9 100644 --- a/lib/cmsis_rtos_v1/cmsis_kernel.c +++ b/lib/cmsis_rtos_v1/cmsis_kernel.c @@ -6,6 +6,9 @@ #include #include +#include + +extern const k_tid_t _main_thread; /** * @brief Get the RTOS kernel system timer counter @@ -14,3 +17,27 @@ uint32_t osKernelSysTick(void) { return k_cycle_get_32(); } + +/** + * @brief Initialize the RTOS Kernel for creating objects. + */ +osStatus osKernelInitialize(void) +{ + return osOK; +} + +/** + * @brief Start the RTOS Kernel. + */ +osStatus osKernelStart(void) +{ + return osOK; +} + +/** + * @brief Check if the RTOS kernel is already started. + */ +int32_t osKernelRunning(void) +{ + return _has_thread_started(_main_thread); +}