Skip to content

Commit 2f71c18

Browse files
committed
v0.9.242
1 parent 942bc1c commit 2f71c18

File tree

5 files changed

+21
-9
lines changed

5 files changed

+21
-9
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ Work is in progress...
226226

227227
---
228228
## Version history
229+
#### v0.9.242
230+
- fixed a hang bug when scrolling through an SD playlist with an encoder in configurations with VS1053B
231+
- fixed a hang bug when quickly switching SD / WEB modes from the WEB interface in configurations with VS1053B
232+
- fixes in the logic of work
233+
229234
#### v0.9.236
230235
- fix compilation error 'class NetServer' has no member named 'resetQueue'
231236

yoRadio/src/audioVS1053/audioVS1053Ex.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,9 @@ void Audio::stopSong()
425425
{
426426
uint16_t modereg; // Read from mode register
427427
int i; // Loop control
428-
428+
if(audiofile){
429+
cardLock(true);audiofile.close();cardLock(false);
430+
}
429431
m_f_localfile = false;
430432
m_f_webfile = false;
431433
m_f_webstream = false;

yoRadio/src/core/config.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ void Config::init() {
6464
ssidsCount = 0;
6565
_cardStatus = CS_NONE;
6666
_SDplaylistFS = getMode()==PM_SDCARD?&SD:(true?&SPIFFS:_SDplaylistFS);
67-
if(SDC_CS!=255) randomSeed(analogRead(SDC_CS));
67+
//if(SDC_CS!=255) randomSeed(analogRead(SDC_CS));
68+
randomSeed(esp_random());
6869
backupSDStation = 0;
6970
//checkSD();
7071
_bootDone=false;
@@ -162,6 +163,7 @@ void Config::changeMode(int newmode){
162163
delay(10);
163164
delay(50);
164165
}
166+
if(getMode()==PM_WEB) player.setResumeFilePos(0);
165167
initPlaylistMode();
166168
if (store.smartstart == 1) player.sendCommand({PR_PLAY, store.lastStation});
167169
//else
@@ -661,23 +663,25 @@ uint8_t Config::fillPlMenu(int from, uint8_t count, bool fromNextion) {
661663
playlist.seek(pos, SeekSet);
662664
sdog.giveMutex();
663665
}
664-
while (playlist.available()) {
666+
bool pla = true;
667+
while (pla) {
665668
sdog.takeMutex();
669+
pla = playlist.available();
666670
String stationName = playlist.readStringUntil('\n');
667671
sdog.giveMutex();
668672
stationName = stationName.substring(0, stationName.indexOf('\t'));
669-
if(config.store.numplaylist) stationName = String(from+c)+" "+stationName;
673+
if(config.store.numplaylist && stationName.length()>0) stationName = String(from+c)+" "+stationName;
670674
if(!fromNextion) display.printPLitem(c, stationName.c_str());
671-
#ifdef USE_NEXTION
672-
if(fromNextion) nextion.printPLitem(c, stationName.c_str());
673-
#endif
675+
#ifdef USE_NEXTION
676+
if(fromNextion) nextion.printPLitem(c, stationName.c_str());
677+
#endif
674678
c++;
675679
if (c >= count) break;
676680
}
677681
break;
678682
}
679-
return c;
680683
sdog.takeMutex();playlist.close();sdog.giveMutex();
684+
return c;
681685
}
682686

683687
bool Config::parseCSV(const char* line, char* name, char* url, int &ovol) {

yoRadio/src/core/options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef options_h
22
#define options_h
33

4-
#define YOVERSION "0.9.236"
4+
#define YOVERSION "0.9.242"
55

66
/*******************************************************
77
DO NOT EDIT THIS FILE.

yoRadio/src/core/player.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ QueueHandle_t playerQueue;
3636
void Player::init() {
3737
Serial.print("##[BOOT]#\tplayer.init\t");
3838
playerQueue=NULL;
39+
_resumeFilePos = 0;
3940
playerQueue = xQueueCreate( 5, sizeof( playerRequestParams_t ) );
4041
setOutputPins(false);
4142
delay(50);

0 commit comments

Comments
 (0)