Move the setup stop code to a separate (reusable) function
This commit is contained in:
parent
b7a808eaa3
commit
8f223e8877
@ -97,6 +97,14 @@ send_metrics()
|
||||
server.send(200, "text/plain; version=0.0.4; charset=utf-8", message);
|
||||
}
|
||||
|
||||
void
|
||||
stop()
|
||||
{
|
||||
while (1) {
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
setup()
|
||||
{
|
||||
@ -120,9 +128,7 @@ setup()
|
||||
if (!MDNS.begin(MDNS_NAME)) {
|
||||
Serial.println("Error setting up mDNS responder!");
|
||||
|
||||
while (1) {
|
||||
delay(1000);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
|
||||
server.on("/metrics", HTTP_GET, send_metrics);
|
||||
|
Loading…
Reference in New Issue
Block a user