timer-wrs.c 387 Bytes
Newer Older
1 2 3 4 5
/*
 * This work is part of the White Rabbit project
 *
 * Released according to the GNU GPL, version 2 or any later version.
 */
6 7 8 9
#include "board.h"

#include "syscon.h"

10
uint32_t timer_get_tics(void)
11 12 13 14
{
  return *(volatile uint32_t *) (BASE_TIMER);
}

15
void timer_delay(uint32_t tics)
16
{
17
	uint32_t t_end = timer_get_tics() + tics;
18

19 20
	while (time_before(timer_get_tics(), t_end))
	       ;
21
}