Update utils.c

This commit is contained in:
Oskar Weigl
2018-03-05 18:10:23 -08:00
committed by GitHub
parent 56c7557007
commit 8d27dd443f
+2 -2
View File
@@ -190,7 +190,7 @@ uint32_t micros(void) {
register uint32_t ms, cycle_cnt;
do {
ms = HAL_GetTick();
cycle_cnt = TIM_BASE_TIMER->CNT;
cycle_cnt = TIM_TIME_BASE->CNT;
} while (ms != HAL_GetTick());
return (ms * 1000) + cycle_cnt;
@@ -203,4 +203,4 @@ void delay_us(uint32_t us)
while (micros() - start < (uint32_t) us) {
__ASM("nop");
}
}
}