From a55265f74bd007eb7d38f7aeb90c9a7a33d04656 Mon Sep 17 00:00:00 2001 From: TANAKA Masayuki Date: Wed, 30 Sep 2020 21:16:20 +0900 Subject: [PATCH] Fix clockCyclesPerMicrosecond Change from fixed value to current value (#3993) --- cores/esp32/Arduino.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp32/Arduino.h b/cores/esp32/Arduino.h index 645b4070..bc028e11 100644 --- a/cores/esp32/Arduino.h +++ b/cores/esp32/Arduino.h @@ -78,7 +78,7 @@ #define interrupts() sei() #define noInterrupts() cli() -#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L ) +#define clockCyclesPerMicrosecond() ( (long int)getCpuFrequencyMhz() ) #define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() ) #define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )