v0.6.400
This commit is contained in:
@@ -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, "\",\"");
|
||||
|
||||
@@ -401,6 +401,8 @@ void touchLoop() {
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (TS_DBG) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user