This commit is contained in:
e2002
2025-07-29 10:42:00 +03:00
parent 58303515ab
commit f320c021b2
5 changed files with 51 additions and 39 deletions

Binary file not shown.

View File

@@ -1,7 +1,7 @@
#ifndef options_h
#define options_h
#define YOVERSION "0.9.552"
#define YOVERSION "0.9.553"
/*******************************************************
DO NOT EDIT THIS FILE.

View File

@@ -53,36 +53,11 @@ bool TimeKeeper::loop0(){ // core0 (display)
_last2s = currentTime;
_upRSSI();
}
if (currentTime - _last5s >= 5000) { // 2sec
if (currentTime - _last5s >= 5000) { // 5sec
_last5s = currentTime;
//HEAP_INFO();
}
#ifdef DUMMYDISPLAY
return true;
#endif
static uint32_t lastWeatherTime = 0;
if (currentTime - lastWeatherTime >= WEATHER_SYNC_INTERVAL) {
lastWeatherTime = currentTime;
forceWeather = true;
}
static uint32_t lastTimeTime = 0;
if (currentTime - lastTimeTime >= TIME_SYNC_INTERVAL) {
lastTimeTime = currentTime;
forceTimeSync = true;
}
if (!busy && (forceWeather || forceTimeSync) && network.status == CONNECTED) {
busy = true;
//config.setTimeConf();
xTaskCreatePinnedToCore(
_syncTask,
"syncTask",
SYNC_STACK_SIZE,
NULL, // Params
SYNC_TASK_PRIORITY,
NULL, // Descriptor
SYNC_TASK_CORE
);
}
return true; // just in case
}
@@ -106,6 +81,35 @@ bool TimeKeeper::loop1(){ // core1 (player)
if (currentTime - _last2s >= 2000) { // 2sec
_last2s = currentTime;
}
#ifdef DUMMYDISPLAY
return true;
#endif
// Sync weather & time
static uint32_t lastWeatherTime = 0;
if (currentTime - lastWeatherTime >= WEATHER_SYNC_INTERVAL) {
lastWeatherTime = currentTime;
forceWeather = true;
}
static uint32_t lastTimeTime = 0;
if (currentTime - lastTimeTime >= TIME_SYNC_INTERVAL) {
lastTimeTime = currentTime;
forceTimeSync = true;
}
if (!busy && (forceWeather || forceTimeSync) && network.status == CONNECTED) {
busy = true;
//config.setTimeConf();
xTaskCreatePinnedToCore(
_syncTask,
"syncTask",
SYNC_STACK_SIZE,
NULL, // Params
SYNC_TASK_PRIORITY,
NULL, // Descriptor
SYNC_TASK_CORE
);
}
return true; // just in case
}
@@ -217,7 +221,6 @@ void TimeKeeper::weatherTask(){
bool _getWeather(char *wstr) {
#if (DSP_MODEL!=DSP_DUMMY || defined(USE_NEXTION)) && !defined(HIDE_WEATHER)
WiFiClient client;
const char* host = "api.openweathermap.org";
if (!client.connect(host, 80)) {