check if task has been already created while calling start()

This commit is contained in:
Mischa Siekmann 2024-05-13 12:21:55 +02:00
parent 3b5ef399e0
commit 116ea49549
1 changed files with 4 additions and 1 deletions

View File

@ -23,7 +23,10 @@ void I2SAudioSpeaker::setup() {
}
void I2SAudioSpeaker::start() {
this->task_created_ = false;
if (this->task_created_) {
ESP_LOGD(TAG, "Called start while task has been already created.");
return;
}
this->state_ = speaker::STATE_STARTING;
}
void I2SAudioSpeaker::start_() {