Browse Source
Merge pull request #83 from fdlamotte/configure-cpu-frequency-at-build-time-for-esp32
Add an ESP32_CPU_FREQ build flag to lower freq
pull/94/head
ripplebiz
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
6 additions and
0 deletions
-
platformio.ini
-
src/helpers/ESP32Board.h
|
|
|
@ -31,6 +31,8 @@ extends = arduino_base |
|
|
|
platform = espressif32 |
|
|
|
monitor_filters = esp32_exception_decoder |
|
|
|
extra_scripts = merge-bin.py |
|
|
|
build_flags = ${arduino_base.build_flags} |
|
|
|
; -D ESP32_CPU_FREQ=80 ; change it to your need |
|
|
|
build_src_filter = ${arduino_base.build_src_filter} |
|
|
|
|
|
|
|
; ================ |
|
|
|
|
|
|
|
@ -17,6 +17,10 @@ public: |
|
|
|
// for future use, sub-classes SHOULD call this from their begin()
|
|
|
|
startup_reason = BD_STARTUP_NORMAL; |
|
|
|
|
|
|
|
#ifdef ESP32_CPU_FREQ |
|
|
|
setCpuFrequencyMhz(ESP32_CPU_FREQ); |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef PIN_VBAT_READ |
|
|
|
// battery read support
|
|
|
|
pinMode(PIN_VBAT_READ, INPUT); |
|
|
|
|