From b2a4eb8707d428bd5485c2dfc1195e6537aa1616 Mon Sep 17 00:00:00 2001 From: e2002 Date: Wed, 7 Jun 2023 14:48:39 +0300 Subject: [PATCH] v0.9.259 --- README.md | 4 ++++ examples/myoptions.h | 11 ++++++++++- yoRadio/src/core/display.cpp | 8 ++++++-- yoRadio/src/core/netserver.cpp | 7 +++++-- yoRadio/src/core/options.h | 2 +- yoRadio/src/core/player.cpp | 6 +++++- yoRadio/src/core/player.h | 5 +++++ 7 files changed, 36 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ce6ede1..692cc1d 100644 --- a/README.md +++ b/README.md @@ -229,6 +229,10 @@ Work is in progress... --- ## Version history +#### v0.9.259 +- fixed a hang bug when switching to SD mode after removing the SD +- fixed a hangup error when the connection to the stream was lost in WEB mode + #### v0.9.250 - added support for DS1307 or DS3231 RTC module (you need to install the RTCLib library in the library manager) - setup diff --git a/examples/myoptions.h b/examples/myoptions.h index ca85487..79e508b 100644 --- a/examples/myoptions.h +++ b/examples/myoptions.h @@ -77,7 +77,16 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti /* SD VSPI PINS. SD SCK must be connected to pin 18 SD MISO must be connected to pin 19 SD MOSI must be connected to pin 23 */ -//#define SDC_CS 255 /* SDCARD CS pin */ +/* SD HSPI PINS. SD SCK must be connected to pin 14 + SD MISO must be connected to pin 12 + SD MOSI must be connected to pin 13 */ +//#define SDC_CS 255 /* SDCARD CS pin */ +//#define SD_HSPI false /* use HSPI for SD (miso=12, mosi=13, clk=14) instead of VSPI (by default) */ + +/* RTC */ +//#define RTC_MODULE RTC_MODULE_UNDEFINED /* one of DS3231, DS1307, RTC_MODULE_UNDEFINED(default) */ +//#define RTC_SDA 255 /* RTC_SDA */ +//#define RTC_SCL 255 /* RTC_SCL */ /* ENCODER2 */ //#define ENC2_BTNL 255 /* Left rotation */ diff --git a/yoRadio/src/core/display.cpp b/yoRadio/src/core/display.cpp index 946c388..451f945 100644 --- a/yoRadio/src/core/display.cpp +++ b/yoRadio/src/core/display.cpp @@ -18,6 +18,10 @@ DspCore dsp; Page *pages[] = { new Page(), new Page(), new Page() }; +#ifndef DSQ_SEND_DELAY + #define DSQ_SEND_DELAY portMAX_DELAY +#endif + #ifndef CORE_STACK_SIZE #define CORE_STACK_SIZE 1024*3 #endif @@ -298,7 +302,7 @@ void Display::_swichMode(displayMode_e newmode) { } void Display::resetQueue(){ - xQueueReset(displayQueue); + if(displayQueue!=NULL) xQueueReset(displayQueue); } void Display::_drawPlaylist() { @@ -321,7 +325,7 @@ void Display::putRequest(displayRequestType_e type, int payload){ requestParams_t request; request.type = type; request.payload = payload; - xQueueSend(displayQueue, &request, portMAX_DELAY); + xQueueSend(displayQueue, &request, DSQ_SEND_DELAY); #ifdef USE_NEXTION nextion.putRequest(request); #endif diff --git a/yoRadio/src/core/netserver.cpp b/yoRadio/src/core/netserver.cpp index 9d291f6..0ff2747 100644 --- a/yoRadio/src/core/netserver.cpp +++ b/yoRadio/src/core/netserver.cpp @@ -15,6 +15,9 @@ #ifndef MIN_MALLOC #define MIN_MALLOC 24112 #endif +#ifndef NSQ_SEND_DELAY + #define NSQ_SEND_DELAY (TickType_t)100 //portMAX_DELAY? +#endif #ifdef USE_SD #define CARDLOCK() sdog.tm() @@ -710,11 +713,11 @@ void NetServer::requestOnChange(requestType_e request, uint8_t clientId) { nsRequestParams_t nsrequest; nsrequest.type = request; nsrequest.clientId = clientId; - xQueueSend(nsQueue, &nsrequest, portMAX_DELAY); + xQueueSend(nsQueue, &nsrequest, NSQ_SEND_DELAY); } void NetServer::resetQueue(){ - xQueueReset(nsQueue); + if(nsQueue!=NULL) xQueueReset(nsQueue); } String processor(const String& var) { // %Templates% diff --git a/yoRadio/src/core/options.h b/yoRadio/src/core/options.h index a75b5d6..493569d 100644 --- a/yoRadio/src/core/options.h +++ b/yoRadio/src/core/options.h @@ -1,7 +1,7 @@ #ifndef options_h #define options_h -#define YOVERSION "0.9.250" +#define YOVERSION "0.9.259" /******************************************************* DO NOT EDIT THIS FILE. diff --git a/yoRadio/src/core/player.cpp b/yoRadio/src/core/player.cpp index 8e5a1ed..92a6520 100644 --- a/yoRadio/src/core/player.cpp +++ b/yoRadio/src/core/player.cpp @@ -72,7 +72,11 @@ void Player::init() { void Player::sendCommand(playerRequestParams_t request){ if(playerQueue==NULL) return; - xQueueSend(playerQueue, &request, portMAX_DELAY); + xQueueSend(playerQueue, &request, PLQ_SEND_DELAY); +} + +void Player::resetQueue(){ + if(playerQueue!=NULL) xQueueReset(playerQueue); } void Player::stopInfo() { diff --git a/yoRadio/src/core/player.h b/yoRadio/src/core/player.h index a5d74a6..16478ff 100644 --- a/yoRadio/src/core/player.h +++ b/yoRadio/src/core/player.h @@ -12,6 +12,10 @@ #define MQTT_BURL_SIZE 512 #endif +#ifndef PLQ_SEND_DELAY + #define PLQ_SEND_DELAY portMAX_DELAY +#endif + #define PLERR_LN 64 #define SET_PLAY_ERROR(...) {char buff[512 + 64]; sprintf(buff,__VA_ARGS__); setError(buff);} @@ -51,6 +55,7 @@ class Player: public Audio { void setError(const char *e); bool hasError() { return strlen(_plError)>0; } void sendCommand(playerRequestParams_t request); + void resetQueue(); #ifdef MQTT_ROOT_TOPIC void browseUrl(); #endif