uint32_tnxtTrig=mSunset+mConfig->sun.offsetSec+60;// set next trigger to communication stop, +60 for safety that it is certain past communication stop
uint32_tnxtTrig=mSunset+mConfig->sun.offsetSecEvening+60;// set next trigger to communication stop, +60 for safety that it is certain past communication stop
iv->commEnabled=!iv->config->disNightCom;// if sun.disNightCom is false, communication is always on
if(!iv->commEnabled){// inverter communication only during the day
if(mTimestamp<(mSunrise-mConfig->sun.offsetSec)){// current time is before communication start, set next trigger to communication start
nxtTrig=mSunrise-mConfig->sun.offsetSec;
if(mTimestamp<(mSunrise-mConfig->sun.offsetSecMorning)){// current time is before communication start, set next trigger to communication start
nxtTrig=mSunrise-mConfig->sun.offsetSecMorning;
}else{
if(mTimestamp>=(mSunset+mConfig->sun.offsetSec)){// current time is past communication stop, nothing to do. Next update will be done at midnight by tickCalcSunrise
if(mTimestamp>=(mSunset+mConfig->sun.offsetSecEvening)){// current time is past communication stop, nothing to do. Next update will be done at midnight by tickCalcSunrise
nxtTrig=0;
}else{// current time lies within communication start/stop time, set next trigger to communication stop