set current time to system time in portduino build (#4556)

* set current time to system time in portduino build

* fix includes order

---------

Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
This commit is contained in:
Power Li
2024-08-28 11:25:54 -07:00
committed by Kevin Hester
co-authored by Kevin Hester Jonathan Bennett
parent e3ce3a3a4f
commit cc93df27a5
+7
View File
@@ -1,5 +1,6 @@
#include "CryptoEngine.h"
#include "PortduinoGPIO.h"
#include "RTC.h"
#include "SPIChip.h"
#include "mesh/RF95Interface.h"
#include "sleep.h"
@@ -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;
}