diff --git a/src/main.cpp b/src/main.cpp index 0e2308f..856db1c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,6 +13,7 @@ long lastDebounceTime = 0; void setup() { + setCpuFrequencyMhz(240); // Setup GPIO pinMode(LED, OUTPUT); digitalWrite(LED, LOW); @@ -39,6 +40,7 @@ void setup() // Setup is done, light up the LED Serial.println("All setup & ready to go!"); + setCpuFrequencyMhz(80); digitalWrite(LED, HIGH); } @@ -53,3 +55,15 @@ void loop() } audio.loop(); } + +void audio_info(const char *info){ + String s_info = info; + s_info.toLowerCase(); + s_info.trim(); + if (s_info == "closing audio file") { + setCpuFrequencyMhz(80); + } + else if (s_info == "stream ready") { + setCpuFrequencyMhz(240); + } +}