makers-for-life / makair

🫁 The world's first open-source ventilator tested on human patients. Mass-producible at a low cost (~2000€).
Other
818 stars 78 forks source link

Control: use systick field of messages instead of getting a local time #196

Closed BlackYoup closed 4 years ago

BlackYoup commented 4 years ago

All time has been switched to UTC if we ever want to manipulate it later. Because we do not display the date on the graph, that's ok for now.

We also guess the boot time if we do not have one yet based on the last systick we received. There are chances we miss the BootMessage (the telemetry crate might not open a socket quick enough to catch it or our program might crash or been restarted). If we ever receive a systick lower than our last one, we reset our state.