This commit is contained in:
e2002
2022-12-08 17:52:23 +03:00
parent 3dc706c838
commit 1081cae041
8 changed files with 40 additions and 3 deletions

View File

@@ -45,6 +45,7 @@ void Config::init() {
pinMode(BRIGHTNESS_PIN, OUTPUT); pinMode(BRIGHTNESS_PIN, OUTPUT);
setBrightness(false); setBrightness(false);
#endif #endif
bootInfo();
} }
uint16_t Config::color565(uint8_t r, uint8_t g, uint8_t b) uint16_t Config::color565(uint8_t r, uint8_t g, uint8_t b)
@@ -539,3 +540,25 @@ void Config::sleepForAfter(uint16_t sf, uint16_t sa){
if(sa > 0) _sleepTimer.attach(sa * 60, doSleep); if(sa > 0) _sleepTimer.attach(sa * 60, doSleep);
else doSleep(); else doSleep();
} }
void Config::bootInfo() {
BOOTLOG("******************************************");
BOOTLOG("* ёPadio v%s *", VERSION);
BOOTLOG("******************************************");
BOOTLOG("display:\t%d", DSP_MODEL);
if(VS1053_CS==255) {
BOOTLOG("audio:\t\t%s (%d, %d, %d)", "I2S", I2S_DOUT, I2S_BCLK, I2S_LRC);
}else{
BOOTLOG("audio:\t\t%s (%d, %d, %d, %d, %s)", "VS1053", VS1053_CS, VS1053_DCS, VS1053_DREQ, VS1053_RST, VS_HSPI?"true":"false");
}
BOOTLOG("audioinfo:\t%s", store.audioinfo?"true":"false");
BOOTLOG("smartstart:\t%d", store.smartstart);
BOOTLOG("vumeter:\t%s", store.vumeter?"true":"false");
BOOTLOG("softapdelay:\t%d", store.softapdelay);
BOOTLOG("flipscreen:\t%s", store.flipscreen?"true":"false");
BOOTLOG("invertdisplay:\t%s", store.invertdisplay?"true":"false");
BOOTLOG("showweather:\t%s", store.showweather?"true":"false");
BOOTLOG("buttons:\tleft=%d, center=%d, right=%d, up=%d, down=%d, ", BTN_LEFT, BTN_CENTER, BTN_RIGHT, BTN_UP, BTN_DOWN);
BOOTLOG("encoders:\tl1=%d, b1=%d, r1=%d, l2=%d, b2=%d, r2=%d", ENC_BTNL, ENC_BTNB, ENC_BTNR, ENC2_BTNL, ENC2_BTNB, ENC2_BTNR);
}

View File

@@ -22,6 +22,7 @@
#define DBGVB( ... ) #define DBGVB( ... )
#define DBGH() #define DBGH()
#endif #endif
#define BOOTLOG( ... ) { char buf[120]; sprintf( buf, __VA_ARGS__ ) ; Serial.print("##[BOOT]#\t"); Serial.println(buf); }
#define EVERY_MS(x) static uint32_t tmr; bool flag = millis() - tmr >= (x); if (flag) tmr += (x); if (flag) #define EVERY_MS(x) static uint32_t tmr; bool flag = millis() - tmr >= (x); if (flag) tmr += (x); if (flag)
void u8fix(char *src); void u8fix(char *src);
@@ -175,6 +176,7 @@ class Config {
void setBrightness(bool dosave=false); void setBrightness(bool dosave=false);
void setDspOn(bool dspon); void setDspOn(bool dspon);
void sleepForAfter(uint16_t sleepfor, uint16_t sleepafter=0); void sleepForAfter(uint16_t sleepfor, uint16_t sleepafter=0);
void bootInfo();
private: private:
template <class T> int eepromWrite(int ee, const T& value); template <class T> int eepromWrite(int ee, const T& value);
template <class T> int eepromRead(int ee, T& value); template <class T> int eepromRead(int ee, T& value);

View File

@@ -47,6 +47,7 @@ void loopDspTask(void * pvParameters){
} }
void Display::init() { void Display::init() {
BOOTLOG("display.init");
#ifdef USE_NEXTION #ifdef USE_NEXTION
nextion.begin(); nextion.begin();
#endif #endif
@@ -62,6 +63,7 @@ void Display::init() {
while(!_bootStep==0) { delay(10); } while(!_bootStep==0) { delay(10); }
//_pager.begin(); //_pager.begin();
//_bootScreen(); //_bootScreen();
BOOTLOG("done");
} }
void Display::_bootScreen(){ void Display::_bootScreen(){

View File

@@ -48,6 +48,7 @@ char* updateError() {
} }
bool NetServer::begin() { bool NetServer::begin() {
BOOTLOG("netserver.begin");
importRequest = IMDONE; importRequest = IMDONE;
irRecordEnable = false; irRecordEnable = false;
webserver.on("/", HTTP_ANY, handleHTTPArgs); webserver.on("/", HTTP_ANY, handleHTTPArgs);
@@ -75,6 +76,7 @@ bool NetServer::begin() {
packet.println(WiFi.localIP()); packet.println(WiFi.localIP());
}); });
} }
BOOTLOG("done");
return true; return true;
} }

View File

@@ -50,6 +50,7 @@ void ticks() {
#define DBGAP false #define DBGAP false
void Network::begin() { void Network::begin() {
BOOTLOG("network.begin");
config.initNetwork(); config.initNetwork();
ctimer.detach(); ctimer.detach();
forceTimeSync = forceWeather = true; forceTimeSync = forceWeather = true;
@@ -62,7 +63,9 @@ void Network::begin() {
byte errcnt = 0; byte errcnt = 0;
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
while (true) { while (true) {
Serial.printf("[BOOT]\tAttempt to connect to %s...\n", config.ssids[ls].ssid); //BOOTLOG("Attempt to connect to %s...\n", config.ssids[ls].ssid);
Serial.printf("##[BOOT]#\tAttempt to connect to %s\n", config.ssids[ls].ssid);
Serial.print("##[BOOT]#\t");
display.putRequest(BOOTSTRING, ls); display.putRequest(BOOTSTRING, ls);
WiFi.begin(config.ssids[ls].ssid, config.ssids[ls].password); WiFi.begin(config.ssids[ls].ssid, config.ssids[ls].password);
while (WiFi.status() != WL_CONNECTED) { while (WiFi.status() != WL_CONNECTED) {

View File

@@ -1,7 +1,7 @@
#ifndef options_h #ifndef options_h
#define options_h #define options_h
#define VERSION "0.8.138" #define VERSION "0.8.151"
/******************************************************* /*******************************************************
DO NOT EDIT THIS FILE. DO NOT EDIT THIS FILE.

View File

@@ -33,6 +33,7 @@ Player player;
void Player::init() { void Player::init() {
BOOTLOG("player.init");
if(MUTE_PIN!=255) pinMode(MUTE_PIN, OUTPUT); if(MUTE_PIN!=255) pinMode(MUTE_PIN, OUTPUT);
#if I2S_DOUT!=255 #if I2S_DOUT!=255
#if !I2S_INTERNAL #if !I2S_INTERNAL
@@ -52,6 +53,7 @@ void Player::init() {
volTimer=false; volTimer=false;
zeroRequest(); zeroRequest();
playmutex = xSemaphoreCreateMutex(); playmutex = xSemaphoreCreateMutex();
BOOTLOG("done");
} }
void Player::stopInfo() { void Player::stopInfo() {

View File

@@ -13,10 +13,13 @@ bool Telnet::_isIPSet(IPAddress ip) {
} }
bool Telnet::begin() { bool Telnet::begin() {
BOOTLOG("telnet.begin");
if (WiFi.status() == WL_CONNECTED || _isIPSet(WiFi.softAPIP())) { if (WiFi.status() == WL_CONNECTED || _isIPSet(WiFi.softAPIP())) {
server.begin(); server.begin();
server.setNoDelay(true); server.setNoDelay(true);
Serial.printf("Ready! Use 'telnet %s 23' to connect\n", WiFi.localIP().toString().c_str()); BOOTLOG("Ready! Go to http:/%s/ to configure.", WiFi.localIP().toString().c_str());
BOOTLOG("******************************************\n");
Serial.println();
return true; return true;
} else { } else {
return false; return false;