v0.9.337b
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include <Ticker.h>
|
||||
#include <SPI.h>
|
||||
#include <SPIFFS.h>
|
||||
#include "SD.h"
|
||||
//#include "SD.h"
|
||||
#include "options.h"
|
||||
#include "rtcsupport.h"
|
||||
|
||||
@@ -38,10 +38,12 @@
|
||||
#define MAX_PLAY_MODE 1
|
||||
|
||||
#if SDC_CS!=255
|
||||
#define USE_SD
|
||||
#define USE_SD
|
||||
#endif
|
||||
#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
|
||||
#define ESP_ARDUINO_3 1
|
||||
#endif
|
||||
enum playMode_e : uint8_t { PM_WEB=0, PM_SDCARD=1 };
|
||||
enum cardStatus_e : uint8_t { CS_NONE=0, CS_PRESENT=1, CS_MOUNTED=2, CS_EJECTED=3 };
|
||||
enum BitrateFormat { BF_UNCNOWN, BF_MP3, BF_AAC, BF_FLAC, BF_OGG, BF_WAV };
|
||||
|
||||
void u8fix(char *src);
|
||||
@@ -79,16 +81,16 @@ struct theme_t {
|
||||
struct config_t
|
||||
{
|
||||
unsigned int config_set; //must be 4262
|
||||
byte volume;
|
||||
uint8_t volume;
|
||||
int8_t balance;
|
||||
int8_t trebble;
|
||||
int8_t middle;
|
||||
int8_t bass;
|
||||
uint16_t lastStation;
|
||||
uint16_t countStation;
|
||||
byte lastSSID;
|
||||
uint8_t lastSSID;
|
||||
bool audioinfo;
|
||||
byte smartstart;
|
||||
uint8_t smartstart;
|
||||
int8_t tzHour;
|
||||
int8_t tzMin;
|
||||
uint16_t timezoneOffset;
|
||||
@@ -161,7 +163,7 @@ class Config {
|
||||
#endif
|
||||
BitrateFormat configFmt = BF_UNCNOWN;
|
||||
neworkItem ssids[5];
|
||||
byte ssidsCount;
|
||||
uint8_t ssidsCount;
|
||||
uint16_t sleepfor;
|
||||
uint32_t sdResumePos;
|
||||
uint16_t backupLastStation;
|
||||
@@ -177,32 +179,31 @@ class Config {
|
||||
#endif
|
||||
void init();
|
||||
void loadTheme();
|
||||
byte setVolume(byte val);
|
||||
uint8_t setVolume(uint8_t val);
|
||||
void saveVolume();
|
||||
void setTone(int8_t bass, int8_t middle, int8_t trebble);
|
||||
void setBalance(int8_t balance);
|
||||
byte setLastStation(uint16_t val);
|
||||
byte setCountStation(uint16_t val);
|
||||
byte setLastSSID(byte val);
|
||||
uint8_t setLastStation(uint16_t val);
|
||||
uint8_t setCountStation(uint16_t val);
|
||||
uint8_t setLastSSID(uint8_t val);
|
||||
void setTitle(const char* title);
|
||||
void setStation(const char* station);
|
||||
bool parseCSV(const char* line, char* name, char* url, int &ovol);
|
||||
bool parseJSON(const char* line, char* name, char* url, int &ovol);
|
||||
bool parseWsCommand(const char* line, char* cmd, char* val, byte cSize);
|
||||
bool parseWsCommand(const char* line, char* cmd, char* val, uint8_t cSize);
|
||||
bool parseSsid(const char* line, char* ssid, char* pass);
|
||||
void loadStation(uint16_t station);
|
||||
bool initNetwork();
|
||||
bool saveWifi();
|
||||
bool saveWifiFromNextion(const char* post);
|
||||
void setSmartStart(byte ss);
|
||||
void setSmartStart(uint8_t ss);
|
||||
void setBitrateFormat(BitrateFormat fmt) { configFmt = fmt; }
|
||||
void initPlaylist();
|
||||
void indexPlaylist();
|
||||
#ifdef USE_SD
|
||||
void initSDPlaylist(bool doIndex = true);
|
||||
void indexSDPlaylist();
|
||||
void changeMode(int newmode=-1);
|
||||
void checkSD();
|
||||
void initSDPlaylist(bool doIndex = true);
|
||||
|
||||
void changeMode(int newmode=-1);
|
||||
#endif
|
||||
uint8_t fillPlMenu(int from, uint8_t count, bool fromNextion=false);
|
||||
char * stationByNum(uint16_t num);
|
||||
@@ -217,33 +218,26 @@ class Config {
|
||||
void setSnuffle(bool sn);
|
||||
uint8_t getMode() { return store.play_mode & 0b11; }
|
||||
void initPlaylistMode();
|
||||
cardStatus_e getSDStatus(){ return _cardStatus; };
|
||||
void clearCardStatus() { if(_cardStatus!=CS_NONE) _cardStatus=CS_NONE; }
|
||||
|
||||
bool spiffsCleanup();
|
||||
FS* SDPLFS(){ return _SDplaylistFS; }
|
||||
#if RTCSUPPORTED
|
||||
bool isRTCFound(){ return _rtcFound; };
|
||||
bool isRTCFound(){ return _rtcFound; };
|
||||
#endif
|
||||
private:
|
||||
template <class T> int eepromWrite(int ee, const T& value);
|
||||
template <class T> int eepromRead(int ee, T& value);
|
||||
cardStatus_e _cardStatus;
|
||||
|
||||
bool _bootDone;
|
||||
#if RTCSUPPORTED
|
||||
bool _rtcFound;
|
||||
bool _rtcFound;
|
||||
#endif
|
||||
FS* _SDplaylistFS;
|
||||
void setDefaults();
|
||||
Ticker _sleepTimer;
|
||||
static void doSleep();
|
||||
uint16_t color565(uint8_t r, uint8_t g, uint8_t b);
|
||||
#ifdef USE_SD
|
||||
void listSD(File &plSDfile, File &plSDindex, const char * dirname, uint8_t levels);
|
||||
bool _sdCardIsConnected();
|
||||
void _mountSD();
|
||||
bool _sdBegin();
|
||||
#endif
|
||||
bool checkNoMedia(const char* path);
|
||||
|
||||
void _initHW();
|
||||
bool _isFSempty();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user