timer & tickless bugfix
1. fix a bug of timer_update when TOS_CFG_TIMER_AS_PROC > 0u 2. support disable tickless in runtime 3. fix a header file dependency bug, which cause k_tick_t typedef-ed to uint32_t 4. fix tick_count drift in tickless_proc
This commit is contained in:
@@ -40,18 +40,6 @@
|
||||
#error "INVALID config, TOS_CFG_TASK_PRIO_MAX must be >= 8"
|
||||
#endif
|
||||
|
||||
#if (TOS_CFG_TASK_DYNAMIC_CREATE_EN > 0u) && (TOS_CFG_MMHEAP_EN == 0u)
|
||||
#error "INVALID config, must enable TOS_CFG_MMHEAP_EN to support dynamic task create"
|
||||
#endif
|
||||
|
||||
#if (TOS_CFG_PRIORITY_MESSAGE_QUEUE_EN > 0u) && (TOS_CFG_MMHEAP_EN == 0u)
|
||||
#error "INVALID config, must enable TOS_CFG_MMHEAP_EN to support tos_prio_msg_q"
|
||||
#endif
|
||||
|
||||
#if (TOS_CFG_PRIORITY_MAIL_QUEUE_EN > 0u) && (TOS_CFG_MMHEAP_EN == 0u)
|
||||
#error "INVALID config, must enable TOS_CFG_MMHEAP_EN to support tos_prio_mail_q"
|
||||
#endif
|
||||
|
||||
#if ((TOS_CFG_TIMER_EN > 0u) && !defined(TOS_CFG_TIMER_AS_PROC))
|
||||
#error "UNDECLARED config, TOS_CFG_TIMER_AS_PROC"
|
||||
#endif
|
||||
@@ -62,10 +50,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (TOS_CFG_VFS_EN > 0u) && (TOS_CFG_MMHEAP_EN == 0u)
|
||||
#error "INVALID config, must enable TOS_CFG_MMHEAP_EN to use tos_vfs"
|
||||
#endif
|
||||
|
||||
#ifndef TOS_CFG_CPU_HRTIMER_EN
|
||||
#error "UNDECLARED config, TOS_CFG_CPU_HRTIMER_EN should be declared in 'port_config.h'"
|
||||
#elif (TOS_CFG_CPU_HRTIMER_EN > 0u) && !defined(TOS_CFG_CPU_HRTIMER_SIZE)
|
||||
|
@@ -20,15 +20,15 @@
|
||||
|
||||
#include <tos_compiler.h>
|
||||
#include <tos_err.h>
|
||||
#include <tos_ktypes.h>
|
||||
#include <tos_cpu_def.h>
|
||||
#include <tos_config.h>
|
||||
#include <tos_config_default.h>
|
||||
#include <port_config.h>
|
||||
#include <tos_config_check.h>
|
||||
#include <tos_cpu_types.h>
|
||||
#include <tos_ktypes.h>
|
||||
#include <port.h>
|
||||
#include <tos_cpu.h>
|
||||
#include <tos_config_check.h>
|
||||
#include <tos_fault.h>
|
||||
#include <tos_klib.h>
|
||||
#include <tos_list.h>
|
||||
|
@@ -78,8 +78,7 @@ pm_device_ctl_t k_pm_device_ctl = { 0u };
|
||||
/* default idle power manager mode is SLEEP */
|
||||
idle_pwrmgr_mode_t k_idle_pwr_mgr_mode = IDLE_POWER_MANAGER_MODE_SLEEP;
|
||||
|
||||
/* default low power mode is SLEEP */
|
||||
k_cpu_lpwr_mode_t k_cpu_lpwr_mode = TOS_LOW_POWER_MODE_SLEEP;
|
||||
k_cpu_lpwr_mode_t k_cpu_lpwr_mode = TOS_LOW_POWER_MODE_NONE;
|
||||
#endif
|
||||
|
||||
#if TOS_CFG_TICKLESS_EN > 0u
|
||||
|
@@ -278,7 +278,7 @@ __KNL__ void timer_update(void)
|
||||
{
|
||||
k_timer_t *tmr, *tmp;
|
||||
|
||||
if (k_timer_ctl.next_expires < k_tick_count) {
|
||||
if (k_timer_ctl.next_expires > k_tick_count) { // not yet
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user