static unsigned at91st_get_timecount(struct timecounter *tc) { #ifdef SKYEYE_WORKAROUNDS return (tot_count); #else return (st_crtr()); #endif }
void DELAY(int n) { uint32_t start, end, cur; start = st_crtr(); n = (n * 1000) / 32768; if (n <= 0) n = 1; end = (start + n) & ST_CRTR_MASK; cur = start; if (start > end) { while (cur >= start || cur < end) cur = st_crtr(); } else { while (cur < end) cur = st_crtr(); } }
static unsigned at91st_get_timecount(struct timecounter *tc) { return (st_crtr()); }