From 0620028e90d6bd462ee4519e57ab9b96545e1a23 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Thu, 31 Mar 2016 19:08:53 +0200 Subject: [PATCH] xtimer: doc: document required initialization of target fields --- sys/include/xtimer.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/sys/include/xtimer.h b/sys/include/xtimer.h index c65a82acfa..05c68270b9 100644 --- a/sys/include/xtimer.h +++ b/sys/include/xtimer.h @@ -180,7 +180,9 @@ void xtimer_usleep_until(uint32_t *last_wakeup, uint32_t usecs); * The mesage struct specified by msg parameter will not be copied, e.g., it * needs to point to valid memory until the message has been delivered. * - * @param[in] timer timer struct to work with + * @param[in] timer timer struct to work with. + * Its xtimer_t::target and xtimer_t::long_target + * fields need to be initialized with 0 on first use. * @param[in] offset microseconds from now * @param[in] msg ptr to msg that will be sent * @param[in] target_pid pid the message will be sent to @@ -196,7 +198,9 @@ void xtimer_set_msg(xtimer_t *timer, uint32_t offset, msg_t *msg, kernel_pid_t t * The mesage struct specified by msg parameter will not be copied, e.g., it * needs to point to valid memory until the message has been delivered. * - * @param[in] timer timer struct to work with + * @param[in] timer timer struct to work with. + * Its xtimer_t::target and xtimer_t::long_target + * fields need to be initialized with 0 on first use. * @param[in] offset microseconds from now * @param[in] msg ptr to msg that will be sent * @param[in] target_pid pid the message will be sent to @@ -209,7 +213,9 @@ void xtimer_set_msg64(xtimer_t *timer, uint64_t offset, msg_t *msg, kernel_pid_t * This function sets a timer that will wake up a thread when the timer has * expired. * - * @param[in] timer timer struct to work with + * @param[in] timer timer struct to work with. + * Its xtimer_t::target and xtimer_t::long_target + * fields need to be initialized with 0 on first use * @param[in] offset microseconds from now * @param[in] pid pid of the thread that will be woken up */ @@ -221,7 +227,9 @@ void xtimer_set_wakeup(xtimer_t *timer, uint32_t offset, kernel_pid_t pid); * This function sets a timer that will wake up a thread when the timer has * expired. * - * @param[in] timer timer struct to work with + * @param[in] timer timer struct to work with. + * Its xtimer_t::target and xtimer_t::long_target + * fields need to be initialized with 0 on first use * @param[in] offset microseconds from now * @param[in] pid pid of the thread that will be woken up */ @@ -239,7 +247,9 @@ void xtimer_set_wakeup64(xtimer_t *timer, uint64_t offset, kernel_pid_t pid); * context (unless offset < XTIMER_BACKOFF). DON'T USE THIS FUNCTION unless you * know *exactly* what that means. * - * @param[in] timer the timer structure to use + * @param[in] timer the timer structure to use. + * Its xtimer_t::target and xtimer_t::long_target + * fields need to be initialized with 0 on first use * @param[in] offset time in microseconds from now specifying that timer's * callback's execution time */