From ba4a01e8ff49ab3c4df22bfdff2d3bb5d15579f5 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Sun, 30 Sep 2018 14:02:16 +0200 Subject: [PATCH] drivers: timer: native_posix: Support SYSTEM_CLOCK_DISABLE Add support for CONFIG_SYSTEM_CLOCK_DISABLE so applications may be compiled with CONFIG_REBOOT. Signed-off-by: Alberto Escolar Piedras --- drivers/timer/native_posix_timer.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/timer/native_posix_timer.c b/drivers/timer/native_posix_timer.c index bc70222abaa..d0046e77c24 100644 --- a/drivers/timer/native_posix_timer.c +++ b/drivers/timer/native_posix_timer.c @@ -133,3 +133,19 @@ void k_busy_wait(u32_t usec_to_wait) } } #endif + +#if defined(CONFIG_SYSTEM_CLOCK_DISABLE) +/** + * + * @brief Stop announcing sys ticks into the kernel + * + * Disable the system ticks generation + * + * @return N/A + */ +void sys_clock_disable(void) +{ + irq_disable(TIMER_TICK_IRQ); + hwtimer_set_silent_ticks(INT64_MAX); +} +#endif /* CONFIG_SYSTEM_CLOCK_DISABLE */