fixed typo and small logical mistake

pull/70/head
etwasmitbaum 2021-06-28 22:26:05 +02:00
parent 600e4be7d8
commit 4aba015a03
1 changed files with 2 additions and 3 deletions

View File

@ -10,7 +10,7 @@ RTC_DATA_ATTR bool WIFI_CONFIGURED;
RTC_DATA_ATTR bool BLE_CONFIGURED; RTC_DATA_ATTR bool BLE_CONFIGURED;
RTC_DATA_ATTR weatherData currentWeather; RTC_DATA_ATTR weatherData currentWeather;
RTC_DATA_ATTR int weatherIntervalCounter = WEATHER_UPDATE_INTERVAL; RTC_DATA_ATTR int weatherIntervalCounter = WEATHER_UPDATE_INTERVAL;
RTC_DARA_ATTR int ntpSyncTimeCounter = NTP_TIME_SYNC_INTERVAL; RTC_DATA_ATTR int ntpSyncTimeCounter = NTP_TIME_SYNC_INTERVAL;
String getValue(String data, char separator, int index) String getValue(String data, char separator, int index)
{ {
@ -108,8 +108,6 @@ void Watchy::syncNtpTime(){
// shut down the radio to save power // shut down the radio to save power
WiFi.mode(WIFI_OFF); WiFi.mode(WIFI_OFF);
btStop(); btStop();
} else {
ntpSyncTimeCounter = ntpSyncTimeCounter + WEATHER_UPDATE_INTERVAL;
} }
} }
@ -684,6 +682,7 @@ weatherData Watchy::getWeatherData(){
weatherIntervalCounter = 0; weatherIntervalCounter = 0;
}else{ }else{
weatherIntervalCounter++; weatherIntervalCounter++;
ntpSyncTimeCounter = ntpSyncTimeCounter + WEATHER_UPDATE_INTERVAL;
} }
return currentWeather; return currentWeather;
} }