1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-16 07:23:07 +01:00

Fix for sunset/sunrise

This commit is contained in:
norbert-walter
2022-04-04 17:41:55 +02:00
parent 79b0e9ab9e
commit ff76620329
5 changed files with 17 additions and 9 deletions

View File

@@ -445,10 +445,11 @@ void OBP60Task(GwApi *api){
if(millis() > starttime5 + 1000){
starttime5 = millis();
if(time->valid == true && date->valid == true && lat->valid == true && lon->valid == true){
commonData.data = calcSunsetSunrise(api, time->value , date->value, lat->value, lon->value, tz.toDouble());
// Provide sundata to all pages
commonData.sundata = calcSunsetSunrise(api, time->value , date->value, lat->value, lon->value, tz.toDouble());
// Backlight with sun control
if(String(backlight) == "Control by Sun"){
setPortPin(OBP_BACKLIGHT_LED, commonData.data.sunDown);
setPortPin(OBP_BACKLIGHT_LED, commonData.sundata.sunDown);
}
}
}