Skip to content

Commit

Permalink
Issue_246: With LKP Player there is no pling on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
boerge1 committed Nov 14, 2024
1 parent 14cbd6d commit 2e20443
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion TonUINO-TNG.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 13 additions & 0 deletions src/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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_ */
10 changes: 10 additions & 0 deletions src/mp3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ void Mp3::init() {

setEq(static_cast<DfMp3_Eq>(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();
}

Expand Down
5 changes: 5 additions & 0 deletions test/libs/DFMiniMp3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t>(folder)];
Expand Down

0 comments on commit 2e20443

Please sign in to comment.