Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
xtimer: Move xtimer_spin_until into xtimer_core.c
  • Loading branch information
Joakim Nohlgård committed Jul 6, 2016
1 parent e4e1814 commit da8cd11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 0 additions & 8 deletions sys/include/xtimer/implementation.h
Expand Up @@ -106,14 +106,6 @@ static inline uint32_t xtimer_now(void)
#endif
}

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);
}

static inline void xtimer_spin(uint32_t offset) {
uint32_t start = _xtimer_lltimer_now();
#if XTIMER_MASK
Expand Down
10 changes: 10 additions & 0 deletions sys/xtimer/xtimer_core.c
Expand Up @@ -35,6 +35,8 @@ static volatile uint32_t _long_cnt = 0;
volatile uint32_t _xtimer_high_cnt = 0;
#endif

static inline void xtimer_spin_until(uint32_t value);

static xtimer_t *timer_list_head = NULL;
static xtimer_t *overflow_list_head = NULL;
static xtimer_t *long_list_head = NULL;
Expand All @@ -56,6 +58,14 @@ static inline int _is_set(xtimer_t *timer)
return (timer->target || timer->long_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);
}

void xtimer_init(void)
{
/* initialize low-level timer */
Expand Down

0 comments on commit da8cd11

Please sign in to comment.