Fixed timebase error in Adruino lib

Now using millis() instead of micros() for correct delay inervals
This commit is contained in:
Andrey Perminov 2021-06-23 09:08:18 -07:00
parent c42e4a4270
commit 0645e007fa

View File

@ -287,15 +287,15 @@ void hal_timebase_busy_wait(uint32_t delay)
/* Ensure minimum delay or skip if delay is zero*/ /* Ensure minimum delay or skip if delay is zero*/
if (delay) { if (delay) {
delay_internal = delay + 1; delay_internal = delay + 1;
start = micros(); start = millis();
while ((micros() - start) < delay_internal) { while ((millis() - start) < delay_internal) {
} }
} }
} }
hal_tick_t hal_timebase_get_tick(void) hal_tick_t hal_timebase_get_tick(void)
{ {
return micros(); return millis();
} }
static void check_buttons() static void check_buttons()