diff --git a/Controls.md b/Controls.md index 4878033..2071962 100644 --- a/Controls.md +++ b/Controls.md @@ -21,7 +21,7 @@ Button actions: longpress: quick volume down - BTN_CENTER\ click: start/stop playing\ - dblclick: toggle between PLAYER/PLAYLIST mode\ + dblclick: switch SD/WEB mode\ longpress: toggle between PLAYER/PLAYLIST mode - BTN_RIGHT\ click: volume up\ @@ -35,7 +35,10 @@ Button actions: click: without display - prev station, with display - move down\ dblclick: doing nothing\ longpress: with display - quick move down - +- BTN_MODE\ + click: switch SD/WEB mode\ + longpress: go to sleep + --- ### Encoders You can connect one or two encoders to replace/complete the buttons. One encoder (without buttons) is enough to control the device. diff --git a/README.md b/README.md index c5842a5..9bdaa80 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,16 @@ https://www.aliexpress.com/item/33009687492.html | 5V | +5V | - | | DGND | GND | - | +##### SD CARD +| Display | ESP-32 | myoptions.h | +| ------ | ------ | ------ | +| GND | GND | - | +| VCC | +5v | - | +| SCK | 18 | - | +| MISO | 19 | - | +| MOSI | 23 | - | +| CS | 255* | SDC_CS | + _\#\# Important! You must choose between I2S DAC and VS1053 by disabling the second module in the settings (see below)_ ##### Nextion Displays | Display | ESP-32 | myoptions.h | @@ -301,6 +311,15 @@ Work is in progress... --- ## Version history +#### v0.8.901 +**!!! a [full update](#update-over-web-interface) with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!** \ +**Please backup playlist.csv and wifi.csv before updating.** +- added SD Card support (more info in [connection table](#connection-tables) and [exsamples/myoptions.h](https://github.com/e2002/yoradio/blob/main/exsamples/myoptions.h)) +- added MODE button to switch SD/WEB modes (more info in [Controls.md](https://github.com/e2002/yoradio/blob/main/Controls.md)) +- asterisk on the remote control now switches SD/WEB modes +- double click BTN_CENTER and ENC_BTNB now toggles SD/WEB modes +- bug fixes + #### v0.8.173 - bootlog added - fixed work of start/stop button in configurations with DSP_DUMMY diff --git a/exsamples/myoptions.h b/exsamples/myoptions.h index 22a47c2..47107ff 100644 --- a/exsamples/myoptions.h +++ b/exsamples/myoptions.h @@ -74,7 +74,9 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti /* SDCARD */ /* MISO is the same as D0, MOSI is the same as D1 */ -//#define SDC_SPI 18, 19, 23 /* SDCARD SPI pins (SCK, MISO, MOSI) */ +/* 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 */ /* ENCODER2 */ @@ -95,6 +97,8 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti //#define BTN_LONGPRESS_LOOP_DELAY 200 /* Delay between calling DuringLongPress event */ //#define BTN_CLICK_TICKS 300 /* Event Timing https://github.com/mathertel/OneButton#event-timing */ //#define BTN_PRESS_TICKS 500 /* Event Timing https://github.com/mathertel/OneButton#event-timing */ + +//#define BTN_MODE 255 /* MODE switcher */ /******************************************/ /* LCD DISPLAY 1602 */ diff --git a/yoRadio/src/core/config.cpp b/yoRadio/src/core/config.cpp index 2abf38d..f126a95 100644 --- a/yoRadio/src/core/config.cpp +++ b/yoRadio/src/core/config.cpp @@ -9,7 +9,6 @@ Config config; #if DSP_HSPI || TS_HSPI || VS_HSPI || SD_HSPI SPIClass SPI2(HSPI); #endif -//SPIClass SDSPI(VSPI); void u8fix(char *src){ char last = src[strlen(src)-1]; @@ -24,7 +23,6 @@ void Config::init() { eepromRead(EEPROM_START, store); if (store.config_set != 4262) setDefaults(); backupLastStation = store.lastStation; - Serial.print("Config::init, backupLastStation=\t"); Serial.println(backupLastStation); if(store.play_mode==80) store.play_mode=0b100; sdSnuffle = bitRead(store.play_mode, 2); store.play_mode = store.play_mode & 0b11; @@ -37,10 +35,6 @@ void Config::init() { ssidsCount = 0; sdResumePos = 0; if(SDC_CS!=255){ - //pinMode(SDC_CS, OUTPUT); digitalWrite(SDC_CS, HIGH); - //SDSPI.begin(SDC_SPI); - //SDSPI.setFrequency(1000000); - //SDSPI.setFrequency(100000); if(!SD.begin(SDC_CS)){ store.play_mode=PM_WEB; Serial.println("##[ERROR]#\tCard Mount Failed"); diff --git a/yoRadio/src/core/display.cpp b/yoRadio/src/core/display.cpp index c84ac35..94c8a3a 100644 --- a/yoRadio/src/core/display.cpp +++ b/yoRadio/src/core/display.cpp @@ -332,7 +332,9 @@ void Display::_layoutChange(bool played){ } } } - +#ifndef DSP_QUEUE_TICKS + #define DSP_QUEUE_TICKS 8 +#endif void Display::loop() { if(_bootStep==0) { _pager.begin(); @@ -345,7 +347,7 @@ void Display::loop() { nextion.loop(); #endif requestParams_t request; - if(xQueueReceive(displayQueue, &request, 5)){ + if(xQueueReceive(displayQueue, &request, DSP_QUEUE_TICKS)){ switch (request.type){ case NEWMODE: _swichMode((displayMode_e)request.payload); break; case CLOCK: diff --git a/yoRadio/src/core/netserver.cpp b/yoRadio/src/core/netserver.cpp index 60ae6f6..5619b66 100644 --- a/yoRadio/src/core/netserver.cpp +++ b/yoRadio/src/core/netserver.cpp @@ -512,7 +512,6 @@ void NetServer::onWsMessage(void *arg, uint8_t *data, size_t len, uint8_t client } } if (strcmp(cmd, "snuffle") == 0) { - Serial.printf("snuffle=%s\t********************\n", val); config.setSnuffle(strcmp(val, "true") == 0); return; }