Esempio n. 1
0
void tmrHw_udelay(tmrHw_ID_t timerId,	/*  [ IN ] Timer id */
		  unsigned long usecs /*  [ IN ] usec to delay */
) {
	tmrHw_RATE_t usec_tick_rate;
	tmrHw_COUNT_t start_time;
	tmrHw_COUNT_t delta_time;

	start_time = tmrHw_GetCurrentCount(timerId);
	usec_tick_rate = tmrHw_divide(tmrHw_getCountRate(timerId), 1000000);
	delta_time = usecs * usec_tick_rate;

	/* Busy wait */
	while (delta_time > (tmrHw_GetCurrentCount(timerId) - start_time))
		;
}
Esempio n. 2
0
timer_tick_count_t timer_get_tick_count(void)
{
	return tmrHw_GetCurrentCount(PROF_TIMER);	/* change downcounter to upcounter */
}