mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2025-01-06 08:53:36 +01:00
1697998a9c
Apparently there are some situations where the interrupt masks for TMU0 are set in the system. They should obviously be cleared.
19 lines
422 B
C
19 lines
422 B
C
//---
|
|
// gint:clock:sleep - Various low-level sleep functions
|
|
//---
|
|
|
|
#include <gint/clock.h>
|
|
#include <gint/timer.h>
|
|
|
|
/* sleep_us() - sleep for a definite duration in microseconds */
|
|
void sleep_us(int tid, int us_delay)
|
|
{
|
|
volatile int flag = 0;
|
|
uint32_t delay = timer_delay(tid, us_delay);
|
|
|
|
int free = timer_setup(tid, delay, 0, timer_timeout, &flag);
|
|
if(free < 0) return;
|
|
|
|
timer_start(tid);
|
|
while(!flag) sleep();
|
|
}
|