better blink

This commit is contained in:
2021-03-03 19:16:22 +01:00
parent fe1bc101a3
commit 6611220851
4 changed files with 18 additions and 3 deletions

View File

@ -3,6 +3,7 @@
#include <iwdg.h>
#include <logger.h>
#include <sinkStruct.h>
#include <show.h>
#include <config.h>
#include <networkAbstractionLayer_impl.h>
@ -28,6 +29,7 @@ static void networkSecondsHandler(void *handle) {
seconds.seconds = tmpSeconds;
seconds.missedUpdates = 0;
seconds.valid = true;
show(LED_GREEN, ON);
} else {
coloredMsg(LOG_YELLOW, "nsh, failed");
seconds.missedUpdates += 1;
@ -39,6 +41,7 @@ static void networkSecondsHandler(void *handle) {
coloredMsg(LOG_YELLOW, "nsh, success, network time is %lu", tmpSeconds);
seconds.missedUpdates = 0;
tryAgain = false;
show(LED_GREEN, ON);
if (seconds.seconds != tmpSeconds) {
coloredMsg(LOG_YELLOW, "nsh, local time updated");
seconds.seconds = tmpSeconds;