Skip to content

Commit

Permalink
Merge pull request #112: Issue_111: TonUINO crashes if if the player …
Browse files Browse the repository at this point in the history
…gives a track count >255
  • Loading branch information
boerge1 authored Sep 19, 2023
2 parents 37c9a88 + b802241 commit 4bcf964
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ Die SD Karte (Ordner mp3 und advert) hat sich gegenüber der Version 3.1.2 geän

# Change Log

## Version 3.1.4 (19.09.2023)
- [Issue 111](https://github.com/tonuino/TonUINO-TNG/issues/111): TonUINO crashes if if the player gives a track count >255

## Version 3.1.4 (17.09.2023)
- [Issue 108](https://github.com/tonuino/TonUINO-TNG/issues/108): Missing OnPlayFinished: the progress is not saved for Hoerbuch mode

## Version 3.1.4 (14.09.2023)
- [Issue 106](https://github.com/tonuino/TonUINO-TNG/issues/106): Support LISP3 DF Player
- [Issue 100](https://github.com/tonuino/TonUINO-TNG/issues/100): Support Nano Every with classic HW
- [Issue 104](https://github.com/tonuino/TonUINO-TNG/issues/104): Use bad framework-lgt8fx
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.1.4 17.09.23\n"));
LOG(init_log, s_error, F("V3.1.4 19.09.23\n"));

Tonuino::getTonuino().setup();
}
Expand Down
2 changes: 2 additions & 0 deletions src/mp3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ void Mp3::enqueueTrack(uint8_t folder, uint8_t firstTrack, uint8_t lastTrack, ui
for (uint8_t i = firstTrack; i<=lastTrack; ++i) {
LOG(mp3_log, s_info, i, str_Space(), lf_no);
q.push(i);
if (i == 0xffu)
break;
}
LOG(mp3_log, s_info, str_Space());
current_track = currentTrack;
Expand Down
15 changes: 15 additions & 0 deletions test/src/mp3_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,21 @@ TEST_F(mp3_test_fixture, enqueue_folder_tracks) {
EXPECT_TRUE(mp3.is_stopped());
}

TEST_F(mp3_test_fixture, enqueue_folder_tracks_no_chrash) {
mp3.enqueueTrack(1, 2, 255);
execute_cycle();

for (uint16_t t = 2; t <= 255; ++t) {
EXPECT_TRUE(mp3.is_playing_folder());
EXPECT_EQ(mp3.df_folder, 1);
EXPECT_EQ(mp3.df_folder_track, t);
mp3.end_track();
execute_cycle();
execute_cycle();
}
EXPECT_TRUE(mp3.is_stopped());
}

TEST_F(mp3_test_fixture, enqueue_folder_tracks_with_current) {
mp3.enqueueTrack(1, 2, 12, 3);
execute_cycle();
Expand Down

0 comments on commit 4bcf964

Please sign in to comment.