Skip to content

Commit

Permalink
set current time to system time in portduino build (#4556)
Browse files Browse the repository at this point in the history
* set current time to system time in portduino build

* fix includes order

---------

Co-authored-by: Jonathan Bennett <[email protected]>
  • Loading branch information
pccr10001 and jp-bennett authored Aug 27, 2024
1 parent ada61ae commit ab62590
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/platform/portduino/PortduinoGlue.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "CryptoEngine.h"
#include "PortduinoGPIO.h"
#include "RTC.h"
#include "SPIChip.h"
#include "mesh/RF95Interface.h"
#include "sleep.h"
Expand Down Expand Up @@ -370,6 +371,12 @@ void portduinoSetup()
exit(EXIT_FAILURE);
}
}

struct timeval tv;
tv.tv_sec = time(NULL);
tv.tv_usec = 0;
perhapsSetRTC(RTCQualityNTP, &tv);

return;
}

Expand Down

0 comments on commit ab62590

Please sign in to comment.