From 36c24ecdb5b1baf314377b963b5463519a7fa1d4 Mon Sep 17 00:00:00 2001 From: e2002 Date: Thu, 7 Jul 2022 12:52:47 +0300 Subject: [PATCH] v0.6.400 --- README.md | 3 +++ exsamples/plugins/displayhandlers.ino | 2 +- exsamples/plugins/rssibitrate.ino | 2 +- yoRadio/config.cpp | 4 ++-- yoRadio/controls.cpp | 2 ++ yoRadio/display.cpp | 1 + yoRadio/fonts/glcdfont.c | 4 ++++ yoRadio/mqtt.cpp | 9 +++++---- yoRadio/options.h | 2 +- yoRadio/src/displays/displayILI9225.cpp | 1 + yoRadio/src/displays/displaySSD1306.cpp | 1 + yoRadio/src/yoEncoder/yoEncoder.h | 3 ++- 12 files changed, 24 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9eeb011..df21ccb 100644 --- a/README.md +++ b/README.md @@ -295,6 +295,9 @@ Work is in progress... --- ## Version history +#### v0.6.400 +- fixed compilation errors with esp32 core 2.0.4 + #### v0.6.380 **!!! a [full update](#update-over-web-interface) with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!** - fixed a bug when saving a playlist with special characters in the name and url diff --git a/exsamples/plugins/displayhandlers.ino b/exsamples/plugins/displayhandlers.ino index 44575b7..a7f0f02 100644 --- a/exsamples/plugins/displayhandlers.ino +++ b/exsamples/plugins/displayhandlers.ino @@ -25,7 +25,7 @@ Ticker ticker; ***********************************************/ Scroll hello; -char weather[140] = { 0 }; +char weather[254] = { 0 }; bool weatherRequest = false; TaskHandle_t weatherUpdateTaskHandle; diff --git a/exsamples/plugins/rssibitrate.ino b/exsamples/plugins/rssibitrate.ino index 56528f2..ff907a7 100644 --- a/exsamples/plugins/rssibitrate.ino +++ b/exsamples/plugins/rssibitrate.ino @@ -13,7 +13,7 @@ bool dsp_before_rssi(DspCore *dsp){ char buf[20]; /* buffer for the bitrate string */ uint16_t w, h; /* width & height of the bitrate string */ int16_t vTop = dsp->height() - TFT_FRAMEWDT * 2 - TFT_LINEHGHT - 2; /* vTop - Y cordnate of the bitrate string */; - sprintf(buf, "RSSI:000dBm", config.station.bitrate); + sprintf(buf, "RSSI:000dBm"); dsp->setTextSize(1); dsp->getTextBounds(buf, 0, 0, &x1, &y1, &w, &h); dsp->fillRect(dsp->width() - w - TFT_FRAMEWDT /* left */, vTop /* top */, w /* width */, TFT_LINEHGHT-2 /* height */, TFT_BG /* background color */); diff --git a/yoRadio/config.cpp b/yoRadio/config.cpp index 4c99fc9..d5eaeed 100644 --- a/yoRadio/config.cpp +++ b/yoRadio/config.cpp @@ -232,7 +232,7 @@ void Config::fillPlMenu(char plmenu[][40], int from, byte count) { while (playlist.available()) { if (parseCSV(playlist.readStringUntil('\n').c_str(), sName, sUrl, sOvol)) { #ifdef PL_WITH_NUMBERS - char buf[BUFLEN]; + char buf[BUFLEN+10]; sprintf(buf, "%d %s", (int)(from+c), sName); strlcpy(plmenu[c], buf, 39); #else @@ -270,7 +270,7 @@ bool Config::parseCSV(const char* line, char* name, char* url, int &ovol) { bool Config::parseJSON(const char* line, char* name, char* url, int &ovol) { char* tmps, *tmpe; const char* cursor = line; - char port[8], host[254], file[254]; + char port[8], host[246], file[254]; tmps = strstr(cursor, "\":\""); if (tmps == NULL) return false; tmpe = strstr(tmps, "\",\""); diff --git a/yoRadio/controls.cpp b/yoRadio/controls.cpp index 83c283c..ebc2c87 100644 --- a/yoRadio/controls.cpp +++ b/yoRadio/controls.cpp @@ -401,6 +401,8 @@ void touchLoop() { } break; } + default: + break; } } if (TS_DBG) { diff --git a/yoRadio/display.cpp b/yoRadio/display.cpp index 1604d76..380c1db 100644 --- a/yoRadio/display.cpp +++ b/yoRadio/display.cpp @@ -543,6 +543,7 @@ void Display::ip() { void Display::time(bool redraw) { if (dsp_before_clock) if (!dsp_before_clock(&dsp, dt)) return; char timeStringBuff[20] = { 0 }; + (void)timeStringBuff; if (!dt) { heap(); rssi(); diff --git a/yoRadio/fonts/glcdfont.c b/yoRadio/fonts/glcdfont.c index f00553c..95bf7c0 100644 --- a/yoRadio/fonts/glcdfont.c +++ b/yoRadio/fonts/glcdfont.c @@ -270,4 +270,8 @@ static const unsigned char font[] PROGMEM = { 0x7C, 0x10, 0x38, 0x44, 0x38, 0x48, 0x34, 0x14, 0x14, 0x7C }; + +static inline void avoid_unused_const_variable_compiler_warning(void) { + (void)font; +} #endif // FONT5X7_H diff --git a/yoRadio/mqtt.cpp b/yoRadio/mqtt.cpp index 91d42d7..75e3504 100644 --- a/yoRadio/mqtt.cpp +++ b/yoRadio/mqtt.cpp @@ -19,7 +19,7 @@ void mqttInit() { mqttClient.onConnect(onMqttConnect); mqttClient.onDisconnect(onMqttDisconnect); mqttClient.onMessage(onMqttMessage); - if(MQTT_USER!="") mqttClient.setCredentials(MQTT_USER, MQTT_PASS); + if(strlen(MQTT_USER)>0) mqttClient.setCredentials(MQTT_USER, MQTT_PASS); mqttClient.setServer(MQTT_HOST, MQTT_PORT); connectToMqtt(); } @@ -35,7 +35,7 @@ void onMqttConnect(bool sessionPresent) { void mqttPublishStatus() { if(mqttClient.connected()){ - char topic[140], status[255]; + char topic[140], status[BUFLEN*3]; sprintf(topic, "%s%s", MQTT_ROOT_TOPIC, "status"); sprintf(status, "{\"status\": %d, \"station\": %d, \"name\": \"%s\", \"title\": \"%s\"}", player.mode==PLAYING?1:0, config.store.lastStation, config.station.name, config.station.title); mqttClient.publish(topic, 0, true, status); @@ -111,12 +111,13 @@ void onMqttMessage(char* topic, char* payload, AsyncMqttClientMessageProperties player.setVol(volume, false); return; } - uint16_t sb; + //uint16_t sb; + int sb; if (sscanf(buf, "play %d", &sb) == 1 ) { if (sb < 1) sb = 1; if (sb >= config.store.countStation) sb = config.store.countStation; //player.play(sb); - player.request.station = sb; + player.request.station = (uint16_t)sb; player.request.doSave = true; return; } diff --git a/yoRadio/options.h b/yoRadio/options.h index c0d560a..7127d9a 100644 --- a/yoRadio/options.h +++ b/yoRadio/options.h @@ -1,7 +1,7 @@ #ifndef options_h #define options_h -#define VERSION "0.6.380" +#define VERSION "0.6.400" /******************************************************* DO NOT EDIT THIS FILE. diff --git a/yoRadio/src/displays/displayILI9225.cpp b/yoRadio/src/displays/displayILI9225.cpp index 65068b4..c72fe73 100644 --- a/yoRadio/src/displays/displayILI9225.cpp +++ b/yoRadio/src/displays/displayILI9225.cpp @@ -355,6 +355,7 @@ void DspCore::drawVolumeBar(bool withNumber) { int16_t vTop = sheight - TFT_FRAMEWDT * 2; int16_t volTop = sheight - TFT_FRAMEWDT * 2 - TFT_LINEHGHT - 2; int16_t vWidth = swidth - TFT_FRAMEWDT *2; + (void)volTop; uint16_t ww = map(config.store.volume, 0, 254, 0, vWidth - 2); fillRect(TFT_FRAMEWDT, vTop - 2, vWidth, 6, TFT_BG); drawRectangle(TFT_FRAMEWDT, vTop - 2, TFT_FRAMEWDT+vWidth, 6+vTop - 2, TFT_LOGO); diff --git a/yoRadio/src/displays/displaySSD1306.cpp b/yoRadio/src/displays/displaySSD1306.cpp index bbf03aa..c1215bc 100644 --- a/yoRadio/src/displays/displaySSD1306.cpp +++ b/yoRadio/src/displays/displaySSD1306.cpp @@ -257,6 +257,7 @@ void DspCore::printClock(struct tm timeinfo, bool dots, bool redraw) { void DspCore::drawVolumeBar(bool withNumber) { int16_t vTop = sheight - 4; + (void)vTop; int16_t vWidth = swidth-TFT_FRAMEWDT*2; #if DSP_MODEL==DSP_SSD1306 uint8_t ww = map(config.store.volume, 0, 254, 0, vWidth - 2); diff --git a/yoRadio/src/yoEncoder/yoEncoder.h b/yoRadio/src/yoEncoder/yoEncoder.h index 7b30fce..ad9e081 100644 --- a/yoRadio/src/yoEncoder/yoEncoder.h +++ b/yoRadio/src/yoEncoder/yoEncoder.h @@ -34,7 +34,8 @@ private: uint8_t encoderBPin; long encoderSteps; - long _minEncoderValue = -1 << 15; + //long _minEncoderValue = -1 << 15; + long _minEncoderValue = -32768; long _maxEncoderValue = 1 << 15; uint8_t old_AB;