]> granicus.if.org Git - esp-idf/commit
soc: implement XTAL frequency detection
authorIvan Grokhotkov <ivan@espressif.com>
Mon, 24 Apr 2017 07:29:30 +0000 (15:29 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Mon, 24 Apr 2017 07:29:30 +0000 (15:29 +0800)
commit3323f31cfb1f7e92e13347c22c0a4b35f4a49b6b
tree718db62b2484ef7d8aa54db87ea7641e83352590
parent36ed7f507eacac364b46be7d6cb3db559af8d9f5
soc: implement XTAL frequency detection

ROM code already implements XTAL frequency detection, but it uses the 8M
clock before the clock tuning parameters are initialized. With the
zero clock tuning parameter, 8M clock has significant frequency deviation
at high temperatures, which can lead to erroneous detection of 40 MHz
crystal as a 26 MHz one.

This change adds XTAL frequency detection code to rtc_clk_init routine,
and detection is performed after the 8M clock tuning parameter as been
initialized.
components/soc/esp32/include/soc/rtc.h
components/soc/esp32/include/soc/rtc_io_reg.h
components/soc/esp32/rtc_clk.c
components/soc/esp32/rtc_time.c
components/soc/esp32/test/test_rtc_clk.c