From ab46af152f8fa89ee0c30c6d469b73c7ed0e07a9 Mon Sep 17 00:00:00 2001 From: Torsten Stauder Date: Tue, 29 Jun 2021 21:18:37 +0200 Subject: [PATCH] Fixing Bluetooth-mode --- src/AudioPlayer.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/AudioPlayer.cpp b/src/AudioPlayer.cpp index 7f204d7..8d18dc8 100644 --- a/src/AudioPlayer.cpp +++ b/src/AudioPlayer.cpp @@ -98,15 +98,17 @@ void AudioPlayer_Init(void) { // Adjust volume depending on headphone is connected and volume-adjustment is enabled AudioPlayer_SetupVolume(); - xTaskCreatePinnedToCore( - AudioPlayer_Task, /* Function to implement the task */ - "mp3play", /* Name of the task */ - 4000, /* Stack size in words */ - NULL, /* Task input parameter */ - 2 | portPRIVILEGE_BIT, /* Priority of the task */ - NULL, /* Task handle. */ - 1 /* Core where the task should run */ - ); + if (System_GetOperationMode() == OPMODE_NORMAL) { // Don't start audio-task in BT-mode! + xTaskCreatePinnedToCore( + AudioPlayer_Task, /* Function to implement the task */ + "mp3play", /* Name of the task */ + 4000, /* Stack size in words */ + NULL, /* Task input parameter */ + 2 | portPRIVILEGE_BIT, /* Priority of the task */ + NULL, /* Task handle. */ + 1 /* Core where the task should run */ + ); + } } void AudioPlayer_Cyclic(void) {