From 32c6dcfbd757a431f2ac46c0a4cbe8b6000ae63c Mon Sep 17 00:00:00 2001 From: fvanroie <15969459+fvanroie@users.noreply.github.com> Date: Wed, 3 Nov 2021 01:34:54 +0100 Subject: [PATCH] Annotate LOG_FATAL --- src/hasp/hasp_dispatch.cpp | 4 +--- src/sys/net/hasp_wifi.cpp | 10 ++-------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/hasp/hasp_dispatch.cpp b/src/hasp/hasp_dispatch.cpp index 95953d92..05840c2e 100644 --- a/src/hasp/hasp_dispatch.cpp +++ b/src/hasp/hasp_dispatch.cpp @@ -1264,9 +1264,7 @@ void dispatch_service(const char*, const char* payload, uint8_t source) static void dispatch_add_command(const char* p_cmdstr, void (*func)(const char*, const char*, uint8_t)) { if(nCommands >= sizeof(commands) / sizeof(haspCommand_t)) { - LOG_FATAL(TAG_MSGR, F("CMD_OVERFLOW %d"), nCommands); - while(1) { - } + LOG_FATAL(TAG_MSGR, F("CMD_OVERFLOW %d"), nCommands); // Needs to be in curly braces } else { commands[nCommands].p_cmdstr = p_cmdstr; commands[nCommands].func = func; diff --git a/src/sys/net/hasp_wifi.cpp b/src/sys/net/hasp_wifi.cpp index 0276d99c..fb97399f 100644 --- a/src/sys/net/hasp_wifi.cpp +++ b/src/sys/net/hasp_wifi.cpp @@ -433,17 +433,11 @@ void wifiSetup() // check for the presence of the shield: if(WiFiSpi.status() == WL_NO_SHIELD) { - LOG_FATAL(TAG_WIFI, F("WiFi shield not present")); - // don't continue: - while(true) - ; + LOG_FATAL(TAG_WIFI, F("WiFi shield not present")); // Needs to be in curly braces } if(!WiFiSpi.checkProtocolVersion()) { - LOG_FATAL(TAG_WIFI, F("Protocol version mismatch. Please upgrade the firmware")); - // don't continue: - while(true) - ; + LOG_FATAL(TAG_WIFI, F("Protocol version mismatch. Please upgrade the firmware")); // Needs to be in curly braces } // attempt to connect to Wifi network