1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #5216 from authmillenon/tests/fix/i4372

tests: xtimer_msg_receive_timeout: initialize values
This commit is contained in:
Kaspar Schleiser 2016-03-31 22:18:37 +02:00
commit 757d4618e4
2 changed files with 17 additions and 5 deletions

View File

@ -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
*/

View File

@ -37,6 +37,8 @@ int main(void)
xtimer_t t;
int64_t offset = -1000;
tmsg.type = 44;
t.target = 0;
t.long_target = 0;
for (int i = 0; i < 10; i++) {
xtimer_set_msg(&t, TEST_PERIOD + offset, &tmsg, sched_active_pid);