From effabc5271a5d021673fd671ab77e69d6dc58881 Mon Sep 17 00:00:00 2001 From: Filip Jagodzinski Date: Fri, 19 Oct 2018 17:27:36 +0200 Subject: [PATCH] lp ticker wrapper: Add undefined behavior warning --- hal/LowPowerTickerWrapper.h | 3 +++ hal/mbed_lp_ticker_wrapper.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/hal/LowPowerTickerWrapper.h b/hal/LowPowerTickerWrapper.h index aac8d70d171..8a6a05aca0d 100644 --- a/hal/LowPowerTickerWrapper.h +++ b/hal/LowPowerTickerWrapper.h @@ -74,6 +74,9 @@ class LowPowerTickerWrapper { * * This stops to wrapper layer from using the microsecond ticker. * This should be called before using the low power ticker APIs directly. + * + * @warning: Make sure to suspend the LP ticker first (call ticker_suspend()), + * otherwise the behavior is undefined. */ void suspend(); diff --git a/hal/mbed_lp_ticker_wrapper.h b/hal/mbed_lp_ticker_wrapper.h index 4b317e36c27..e1c1fe4a264 100644 --- a/hal/mbed_lp_ticker_wrapper.h +++ b/hal/mbed_lp_ticker_wrapper.h @@ -53,6 +53,9 @@ const ticker_data_t *get_lp_ticker_wrapper_data(const ticker_data_t *data); * * Pass through all interrupts to the low power ticker and stop using * the microsecond ticker. + * + * @warning: Make sure to suspend the LP ticker first (call ticker_suspend()), + * otherwise the behavior is undefined. */ void lp_ticker_wrapper_suspend(void);