From 82a98d75efb5b3c06e4b57883b022c887f36249a Mon Sep 17 00:00:00 2001 From: "Peter A. Bigot" Date: Mon, 21 Sep 2020 05:34:56 -0500 Subject: [PATCH] kernel: timer: clarification on k_timer_stop_t requirements The documentation of the callback implies it is invoked from a thread, but the documentation of the stop function states it can be called from interrupt context. Signed-off-by: Peter A. Bigot --- include/kernel.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/kernel.h b/include/kernel.h index 9c353d025d3..70f94dcac2c 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -1832,7 +1832,10 @@ typedef void (*k_timer_expiry_t)(struct k_timer *timer); * @brief Timer stop function type. * * A timer's stop function is executed if the timer is stopped prematurely. - * The function runs in the context of the thread that stops the timer. + * The function runs in the context of call that stops the timer. As + * k_timer_stop() can be invoked from an ISR, the stop function must be + * callable from interrupt context (isr-ok). + * * The stop function is optional, and is only invoked if the timer has been * initialized with one. *