update time calculation
@@ -382,9 +382,6 @@ public:
uint32_t offset = hardware_.time() - rt_time;
t.deserialize(data);
-
- // SerialBT2.print(t.data.sec); SerialBT2.print(" "); SerialBT2.println(t.data.nsec);
-
t.data.sec += offset / 1000;
t.data.nsec += (offset % 1000) * 1000000UL;
@@ -405,8 +402,8 @@ public:
void setNow(Time & new_now)
{
uint32_t ms = hardware_.time();
- sec_offset = new_now.sec;// - ms / 1000 - 1;
- nsec_offset = new_now.nsec;// - (ms % 1000) * 1000000UL + 1000000000UL;
+ sec_offset = new_now.sec;
+ nsec_offset = new_now.nsec;
normalizeSecNSec(sec_offset, nsec_offset);
}
