From 66ebcc8628d7bf2c3704fcb54110096fae05838e Mon Sep 17 00:00:00 2001 From: 2ijies11 <94870386+2ijies11@users.noreply.github.com> Date: Thu, 24 Aug 2023 18:01:53 +0000 Subject: [PATCH] Fix micros() underestimation for 12MHz --- cores/arduino/wiring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/arduino/wiring.c b/cores/arduino/wiring.c index 8caf45521..92a8702fd 100644 --- a/cores/arduino/wiring.c +++ b/cores/arduino/wiring.c @@ -100,7 +100,7 @@ unsigned long micros() { SREG = oldSREG; - return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); + return clockCyclesToMicroseconds(((m << 8) + t) * 64); } void delay(unsigned long ms)