From 2117d966a451e4b5be5f4d0e822cabe625d39316 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Mon, 29 Jan 2024 20:36:46 +0800 Subject: [PATCH] update --- src/znordic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/znordic.c b/src/znordic.c index 924ec3e..e0cf5da 100644 --- a/src/znordic.c +++ b/src/znordic.c @@ -107,8 +107,9 @@ int16_t znrf_adc_channel_read_val(uint16_t channel) { /******************************************************************************* * RTC * *******************************************************************************/ +#define DEFAULT_TIME (1704038400 + 8 * 60 * 60) // 2024/01/01/00:00:00 volatile uint32_t g_timestamp = 0; -volatile uint32_t g_power_on_rtc = 1704038400; // 2024/01/01/00:00:00 +volatile uint32_t g_power_on_rtc = (DEFAULT_TIME); // static uint8_t s_timeCount1second = 0; uint32_t znordic_getpower_on_ms() { @@ -153,7 +154,7 @@ void znordic_rtc_settime(uint16_t year, uint8_t month, uint8_t day, uint8_t uint32_t nowtimestamp = mktime(&s_tm); uint32_t tosettime = nowtimestamp - znordic_getpower_on_s(); - if (tosettime > 1704038400) { // 2024/01/01/00:00:00 + if (tosettime > DEFAULT_TIME) { // 2024/01/01/00:00:00 g_power_on_rtc = tosettime; } return;