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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user