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);
setBrightness(false);
#endif
bootInfo();
}
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);
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 DBGH()
#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)
void u8fix(char *src);
@@ -175,6 +176,7 @@ class Config {
void setBrightness(bool dosave=false);
void setDspOn(bool dspon);
void sleepForAfter(uint16_t sleepfor, uint16_t sleepafter=0);
void bootInfo();
private:
template <class T> int eepromWrite(int ee, const T& value);
template <class T> int eepromRead(int ee, T& value);

View File

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

View File

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

View File

@@ -50,6 +50,7 @@ void ticks() {
#define DBGAP false
void Network::begin() {
BOOTLOG("network.begin");
config.initNetwork();
ctimer.detach();
forceTimeSync = forceWeather = true;
@@ -62,7 +63,9 @@ void Network::begin() {
byte errcnt = 0;
WiFi.mode(WIFI_STA);
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);
WiFi.begin(config.ssids[ls].ssid, config.ssids[ls].password);
while (WiFi.status() != WL_CONNECTED) {

View File

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

View File

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

View File

@@ -13,10 +13,13 @@ bool Telnet::_isIPSet(IPAddress ip) {
}
bool Telnet::begin() {
BOOTLOG("telnet.begin");
if (WiFi.status() == WL_CONNECTED || _isIPSet(WiFi.softAPIP())) {
server.begin();
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;
} else {
return false;