8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66d33f7 commit 3e66aefCopy full SHA for 3e66aef
cores/esp32/esp32-hal-misc.c
@@ -66,7 +66,7 @@ uint32_t cpuFrequencyGet(){
66
67
unsigned long IRAM_ATTR micros()
68
{
69
- return (unsigned long) (esp_timer_get_time() * (240 / _cpu_freq_mhz));
+ return (unsigned long) ((esp_timer_get_time() * 240) / _cpu_freq_mhz);
70
}
71
72
unsigned long IRAM_ATTR millis()
@@ -76,7 +76,7 @@ unsigned long IRAM_ATTR millis()
76
77
void delay(uint32_t ms)
78
79
- vTaskDelay(ms / portTICK_PERIOD_MS / (240 / _cpu_freq_mhz));
+ vTaskDelay((ms * _cpu_freq_mhz) / (portTICK_PERIOD_MS * 240));
80
81
82
void IRAM_ATTR delayMicroseconds(uint32_t us)
0 commit comments