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
f770d17e
Commit
f770d17e
authored
6 years ago
by
josar
Browse files
Options
Downloads
Patches
Plain Diff
xtimer_core: uncrustify
parent
b518f3c7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sys/xtimer/xtimer_core.c
+16
-12
16 additions, 12 deletions
sys/xtimer/xtimer_core.c
with
16 additions
and
12 deletions
sys/xtimer/xtimer_core.c
+
16
−
12
View file @
f770d17e
...
...
@@ -61,12 +61,13 @@ static inline int _is_set(xtimer_t *timer)
return
(
timer
->
target
||
timer
->
long_target
);
}
static
inline
void
xtimer_spin_until
(
uint32_t
target
)
{
static
inline
void
xtimer_spin_until
(
uint32_t
target
)
{
#if XTIMER_MASK
target
=
_xtimer_lltimer_mask
(
target
);
#endif
while
(
_xtimer_lltimer_now
()
>
target
)
;
while
(
_xtimer_lltimer_now
()
<
target
)
;
while
(
_xtimer_lltimer_now
()
>
target
)
{}
while
(
_xtimer_lltimer_now
()
<
target
)
{}
}
void
xtimer_init
(
void
)
...
...
@@ -88,7 +89,7 @@ static void _xtimer_now_internal(uint32_t *short_term, uint32_t *long_term)
long_value
=
_long_cnt
;
after
=
_xtimer_now
();
}
while
(
before
>
after
);
}
while
(
before
>
after
);
*
short_term
=
after
;
*
long_term
=
long_value
;
...
...
@@ -97,9 +98,10 @@ static void _xtimer_now_internal(uint32_t *short_term, uint32_t *long_term)
uint64_t
_xtimer_now64
(
void
)
{
uint32_t
short_term
,
long_term
;
_xtimer_now_internal
(
&
short_term
,
&
long_term
);
return
((
uint64_t
)
long_term
<<
32
)
+
short_term
;
return
((
uint64_t
)
long_term
<<
32
)
+
short_term
;
}
void
_xtimer_set64
(
xtimer_t
*
timer
,
uint32_t
offset
,
uint32_t
long_offset
)
...
...
@@ -107,7 +109,7 @@ void _xtimer_set64(xtimer_t *timer, uint32_t offset, uint32_t long_offset)
DEBUG
(
" _xtimer_set64() offset=%"
PRIu32
" long_offset=%"
PRIu32
"
\n
"
,
offset
,
long_offset
);
if
(
!
long_offset
)
{
/* timer fits into the short timer */
_xtimer_set
(
timer
,
(
uint32_t
)
offset
);
_xtimer_set
(
timer
,
(
uint32_t
)
offset
);
}
else
{
int
state
=
irq_disable
();
...
...
@@ -125,7 +127,7 @@ void _xtimer_set64(xtimer_t *timer, uint32_t offset, uint32_t long_offset)
_add_timer_to_long_list
(
&
long_list_head
,
timer
);
irq_restore
(
state
);
DEBUG
(
"xtimer_set64(): added longterm timer (long_target=%"
PRIu32
" target=%"
PRIu32
")
\n
"
,
timer
->
long_target
,
timer
->
target
);
timer
->
long_target
,
timer
->
target
);
}
}
...
...
@@ -197,7 +199,7 @@ int _xtimer_set_absolute(xtimer_t *timer, uint32_t target)
timer
->
long_target
++
;
}
if
(
(
timer
->
long_target
>
_long_cnt
)
||
!
_this_high_period
(
target
)
)
{
if
((
timer
->
long_target
>
_long_cnt
)
||
!
_this_high_period
(
target
))
{
DEBUG
(
"xtimer_set_absolute(): the timer doesn't fit into the low-level timer's mask.
\n
"
);
_add_timer_to_long_list
(
&
long_list_head
,
timer
);
}
...
...
@@ -235,8 +237,8 @@ static void _add_timer_to_list(xtimer_t **list_head, xtimer_t *timer)
static
void
_add_timer_to_long_list
(
xtimer_t
**
list_head
,
xtimer_t
*
timer
)
{
while
(
*
list_head
&&
(((
*
list_head
)
->
long_target
<
timer
->
long_target
)
||
(((
*
list_head
)
->
long_target
==
timer
->
long_target
)
&&
((
*
list_head
)
->
target
<=
timer
->
target
))))
{
&&
(((
*
list_head
)
->
long_target
<
timer
->
long_target
)
||
(((
*
list_head
)
->
long_target
==
timer
->
long_target
)
&&
((
*
list_head
)
->
target
<=
timer
->
target
))))
{
list_head
=
&
((
*
list_head
)
->
next
);
}
...
...
@@ -283,6 +285,7 @@ static void _remove(xtimer_t *timer)
void
xtimer_remove
(
xtimer_t
*
timer
)
{
int
state
=
irq_disable
();
if
(
_is_set
(
timer
))
{
_remove
(
timer
);
}
...
...
@@ -305,7 +308,8 @@ static uint32_t _time_left(uint32_t target, uint32_t reference)
}
}
static
inline
int
_this_high_period
(
uint32_t
target
)
{
static
inline
int
_this_high_period
(
uint32_t
target
)
{
#if XTIMER_MASK
return
(
target
&
XTIMER_MASK
)
==
_xtimer_high_cnt
;
#else
...
...
@@ -338,7 +342,7 @@ static xtimer_t *_merge_lists(xtimer_t *head_a, xtimer_t *head_b)
xtimer_t
*
result_head
=
_compare
(
head_a
,
head_b
);
xtimer_t
*
pos
=
result_head
;
while
(
1
)
{
while
(
1
)
{
head_a
=
head_a
->
next
;
head_b
=
head_b
->
next
;
if
(
!
head_a
)
{
...
...
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