Handle better 160MHz cpu clock
This commit is contained in:
parent
66d33f792c
commit
3e66aeff84
@ -66,7 +66,7 @@ uint32_t cpuFrequencyGet(){
|
||||
|
||||
unsigned long IRAM_ATTR micros()
|
||||
{
|
||||
return (unsigned long) (esp_timer_get_time() * (240 / _cpu_freq_mhz));
|
||||
return (unsigned long) ((esp_timer_get_time() * 240) / _cpu_freq_mhz);
|
||||
}
|
||||
|
||||
unsigned long IRAM_ATTR millis()
|
||||
@ -76,7 +76,7 @@ unsigned long IRAM_ATTR millis()
|
||||
|
||||
void delay(uint32_t ms)
|
||||
{
|
||||
vTaskDelay(ms / portTICK_PERIOD_MS / (240 / _cpu_freq_mhz));
|
||||
vTaskDelay((ms * _cpu_freq_mhz) / (portTICK_PERIOD_MS * 240));
|
||||
}
|
||||
|
||||
void IRAM_ATTR delayMicroseconds(uint32_t us)
|
||||
|
Loading…
Reference in New Issue
Block a user