Skip to content

Commit 7715962

Browse files
authored
Merge pull request #62 from KurtE/arduino
Fix micros() for nano without breaking giga
2 parents eabeb63 + 308567f commit 7715962

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: cores/arduino/zephyrCommon.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,12 @@ void delay(unsigned long ms) { k_sleep(K_MSEC(ms)); }
293293
void delayMicroseconds(unsigned int us) { k_sleep(K_USEC(us)); }
294294

295295
unsigned long micros(void) {
296+
#ifdef CONFIG_TIMER_HAS_64BIT_CYCLE_COUNTER
296297
return k_cyc_to_us_floor32(k_cycle_get_64());
297-
}
298+
#else
299+
return k_cyc_to_us_floor32(k_cycle_get_32());
300+
#endif
301+
}
298302

299303
unsigned long millis(void) { return k_uptime_get_32(); }
300304

0 commit comments

Comments
 (0)