Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
fb2beb43
Unverified
Commit
fb2beb43
authored
7 years ago
by
Kaspar Schleiser
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #8875 from Josar/pr/xtimer64
sys/include/xtimer: Added xtimer_set64()
parents
b117638f
bb7acca3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sys/include/xtimer.h
+21
-0
21 additions, 0 deletions
sys/include/xtimer.h
sys/include/xtimer/implementation.h
+11
-1
11 additions, 1 deletion
sys/include/xtimer/implementation.h
with
32 additions
and
1 deletion
sys/include/xtimer.h
+
21
−
0
View file @
fb2beb43
...
@@ -291,6 +291,27 @@ static inline void xtimer_set_wakeup64(xtimer_t *timer, uint64_t offset, kernel_
...
@@ -291,6 +291,27 @@ static inline void xtimer_set_wakeup64(xtimer_t *timer, uint64_t offset, kernel_
*/
*/
static
inline
void
xtimer_set
(
xtimer_t
*
timer
,
uint32_t
offset
);
static
inline
void
xtimer_set
(
xtimer_t
*
timer
,
uint32_t
offset
);
/**
* @brief Set a timer to execute a callback at some time in the future, 64bit
* version
*
* Expects timer->callback to be set.
*
* The callback specified in the timer struct will be executed @p offset_usec
* microseconds in the future.
*
* @warning BEWARE! Callbacks from xtimer_set() are being executed in interrupt
* 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.
* Its xtimer_t::target and xtimer_t::long_target
* fields need to be initialized with 0 on first use
* @param[in] offset_us time in microseconds from now specifying that timer's
* callback's execution time
*/
static
inline
void
xtimer_set64
(
xtimer_t
*
timer
,
uint64_t
offset_us
);
/**
/**
* @brief remove a timer
* @brief remove a timer
*
*
...
...
This diff is collapsed.
Click to expand it.
sys/include/xtimer/implementation.h
+
11
−
1
View file @
fb2beb43
/*
/*
* Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
* Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
* Copyright (C) 2016 Eistec AB
* 2016 Eistec AB
* 2018 Josua Arndt
*
*
* This file is subject to the terms and conditions of the GNU Lesser
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* General Public License v2.1. See the file LICENSE in the top level
...
@@ -13,8 +14,11 @@
...
@@ -13,8 +14,11 @@
* @{
* @{
* @file
* @file
* @brief xtimer implementation
* @brief xtimer implementation
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
* @author Kaspar Schleiser <kaspar@schleiser.de>
* @author Joakim Nohlgård <joakim.nohlgard@eistec.se>
* @author Joakim Nohlgård <joakim.nohlgard@eistec.se>
* @author Josua Arndt <jarndt@ias.rwth-aachen.de>
*
*/
*/
#ifndef XTIMER_IMPLEMENTATION_H
#ifndef XTIMER_IMPLEMENTATION_H
#define XTIMER_IMPLEMENTATION_H
#define XTIMER_IMPLEMENTATION_H
...
@@ -217,6 +221,12 @@ static inline void xtimer_set(xtimer_t *timer, uint32_t offset)
...
@@ -217,6 +221,12 @@ static inline void xtimer_set(xtimer_t *timer, uint32_t offset)
_xtimer_set
(
timer
,
_xtimer_ticks_from_usec
(
offset
));
_xtimer_set
(
timer
,
_xtimer_ticks_from_usec
(
offset
));
}
}
static
inline
void
xtimer_set64
(
xtimer_t
*
timer
,
uint64_t
period_us
)
{
uint64_t
ticks
=
_xtimer_ticks_from_usec64
(
period_us
);
_xtimer_set64
(
timer
,
ticks
,
ticks
>>
32
);
}
static
inline
int
xtimer_msg_receive_timeout
(
msg_t
*
msg
,
uint32_t
timeout
)
static
inline
int
xtimer_msg_receive_timeout
(
msg_t
*
msg
,
uint32_t
timeout
)
{
{
return
_xtimer_msg_receive_timeout
(
msg
,
_xtimer_ticks_from_usec
(
timeout
));
return
_xtimer_msg_receive_timeout
(
msg
,
_xtimer_ticks_from_usec
(
timeout
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment