From 4fb12ae9887516e7790c7369f04c124ac5dcbd3e Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Wed, 1 Feb 2017 20:06:55 -0500 Subject: [PATCH] kernel: k_timer_stop: remove assert when called from an ISR Change-Id: I596e0323a7aafc9d7f3834a8d1b655ad2540d4ef Signed-off-by: Anas Nashif --- include/kernel.h | 3 +++ kernel/timer.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/kernel.h b/include/kernel.h index b7dad97ab34..527e6f436bd 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -932,6 +932,9 @@ extern void k_timer_start(struct k_timer *timer, * Attempting to stop a timer that is not running is permitted, but has no * effect on the timer. * + * @note Can be called by ISRs. The stop handler has to be callable from ISRs + * if @a k_timer_stop is to be called from ISRs. + * * @param timer Address of timer. * * @return N/A diff --git a/kernel/timer.c b/kernel/timer.c index c7afc111a8f..2f0c8218eb9 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -131,8 +131,6 @@ void k_timer_start(struct k_timer *timer, int32_t duration, int32_t period) void k_timer_stop(struct k_timer *timer) { - __ASSERT(!_is_in_isr(), ""); - int key = irq_lock(); int inactive = (_abort_timeout(&timer->timeout) == _INACTIVE);