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 05:26:02 +08:00
committed by GitHub
parent ada61ae178
commit ab62590aa9

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;
}