mirror of
https://github.com/espressif/esp-idf
synced 2025-03-27 18:00:09 -04:00
esp32: ets_update_cpu_frequency should set tick scale for both CPUs ets_update_cpu_frequency ROM function updates g_ticks_per_us, which is has two copies, one for each CPU. The APP CPU copy of g_ticks_per_us never got updated, resulting in shorter delays produced by ets_delay_us on the APP CPU. This MR replaces ROM ets_update_cpu_frequency with a copy in IRAM which updates scaling factors on both of the CPUs. So now we get expected delays (in microseconds): ``` ets_delay_us core=0 expected=50000 actual=50014 ets_delay_us core=1 expected=50000 actual=50015 vTaskDelay core=0 expected=50000 actual=49428 vTaskDelay core=1 expected=50000 actual=50000 ``` Reported on the forum: http://esp32.com/viewtopic.php?f=2&t=713#p3722 See merge request !373