Skip to content

Commit

Permalink
Migrate functions to ESP32 Core V3.0.0 standards
Browse files Browse the repository at this point in the history
  • Loading branch information
LaikaSpaceDawg committed Aug 17, 2024
1 parent 18ff8ad commit ecf5030
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/utility/Speaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ SPEAKER::SPEAKER(void) {

void SPEAKER::begin() {
_begun = true;
ledcSetup(TONE_PIN_CHANNEL, 0, 13);
ledcAttachPin(SPEAKER_PIN, TONE_PIN_CHANNEL);
ledcAttach(TONE_PIN_CHANNEL, 0, 13);
setBeep(4000, 100);
}

void SPEAKER::end() {
mute();
ledcDetachPin(SPEAKER_PIN);
ledcDetach(SPEAKER_PIN);
_begun = false;
}

Expand Down Expand Up @@ -75,6 +74,5 @@ void SPEAKER::playMusic(const uint8_t* music_data, uint16_t sample_rate) {
delay(2);
}
}
// ledcSetup(TONE_PIN_CHANNEL, 0, 13);
ledcAttachPin(SPEAKER_PIN, TONE_PIN_CHANNEL);
ledcAttach(TONE_PIN_CHANNEL, 0, 13);
}

0 comments on commit ecf5030

Please sign in to comment.