Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit d584271

Browse files
author
Daniel Campora
committed
components: Expose the RTC source slection API.
1 parent 180e01d commit d584271

File tree

6 files changed

+6
-8
lines changed

6 files changed

+6
-8
lines changed

components/bootloader/src/main/bootloader_start.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,11 +713,9 @@ static void clock_configure(void)
713713
* part of the start up time by enabling 32k XTAL early.
714714
* App startup code will wait until the oscillator has started up.
715715
*/
716-
#ifdef CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL
717716
if (!rtc_clk_32k_enabled()) {
718717
rtc_clk_32k_bootstrap();
719718
}
720-
#endif
721719
}
722720

723721
static void uart_console_configure(void)

components/esp32/clk.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "soc/soc.h"
2222
#include "soc/rtc.h"
2323
#include "soc/rtc_cntl_reg.h"
24+
#include "esp_clk.h"
2425

2526
/* Number of cycles to wait from the 32k XTAL oscillator to consider it running.
2627
* Larger values increase startup delay. Smaller values may cause false positive
@@ -29,8 +30,6 @@
2930
#define XTAL_32K_DETECT_CYCLES 32
3031
#define SLOW_CLK_CAL_CYCLES CONFIG_ESP32_RTC_CLK_CAL_CYCLES
3132

32-
static void select_rtc_slow_clk(rtc_slow_freq_t slow_clk);
33-
3433
static const char* TAG = "clk";
3534
/*
3635
* This function is not exposed as an API at this point,
@@ -88,7 +87,7 @@ void IRAM_ATTR ets_update_cpu_frequency(uint32_t ticks_per_us)
8887
*/
8988
static uint32_t s_rtc_slow_clk_cal = 0;
9089

91-
static void select_rtc_slow_clk(rtc_slow_freq_t slow_clk)
90+
void select_rtc_slow_clk(rtc_slow_freq_t slow_clk)
9291
{
9392
if (slow_clk == RTC_SLOW_FREQ_32K_XTAL) {
9493
/* 32k XTAL oscillator needs to be enabled and running before it can

components/esp32/deep_sleep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
#include "esp_attr.h"
1818
#include "esp_deep_sleep.h"
1919
#include "esp_log.h"
20-
#include "esp_clk.h"
2120
#include "rom/cache.h"
2221
#include "rom/rtc.h"
2322
#include "rom/uart.h"
2423
#include "soc/cpu.h"
2524
#include "soc/rtc.h"
25+
#include "esp_clk.h"
2626
#include "soc/rtc_cntl_reg.h"
2727
#include "soc/rtc_io_reg.h"
2828
#include "soc/sens_reg.h"

components/esp32/include/esp_clk.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
*/
3232
void esp_clk_init(void);
3333

34+
void select_rtc_slow_clk(rtc_slow_freq_t slow_clk);
3435

3536
/**
3637
* @brief Get the cached calibration value of RTC slow clock

components/newlib/time.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
#include <rom/rtc.h>
2525
#include "esp_attr.h"
2626
#include "esp_intr_alloc.h"
27-
#include "esp_clk.h"
2827
#include "soc/soc.h"
2928
#include "soc/rtc.h"
29+
#include "esp_clk.h"
3030
#include "soc/rtc_cntl_reg.h"
3131
#include "soc/frc_timer_reg.h"
3232
#include "rom/ets_sys.h"

components/ulp/ulp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
#include "esp_attr.h"
2020
#include "esp_err.h"
2121
#include "esp_log.h"
22-
#include "esp_clk.h"
2322
#include "esp32/ulp.h"
2423

2524
#include "soc/soc.h"
2625
#include "soc/rtc.h"
26+
#include "esp_clk.h"
2727
#include "soc/rtc_cntl_reg.h"
2828
#include "soc/sens_reg.h"
2929

0 commit comments

Comments
 (0)