Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3e66aef

Browse filesBrowse files
committed
Handle better 160MHz cpu clock
1 parent 66d33f7 commit 3e66aef
Copy full SHA for 3e66aef

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎cores/esp32/esp32-hal-misc.c

Copy file name to clipboardExpand all lines: cores/esp32/esp32-hal-misc.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ uint32_t cpuFrequencyGet(){
6666

6767
unsigned long IRAM_ATTR micros()
6868
{
69-
return (unsigned long) (esp_timer_get_time() * (240 / _cpu_freq_mhz));
69+
return (unsigned long) ((esp_timer_get_time() * 240) / _cpu_freq_mhz);
7070
}
7171

7272
unsigned long IRAM_ATTR millis()
@@ -76,7 +76,7 @@ unsigned long IRAM_ATTR millis()
7676

7777
void delay(uint32_t ms)
7878
{
79-
vTaskDelay(ms / portTICK_PERIOD_MS / (240 / _cpu_freq_mhz));
79+
vTaskDelay((ms * _cpu_freq_mhz) / (portTICK_PERIOD_MS * 240));
8080
}
8181

8282
void IRAM_ATTR delayMicroseconds(uint32_t us)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.