You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

36 lines
675 B

#include "settings.h"
#include "wifi.h"
#include "clock.h"
Settings const* settings = nullptr;
Wifi * wifi = nullptr;
Clock * clk = nullptr;
bool ok = true;
void setup() {
Serial.begin(9600);
Serial.print("\nLoading settings...");
settings = Settings::load("settings.ini");
if(settings == nullptr)
{
Serial.println(" NOT OK");
ok = false;
return;
}
else
Serial.println(" OK");
wifi = new Wifi(settings->wifi);
clk = new Clock(settings->clock);
}
void loop() {
if(!ok) {delay(3600000); return;}
wifi->keep_alive_connection();
if(wifi->is_connected())
clk->internet_update();
}