1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-09-19 21:43:29 +01:00
Atmosphere/exosphere/timers.c

18 lines
382 B
C
Raw Normal View History

2018-02-18 02:50:39 +00:00
#include "timers.h"
volatile void *g_timer_registers = NULL;
void set_timer_address(void *timer_base) {
g_timer_registers = timer_base;
}
inline void *get_timer_address(void) {
return g_timer_registers;
}
void wait(uint32_t microseconds) {
uint32_t old_time = TIMERUS_CNTR_1US_0;
while (TIMERUS_CNTR_1US_0 - old_time <= result) {
/* Spin-lock. */
}
}