v0.6.220
This commit is contained in:
@@ -278,6 +278,11 @@ Work is in progress...
|
|||||||
|
|
||||||
---
|
---
|
||||||
## Version history
|
## Version history
|
||||||
|
#### v0.6.220
|
||||||
|
- new option PLAYER_FORCE_MONO (with i2S DAC only)
|
||||||
|
- change default scroll speed in DSP_NOKIA5110
|
||||||
|
- improved reconnect to WiFi on connection loss
|
||||||
|
|
||||||
#### v0.6.210
|
#### v0.6.210
|
||||||
- fixed choppy playback on DSP_ST7735 displays used with VS1053
|
- fixed choppy playback on DSP_ST7735 displays used with VS1053
|
||||||
- new option PL_WITH_NUMBERS (show the number of station in the playlist)
|
- new option PL_WITH_NUMBERS (show the number of station in the playlist)
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti
|
|||||||
//#define MUTE_PIN 255 /* MUTE Pin */
|
//#define MUTE_PIN 255 /* MUTE Pin */
|
||||||
//#define MUTE_VAL HIGH /* Write this to MUTE_PIN when player is stopped */
|
//#define MUTE_VAL HIGH /* Write this to MUTE_PIN when player is stopped */
|
||||||
//#define PL_WITH_NUMBERS /* show the number of station in the playlist */
|
//#define PL_WITH_NUMBERS /* show the number of station in the playlist */
|
||||||
|
//#define PLAYER_FORCE_MONO false /* mono option on boot - false stereo, true mono */
|
||||||
|
|
||||||
/******************************************/
|
/******************************************/
|
||||||
|
|
||||||
|
|||||||
BIN
images/img0.jpg
BIN
images/img0.jpg
Binary file not shown.
|
Before Width: | Height: | Size: 221 KiB After Width: | Height: | Size: 237 KiB |
@@ -533,27 +533,10 @@ void Display::ip() {
|
|||||||
dsp.ip(WiFi.localIP().toString().c_str());
|
dsp.ip(WiFi.localIP().toString().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Display::checkConnection() {
|
|
||||||
if (WiFi.status() != WL_CONNECTED) {
|
|
||||||
bool playing = player.mode == PLAYING;
|
|
||||||
swichMode(LOST);
|
|
||||||
if (playing) player.mode = STOPPED;
|
|
||||||
WiFi.disconnect();
|
|
||||||
ip();
|
|
||||||
WiFi.reconnect();
|
|
||||||
while (WiFi.status() != WL_CONNECTED) {
|
|
||||||
delay(500);
|
|
||||||
}
|
|
||||||
swichMode(PLAYER);
|
|
||||||
if (playing) player.play(config.store.lastStation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Display::time(bool redraw) {
|
void Display::time(bool redraw) {
|
||||||
if (dsp_before_clock) if (!dsp_before_clock(&dsp, dt)) return;
|
if (dsp_before_clock) if (!dsp_before_clock(&dsp, dt)) return;
|
||||||
char timeStringBuff[20] = { 0 };
|
char timeStringBuff[20] = { 0 };
|
||||||
if (!dt) {
|
if (!dt) {
|
||||||
checkConnection();
|
|
||||||
heap();
|
heap();
|
||||||
rssi();
|
rssi();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,6 @@ class Display {
|
|||||||
void apScreen();
|
void apScreen();
|
||||||
void drawPlayer();
|
void drawPlayer();
|
||||||
void drawVolume();
|
void drawVolume();
|
||||||
void checkConnection();
|
|
||||||
void swichMode(displayMode_e newmode);
|
void swichMode(displayMode_e newmode);
|
||||||
void drawPlaylist();
|
void drawPlaylist();
|
||||||
void volume();
|
void volume();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef options_h
|
#ifndef options_h
|
||||||
#define options_h
|
#define options_h
|
||||||
|
|
||||||
#define VERSION "0.6.210"
|
#define VERSION "0.6.220"
|
||||||
|
|
||||||
/*******************************************************
|
/*******************************************************
|
||||||
DO NOT EDIT THIS FILE.
|
DO NOT EDIT THIS FILE.
|
||||||
@@ -203,7 +203,9 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti
|
|||||||
#ifndef MUTE_VAL
|
#ifndef MUTE_VAL
|
||||||
#define MUTE_VAL HIGH // Write this to MUTE_PIN when player is stopped
|
#define MUTE_VAL HIGH // Write this to MUTE_PIN when player is stopped
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef PLAYER_FORCE_MONO
|
||||||
|
#define PLAYER_FORCE_MONO false // mono option - false stereo, true mono
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
*** ST7735 display submodel ***
|
*** ST7735 display submodel ***
|
||||||
INITR_BLACKTAB // 1.8' https://aliexpress.ru/item/1005002822797745.html
|
INITR_BLACKTAB // 1.8' https://aliexpress.ru/item/1005002822797745.html
|
||||||
|
|||||||
@@ -272,6 +272,7 @@ public:
|
|||||||
void setBalance(int8_t bal = 0);
|
void setBalance(int8_t bal = 0);
|
||||||
void setTone(int8_t gainLowPass, int8_t gainBandPass, int8_t gainHighPass);
|
void setTone(int8_t gainLowPass, int8_t gainBandPass, int8_t gainHighPass);
|
||||||
void setDefaults();
|
void setDefaults();
|
||||||
|
void forceMono(bool m) {} // TODO
|
||||||
// implement several function with respect to the index of string
|
// implement several function with respect to the index of string
|
||||||
bool startsWith (const char* base, const char* str) { return (strstr(base, str) - base) == 0;}
|
bool startsWith (const char* base, const char* str) { return (strstr(base, str) - base) == 0;}
|
||||||
bool endsWith (const char* base, const char* str) {
|
bool endsWith (const char* base, const char* str) {
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
#if !defined(SCROLLDELTA) || !defined(SCROLLTIME)
|
#if !defined(SCROLLDELTA) || !defined(SCROLLTIME)
|
||||||
//#define SCROLLDELTA 8
|
//#define SCROLLDELTA 8
|
||||||
//#define SCROLLTIME 332
|
//#define SCROLLTIME 332
|
||||||
#define SCROLLDELTA 5
|
#define SCROLLDELTA 4
|
||||||
#define SCROLLTIME 200
|
#define SCROLLTIME 250
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define META_SIZE 1
|
#define META_SIZE 1
|
||||||
|
|||||||
@@ -14,6 +14,9 @@
|
|||||||
#include "controls.h"
|
#include "controls.h"
|
||||||
#include "mqtt.h"
|
#include "mqtt.h"
|
||||||
|
|
||||||
|
unsigned long checkMillis = 0;
|
||||||
|
unsigned long checkInterval = 3000;
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
pinMode(LED_BUILTIN, OUTPUT);
|
pinMode(LED_BUILTIN, OUTPUT);
|
||||||
@@ -28,6 +31,9 @@ void setup() {
|
|||||||
}
|
}
|
||||||
netserver.begin();
|
netserver.begin();
|
||||||
telnet.begin();
|
telnet.begin();
|
||||||
|
#if PLAYER_FORCE_MONO
|
||||||
|
player.forceMono(true);
|
||||||
|
#endif
|
||||||
player.setVol(config.store.volume, true);
|
player.setVol(config.store.volume, true);
|
||||||
initControls();
|
initControls();
|
||||||
display.start();
|
display.start();
|
||||||
@@ -44,7 +50,26 @@ void loop() {
|
|||||||
telnet.loop();
|
telnet.loop();
|
||||||
player.loop();
|
player.loop();
|
||||||
loopControls();
|
loopControls();
|
||||||
|
checkConnection();
|
||||||
}
|
}
|
||||||
// display.loop();
|
// display.loop();
|
||||||
netserver.loop();
|
netserver.loop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void checkConnection(){
|
||||||
|
if ((WiFi.status() != WL_CONNECTED) && (millis() - checkMillis >=checkInterval)) {
|
||||||
|
bool playing = player.isRunning();
|
||||||
|
if (playing) player.mode = STOPPED;
|
||||||
|
display.putRequest({NEWMODE, LOST});
|
||||||
|
Serial.println("Lost connection, reconnecting...");
|
||||||
|
while(true){
|
||||||
|
if (WiFi.status() == WL_CONNECTED) break;
|
||||||
|
WiFi.disconnect();
|
||||||
|
WiFi.reconnect();
|
||||||
|
delay(3000);
|
||||||
|
}
|
||||||
|
display.putRequest({NEWMODE, PLAYER});
|
||||||
|
if (playing) player.request.station = config.store.lastStation;
|
||||||
|
checkMillis = millis();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user