Ejemplo n.º 1
0
u32_t _timer_cycle_get_32(void)
{
#ifdef CONFIG_TICKLESS_KERNEL
return (u32_t) get_elapsed_count();
#else
	u32_t acc, count;

	do {
		acc = accumulated_cycle_count;
		count = timer0_count_register_get();
	} while (acc != accumulated_cycle_count);

	return acc + count;
#endif
}
Ejemplo n.º 2
0
/**
 *
 * @brief Read the platform's timer hardware
 *
 * This routine returns the current time in terms of timer hardware clock
 * cycles.
 *
 * @return up counter of elapsed clock cycles
 *
 * \INTERNAL WARNING
 * systick counter is a 24-bit down counter which is reset to "reload" value
 * once it reaches 0.
 */
u32_t _timer_cycle_get_32(void)
{
#ifdef CONFIG_TICKLESS_KERNEL
return (u32_t) get_elapsed_count();
#else
	u32_t cac, count;

	do {
		cac = clock_accumulated_count;
		count = SysTick->LOAD - SysTick->VAL;
	} while (cac != clock_accumulated_count);

	return cac + count;
#endif
}
Ejemplo n.º 3
0
u64_t _get_elapsed_clock_time(void)
{
	return get_elapsed_count() / cycles_per_tick;
}
Ejemplo n.º 4
0
u64_t _get_elapsed_clock_time(void)
{
	return get_elapsed_count() / default_load_value;
}