timekeeper.cpp: fix compiler warnings

This commit is contained in:
cyberman54 2022-03-02 09:14:57 +01:00
parent 22daa95b53
commit 7d70b0d024

View File

@ -33,9 +33,6 @@ void setTimeSyncIRQ() { xTaskNotify(irqHandlerTask, TIMESYNC_IRQ, eSetBits); }
void calibrateTime(void) { void calibrateTime(void) {
time_t t = 0;
uint16_t t_msec = 0;
// kick off asynchronous lora timesync if we have // kick off asynchronous lora timesync if we have
#if (HAS_LORA_TIME) #if (HAS_LORA_TIME)
timesync_request(); timesync_request();
@ -43,6 +40,10 @@ void calibrateTime(void) {
return; return;
#endif #endif
#if ((HAS_GPS) || (HAS_RTC))
time_t t = 0;
uint16_t t_msec = 0;
// get GPS time, if we have // get GPS time, if we have
#if (HAS_GPS) #if (HAS_GPS)
t = get_gpstime(&t_msec); t = get_gpstime(&t_msec);
@ -57,6 +58,8 @@ void calibrateTime(void) {
return; return;
#endif #endif
#endif
} // calibrateTime() } // calibrateTime()
// set system time (UTC), calibrate RTC and RTC_INT pps // set system time (UTC), calibrate RTC and RTC_INT pps
@ -250,9 +253,7 @@ void clock_init(void) {
void clock_loop(void *taskparameter) { // ClockTask void clock_loop(void *taskparameter) { // ClockTask
uint64_t ClockPulse = 0;
uint32_t current_time = 0, previous_time = 0; uint32_t current_time = 0, previous_time = 0;
int8_t ClockMinute = -1;
time_t tt; time_t tt;
struct tm t = {0}; struct tm t = {0};
#ifdef HAS_TWO_LED #ifdef HAS_TWO_LED
@ -292,6 +293,9 @@ void clock_loop(void *taskparameter) { // ClockTask
#elif defined HAS_DCF77 #elif defined HAS_DCF77
uint64_t ClockPulse = 0;
int8_t ClockMinute = -1;
// load new frame if second 59 is reached // load new frame if second 59 is reached
if (t.tm_sec == 0) { if (t.tm_sec == 0) {
ClockMinute = t.tm_min; ClockMinute = t.tm_min;