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>
pull/4527/head
Power Li 2024-08-28 05:26:02 +08:00 zatwierdzone przez Kevin Hester
rodzic e3ce3a3a4f
commit cc93df27a5
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

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