File tree 3 files changed +12
-3
lines changed
3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -252,9 +252,6 @@ extern bool btInUse();
252
252
void initArduino () {
253
253
//init proper ref tick value for PLL (uncomment if REF_TICK is different than 1MHz)
254
254
//ESP_REG(APB_CTRL_PLL_TICK_CONF_REG) = APB_CLK_FREQ / REF_CLK_FREQ - 1;
255
- #ifdef F_CPU
256
- setCpuFrequencyMhz (F_CPU / 1000000 );
257
- #endif
258
255
#if CONFIG_SPIRAM_SUPPORT || CONFIG_SPIRAM
259
256
psramInit ();
260
257
#endif
Original file line number Diff line number Diff line change 1
1
#include " freertos/FreeRTOS.h"
2
2
#include " freertos/task.h"
3
3
#include " esp_task_wdt.h"
4
+ #include " soc/rtc.h"
4
5
#include " Arduino.h"
5
6
#if (ARDUINO_USB_CDC_ON_BOOT | ARDUINO_USB_MSC_ON_BOOT | ARDUINO_USB_DFU_ON_BOOT) && !ARDUINO_USB_MODE
6
7
#include " USB.h"
@@ -78,6 +79,15 @@ void loopTask(void *pvParameters) {
78
79
}
79
80
80
81
extern " C" void app_main () {
82
+ #ifdef F_XTAL_MHZ
83
+ #if !CONFIG_IDF_TARGET_ESP32S2 // ESP32-S2 does not support rtc_clk_xtal_freq_update
84
+ rtc_clk_xtal_freq_update ((rtc_xtal_freq_t )F_XTAL_MHZ);
85
+ rtc_clk_cpu_freq_set_xtal ();
86
+ #endif
87
+ #endif
88
+ #ifdef F_CPU
89
+ setCpuFrequencyMhz (F_CPU / 1000000 );
90
+ #endif
81
91
#if ARDUINO_USB_CDC_ON_BOOT && !ARDUINO_USB_MODE
82
92
Serial.begin ();
83
93
#endif
Original file line number Diff line number Diff line change 3
3
4
4
#include <stdint.h>
5
5
6
+ #define F_XTAL_MHZ 26 //SparkFun ESP32 Thing has 26MHz Crystal
7
+
6
8
static const uint8_t LED_BUILTIN = 5 ;
7
9
#define BUILTIN_LED LED_BUILTIN // backward compatibility
8
10
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
You can’t perform that action at this time.
0 commit comments