mirror of
https://github.com/espressif/esp-idf.git
synced 2024-09-20 20:56:01 -04:00
5b54ae76d4
When ESP32-C2 is paired with a 26 MHz XTAL, the systimer tick frequency becomes equal to 26 / 2.5 = 10.4 MHz. Previously we always assumed that systimer tick frequency is integer (and 1 MHz * power of two, above that!). This commit introduces a new LL macro, SYSTIMER_LL_TICKS_PER_US_DIV. It should be set in such a way that: 1. SYSTIMER_LL_TICKS_PER_US / SYSTIMER_LL_TICKS_PER_US_DIV equals the actual systimer tick frequency, 2. and SYSTIMER_LL_TICKS_PER_US is integer. For ESP32-C2 this means that SYSTIMER_LL_TICKS_PER_US = 52 and SYSTIMER_LL_TICKS_PER_US_DIV = 5. This introduced two possible issues: 1. Overflow when multiplying systimer counter by 5 - Should not be an issue, since systimer counter is 52-bit, so counter * 5 is no more than 55-bit. 2. The code needs to perform: - divide by 5: when converting from microseconds to ticks - divide by 52: when converting from ticks to microseconds The latter potentially introduces a performance issue for the esp_timer_get_time function. |
||
---|---|---|
.. | ||
include/soc | ||
ld | ||
adc_periph.c | ||
CMakeLists.txt | ||
dedic_gpio_periph.c | ||
gdma_periph.c | ||
gpio_periph.c | ||
i2c_periph.c | ||
i2s_periph.c | ||
interrupts.c | ||
lcd_periph.c | ||
ledc_periph.c | ||
mcpwm_periph.c | ||
pcnt_periph.c | ||
rmt_periph.c | ||
rtc_io_periph.c | ||
sdio_slave_periph.c | ||
sdmmc_periph.c | ||
sigmadelta_periph.c | ||
spi_periph.c | ||
temperature_sensor_periph.c | ||
timer_periph.c | ||
touch_sensor_periph.c | ||
uart_periph.c | ||
usb_periph.c | ||
usb_periph.h | ||
usb_phy_periph.c |