コード例 #1
0
ファイル: sensor_bus_common.c プロジェクト: RCintel/main
void sensor_delay_ms(uint32_t msecs)
{
	if (msecs >= CONVERT_TICKS_TO_MS(1)) {
		T_SEMAPHORE sem = semaphore_create(0);
		semaphore_take(sem, (int)msecs + 1); /* details in FIRE-5618 */
		semaphore_delete(sem);
	} else {
		wait_ticks(msecs * AON_CNT_TICK_PER_MS);
	}
}
コード例 #2
0
ファイル: sensor_bus_common.c プロジェクト: CurieBSP/main
void sensor_delay_ms(uint32_t msecs)
{
	if (msecs >= CONVERT_TICKS_TO_MS(1)) {
		T_SEMAPHORE sem = semaphore_create(0);
/* Ensure that we will wait at least 'msecs' millisecond as if semaphore_take is called
 * right before the timer tick interrupt it will be released immediately */
		semaphore_take(sem, (int)msecs + 1);
		semaphore_delete(sem);
	} else {
		wait_ticks(msecs * AON_CNT_TICK_PER_MS);
	}
}
コード例 #3
0
ファイル: timer.c プロジェクト: CurieBSP/main
/**
 * Return the current tick converted in milliseconds.
 *
 * Authorized execution levels:  task, fiber
 *
 * @warning: the return value is false in interrupt context.
 *
 * @return current tick converted in milliseconds
 */
uint32_t get_time_ms(void)
{
	return (uint32_t)CONVERT_TICKS_TO_MS(sys_tick_get_32());
}
コード例 #4
0
ファイル: timer.c プロジェクト: 01org/CODK-A-Firmware
/**
 * Return the current tick converted in milliseconds.
 *
 * Authorized execution levels:  task, fiber, ISR
 *
 * @return current tick converted in milliseconds
 */
uint32_t get_time_ms(void)
{
    return ( (uint32_t) CONVERT_TICKS_TO_MS(_GET_TICK()));
}