Commit 6625ade7 authored by Eric Duminil's avatar Eric Duminil
Browse files

Small changes

parent 22d98cc2
Pipeline #5760 passed with stage
in 2 minutes and 8 seconds
......@@ -12,7 +12,6 @@
*/
#include "ampel-firmware.h"
//TODO: Move as many includes into cpp as possible
/*****************************************************************
* GPL License *
......@@ -96,8 +95,6 @@ void setup() {
});
#endif
void setWifiConnectionFailedCallback(void (*function)());
pinMode(0, INPUT); // Flash button (used for forced calibration)
Serial.println();
......@@ -221,7 +218,7 @@ void checkFlashButton() {
void keepServicesAlive() {
#ifdef AMPEL_WIFI
web_config::update();
if (WiFi.status() == WL_CONNECTED) {
if (wifi::connected()) {
ntp::update(); // NTP client has its own timer. It will connect to NTP server every 60s.
# ifdef AMPEL_MQTT
mqtt::keepConnection(); // MQTT client has its own timer. It will keep alive every 15s.
......
......@@ -27,6 +27,10 @@ namespace config {
namespace wifi {
char local_ip[16]; // "255.255.255.255\0"
bool connected() {
return WiFi.status() == WL_CONNECTED;
}
void scanNetworks() {
Serial.println();
Serial.println(F("WiFi - Scanning..."));
......
......@@ -4,6 +4,7 @@
namespace wifi {
extern char local_ip[16];
void defineCommands();
bool connected();
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment