summaryrefslogtreecommitdiff
path: root/fw/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'fw/app/src')
-rw-r--r--fw/app/src/syslog.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fw/app/src/syslog.c b/fw/app/src/syslog.c
index edc2839..e19a196 100644
--- a/fw/app/src/syslog.c
+++ b/fw/app/src/syslog.c
@@ -14,7 +14,10 @@
#include <zephyr/logging/log_ctrl.h>
#include <zephyr/logging/log_core.h>
#include <zephyr/net/conn_mgr_connectivity.h>
+
+#ifdef CONFIG_IOT_CONTACT_NETWORK_HACK
#include <zephyr/sys/reboot.h>
+#endif // CONFIG_IOT_CONTACT_NETWORK_HACK
LOG_MODULE_REGISTER(syslog);
@@ -58,12 +61,17 @@ int init_syslog(void)
LOG_DBG("Initializing syslog logging backend");
LOG_INF("Waiting for network ...");
+
+#ifdef CONFIG_IOT_CONTACT_NETWORK_HACK
int ret = k_sem_take(&network_connected, NETWORK_BUG_DELAY);
if (ret == -EAGAIN) {
LOG_ERR("Could not connect to network - rebooting system");
log_flush();
sys_reboot(SYS_REBOOT_COLD);
}
+#else
+ k_sem_take(&network_connected, K_FOREVER);
+#endif // CONFIG_IOT_CONTACT_NETWORK_HACK
LOG_INF("Enabling syslog backend");
const struct log_backend *backend = log_backend_net_get();