From 654ab768f2de1398637e62816e5bac7a2968f870 Mon Sep 17 00:00:00 2001 From: n0m1s Date: Sat, 11 Jan 2020 21:48:36 +0100 Subject: [PATCH] deactivate the loop() if setup was not ok --- lamp.ino | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lamp.ino b/lamp.ino index e83c9cc..7e8ed8f 100644 --- a/lamp.ino +++ b/lamp.ino @@ -2,6 +2,8 @@ Settings const* settings = NULL; +bool ok = true; + void setup() { Serial.begin(9600); @@ -9,10 +11,15 @@ void setup() { settings = Settings::load("settings.ini"); if(settings == NULL) + { Serial.println(" NOT OK"); + ok = false; + return; + } else Serial.println(" OK"); } void loop() { + if(!ok) {delay(3600000); return;} }