From 2e204434a2d3487fac3552cf43f0a4a51d4aff89 Mon Sep 17 00:00:00 2001 From: boerge1 Date: Thu, 14 Nov 2024 13:53:57 +0100 Subject: [PATCH] Issue_246: With LKP Player there is no pling on startup --- README.md | 3 +++ TonUINO-TNG.ino | 2 +- src/logger.hpp | 13 +++++++++++++ src/mp3.cpp | 10 ++++++++++ test/libs/DFMiniMp3.h | 5 +++++ 5 files changed, 32 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 616dc0e..8a90474 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,9 @@ Die SD Karte (Ordner mp3 und advert) hat sich gegenüber der Version 3.1.11 geä # Change Log +## Version 3.2.1 (14.11.2024) +- [Issue 246](https://github.com/tonuino/TonUINO-TNG/issues/246): With LKP Player there is no pling on startup + ## Version 3.2.1 (13.10.2024) - [Issue 238](https://github.com/tonuino/TonUINO-TNG/issues/238): Pololu sometimes does not switch off in sleep mode - [Issue 240](https://github.com/tonuino/TonUINO-TNG/issues/240): Some code restructuring diff --git a/TonUINO-TNG.ino b/TonUINO-TNG.ino index d9f01cc..9898478 100644 --- a/TonUINO-TNG.ino +++ b/TonUINO-TNG.ino @@ -35,7 +35,7 @@ void setup() LOG(init_log, s_error, F("TonUINO Version 3.1 - refactored by Boerge1\n")); LOG(init_log, s_error, F("created by Thorsten Voß and licensed under GNU/GPL.")); LOG(init_log, s_error, F("Information and contribution at https://tonuino.de.\n")); - LOG(init_log, s_error, F("V3.2.1 13.10.24\n")); + LOG(init_log, s_error, F("V3.2.1 14.11.24\n")); #ifdef TonUINO_Classic LOG(init_log, s_error, F("C "), lf_no); diff --git a/src/logger.hpp b/src/logger.hpp index 48c2002..fa95584 100644 --- a/src/logger.hpp +++ b/src/logger.hpp @@ -5,6 +5,7 @@ DEFINE_LOGGER(tonuino_log , s_debug , void); +#ifndef ALLinONE DEFINE_LOGGER(init_log , s_info , tonuino_log); DEFINE_LOGGER(card_log , s_info , tonuino_log); DEFINE_LOGGER(play_log , s_info , tonuino_log); @@ -15,5 +16,17 @@ DEFINE_LOGGER(modifier_log, s_info , tonuino_log); DEFINE_LOGGER(mp3_log , s_info , tonuino_log); DEFINE_LOGGER(settings_log, s_info , tonuino_log); DEFINE_LOGGER(batvol_log , s_info , tonuino_log); +#else +DEFINE_LOGGER(init_log , s_info , tonuino_log); +DEFINE_LOGGER(card_log , s_info , tonuino_log); +DEFINE_LOGGER(play_log , s_warning, tonuino_log); +DEFINE_LOGGER(standby_log , s_info , tonuino_log); +DEFINE_LOGGER(state_log , s_info , tonuino_log); +DEFINE_LOGGER(button_log , s_info , tonuino_log); +DEFINE_LOGGER(modifier_log, s_info , tonuino_log); +DEFINE_LOGGER(mp3_log , s_info , tonuino_log); +DEFINE_LOGGER(settings_log, s_info , tonuino_log); +DEFINE_LOGGER(batvol_log , s_info , tonuino_log); +#endif #endif /* SRC_LOGGER_HPP_ */ diff --git a/src/mp3.cpp b/src/mp3.cpp index 594dcac..d02ddaf 100644 --- a/src/mp3.cpp +++ b/src/mp3.cpp @@ -76,6 +76,16 @@ void Mp3::init() { setEq(static_cast(settings.eq - 1)); + startTrackTimer.start(6000); // 6 seconds + while (not startTrackTimer.isExpired() && (getTotalTrackCount() == 0)) { + delay(100); + loop(); + } + startTrackTimer.stop(); + + LOG(mp3_log, s_info, F("track_count: "), getTotalTrackCount()); + delay(1000); + loop(); } diff --git a/test/libs/DFMiniMp3.h b/test/libs/DFMiniMp3.h index b82028e..c413420 100644 --- a/test/libs/DFMiniMp3.h +++ b/test/libs/DFMiniMp3.h @@ -236,6 +236,11 @@ class DFMiniMp3 called_stop = true; } + uint16_t getTotalTrackCount() + { + return 1; + } + uint16_t getFolderTrackCount(uint16_t folder) { return df_folder_track_count[static_cast(folder)];