mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-09 21:17:06 +03:00
docu
This commit is contained in:
@@ -25,6 +25,8 @@ static const char *TAG = "sntp";
|
|||||||
|
|
||||||
RTC_DATA_ATTR int boot_count = 0;
|
RTC_DATA_ATTR int boot_count = 0;
|
||||||
|
|
||||||
|
bool setTimeAlwaysOnReboot = true;
|
||||||
|
|
||||||
/* Variable holding number of times ESP32 restarted since first boot.
|
/* Variable holding number of times ESP32 restarted since first boot.
|
||||||
* It is placed into RTC memory using RTC_DATA_ATTR and
|
* It is placed into RTC memory using RTC_DATA_ATTR and
|
||||||
* maintains its value when ESP32 wakes from deep sleep.
|
* maintains its value when ESP32 wakes from deep sleep.
|
||||||
@@ -46,8 +48,8 @@ std::string gettimestring(const char * frm)
|
|||||||
time(&now);
|
time(&now);
|
||||||
localtime_r(&now, &timeinfo);
|
localtime_r(&now, &timeinfo);
|
||||||
// Is time set? If not, tm_year will be (1970 - 1900).
|
// Is time set? If not, tm_year will be (1970 - 1900).
|
||||||
if (timeinfo.tm_year < (2016 - 1900)) {
|
if (setTimeAlwaysOnReboot || (timeinfo.tm_year < (2016 - 1900))) {
|
||||||
ESP_LOGI(TAG, "Time is not set yet. Connecting to WiFi and getting time over NTP.");
|
ESP_LOGI(TAG, "Reboot - Connecting to WiFi and getting time over NTP.");
|
||||||
obtain_time();
|
obtain_time();
|
||||||
// update 'now' variable with current time
|
// update 'now' variable with current time
|
||||||
time(&now);
|
time(&now);
|
||||||
|
|||||||
BIN
images/main.jpg
Normal file
BIN
images/main.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 716 KiB |
BIN
images/size.png
Normal file
BIN
images/size.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 587 KiB |
BIN
images/wiring.png
Normal file
BIN
images/wiring.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 167 KiB |
Reference in New Issue
Block a user