Fix time and generation handling a bit

This commit is contained in:
Stefan `Sec` Zehl 2011-07-31 00:53:53 +02:00
parent 06ac802ee5
commit 8bc5424607
1 changed files with 5 additions and 3 deletions

View File

@ -68,13 +68,15 @@ void mesh_recvloop(void){
pktctr++;
if(MO_GEN(buf)>meshgen){
meshgen++;
if(meshgen)
meshgen++;
else
meshgen=MO_GEN(buf);
_timet=0;
continue;
};
if(MO_TYPE(buf)=='T'){
time_t toff=MO_TIME(buf)-(getTimer()*SYSTICKSPEED/1000);
time_t toff=MO_TIME(buf)-((getTimer()-(200/SYSTICKSPEED))/(1000/SYSTICKSPEED));
if (toff>_timet) // Do not live in the past.
_timet = toff;
continue;