v0.6.290
This commit is contained in:
@@ -346,7 +346,9 @@ void Display::swichMode(displayMode_e newmode) {
|
||||
|
||||
void Display::drawPlayer() {
|
||||
if (clockRequest) {
|
||||
getLocalTime(&network.timeinfo);
|
||||
//getLocalTime(&network.timeinfo);
|
||||
network.timeinfo.tm_sec ++;
|
||||
mktime(&network.timeinfo);
|
||||
time();
|
||||
clockRequest = false;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,10 @@ void syncTime() {
|
||||
network.requestTimeSync(true);
|
||||
}
|
||||
|
||||
void getFirstTime() {
|
||||
getLocalTime(&network.timeinfo);
|
||||
}
|
||||
|
||||
void Network::begin() {
|
||||
config.initNetwork();
|
||||
if (config.ssidsCount == 0) {
|
||||
@@ -53,13 +57,15 @@ void Network::begin() {
|
||||
}
|
||||
digitalWrite(LED_BUILTIN, LOW);
|
||||
status = CONNECTED;
|
||||
requestTimeSync();
|
||||
configTime(config.store.tzHour * 3600 + config.store.tzMin * 60, config.getTimezoneOffset(), SNTP_SERVER);
|
||||
//getLocalTime(&timeinfo);
|
||||
stimer.once_ms(200,getFirstTime);
|
||||
ntimer.attach_ms(TSYNC_DELAY, syncTime);
|
||||
if (network_on_connect) network_on_connect();
|
||||
}
|
||||
|
||||
void Network::requestTimeSync(bool withTelnetOutput) {
|
||||
configTime(config.store.tzHour * 3600 + config.store.tzMin * 60, config.getTimezoneOffset(), "pool.ntp.org", "ru.pool.ntp.org");
|
||||
//configTime(config.store.tzHour * 3600 + config.store.tzMin * 60, config.getTimezoneOffset(), "pool.ntp.org", "ru.pool.ntp.org");
|
||||
if (withTelnetOutput) {
|
||||
getLocalTime(&timeinfo);
|
||||
char timeStringBuff[50];
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
#define apSsid "yoRadioAP"
|
||||
#define apPassword "12345987"
|
||||
#define TSYNC_DELAY 10800000 // 1000*60*60*3 = 3 hours
|
||||
//#define TSYNC_DELAY 10800000 // 1000*60*60*3 = 3 hours
|
||||
#define TSYNC_DELAY 3600000 // 1000*60*60 = 1 hour
|
||||
|
||||
enum n_Status_e { CONNECTED, SOFT_AP, FAILED };
|
||||
|
||||
@@ -18,7 +19,7 @@ class Network {
|
||||
void begin();
|
||||
void requestTimeSync(bool withTelnetOutput=false);
|
||||
private:
|
||||
Ticker ntimer;
|
||||
Ticker ntimer, stimer;
|
||||
void raiseSoftAP();
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef options_h
|
||||
#define options_h
|
||||
|
||||
#define VERSION "0.6.278"
|
||||
#define VERSION "0.6.292"
|
||||
|
||||
/*******************************************************
|
||||
DO NOT EDIT THIS FILE.
|
||||
@@ -212,6 +212,9 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti
|
||||
#ifndef PLAYER_FORCE_MONO
|
||||
#define PLAYER_FORCE_MONO false // mono option - false stereo, true mono
|
||||
#endif
|
||||
#ifndef SNTP_SERVER
|
||||
#define SNTP_SERVER "pool.ntp.org", "0.ru.pool.ntp.org" // custom ntp servers min 1 max 3 comma separated values
|
||||
#endif
|
||||
/*
|
||||
*** ST7735 display submodel ***
|
||||
INITR_BLACKTAB // 1.8' https://aliexpress.ru/item/1005002822797745.html
|
||||
|
||||
Reference in New Issue
Block a user