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:
parent
d543e8c835
commit
76fc443b1e
2 changed files with 28 additions and 1 deletions
|
@ -256,7 +256,7 @@ uint32_t osKernelSysTick (void);
|
||||||
|
|
||||||
/// The RTOS kernel system timer frequency in Hz
|
/// The RTOS kernel system timer frequency in Hz
|
||||||
/// \note Reflects the system timer setting and is typically defined in a configuration file.
|
/// \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.
|
/// Convert a microseconds value to a RTOS kernel system timer value.
|
||||||
/// \param microsec time value in microseconds.
|
/// \param microsec time value in microseconds.
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
|
|
||||||
#include <kernel_structs.h>
|
#include <kernel_structs.h>
|
||||||
#include <cmsis_os.h>
|
#include <cmsis_os.h>
|
||||||
|
#include <ksched.h>
|
||||||
|
|
||||||
|
extern const k_tid_t _main_thread;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the RTOS kernel system timer counter
|
* @brief Get the RTOS kernel system timer counter
|
||||||
|
@ -14,3 +17,27 @@ uint32_t osKernelSysTick(void)
|
||||||
{
|
{
|
||||||
return k_cycle_get_32();
|
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);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue