lib/cmsis_rtos_v1: Implement support for kernel APIs

These APIs allow for checking whether the kernel is initialized,
started or running.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
This commit is contained in:
Rajavardhan Gundi 2018-07-18 09:55:57 +05:30 committed by Anas Nashif
commit 76fc443b1e
2 changed files with 28 additions and 1 deletions

View file

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

View file

@ -6,6 +6,9 @@
#include <kernel_structs.h>
#include <cmsis_os.h>
#include <ksched.h>
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);
}