Skip to content
Snippets Groups Projects
Commit e27ce246 authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

sys: xtimer: add xtimer_wakeup64

parent a22f0a3c
No related branches found
No related tags found
No related merge requests found
...@@ -215,6 +215,18 @@ void xtimer_set_msg64(xtimer_t *timer, uint64_t offset, msg_t *msg, kernel_pid_t ...@@ -215,6 +215,18 @@ void xtimer_set_msg64(xtimer_t *timer, uint64_t offset, msg_t *msg, kernel_pid_t
*/ */
void xtimer_set_wakeup(xtimer_t *timer, uint32_t offset, kernel_pid_t pid); void xtimer_set_wakeup(xtimer_t *timer, uint32_t offset, kernel_pid_t pid);
/**
* @brief Set a timer that wakes up a thread, 64bit version
*
* 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] offset microseconds from now
* @param[in] pid pid of the thread that will be woken up
*/
void xtimer_set_wakeup64(xtimer_t *timer, uint64_t offset, kernel_pid_t pid);
/** /**
* @brief Set a timer to execute a callback at some time in the future * @brief Set a timer to execute a callback at some time in the future
* *
......
...@@ -127,6 +127,14 @@ void xtimer_set_wakeup(xtimer_t *timer, uint32_t offset, kernel_pid_t pid) ...@@ -127,6 +127,14 @@ void xtimer_set_wakeup(xtimer_t *timer, uint32_t offset, kernel_pid_t pid)
xtimer_set(timer, offset); xtimer_set(timer, offset);
} }
void xtimer_set_wakeup64(xtimer_t *timer, uint64_t offset, kernel_pid_t pid)
{
timer->callback = _callback_wakeup;
timer->arg = (void*) ((intptr_t)pid);
_xtimer_set64(timer, offset, offset >> 32);
}
/** /**
* see http://www.hackersdelight.org/magic.htm. * see http://www.hackersdelight.org/magic.htm.
* This is to avoid using long integer division functions * This is to avoid using long integer division functions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment