2014-02-19 08:43:15 +01:00
|
|
|
#include "ThermometerPro.h"
|
|
|
|
|
2014-02-23 21:12:13 +01:00
|
|
|
#include "cmd.h"
|
|
|
|
#include "uptime.h"
|
2014-02-25 17:32:23 +01:00
|
|
|
#include "thermometer.h"
|
2014-03-04 19:08:19 +01:00
|
|
|
#include "Config.h"
|
2014-03-05 18:57:08 +01:00
|
|
|
#include "spi.h"
|
|
|
|
|
|
|
|
|
|
|
|
// #define ENABLE_CONFIGURATION_INVALID_CMD 1
|
2014-02-23 21:12:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
static CmdServer cmdServer(&Serial);
|
2014-03-05 18:57:08 +01:00
|
|
|
#ifdef ENABLE_CONFIGURATION_INVALID_CMD
|
|
|
|
static ConfigInvalidateCmd configInvalidateCmd;
|
|
|
|
#endif
|
2014-02-23 21:12:13 +01:00
|
|
|
static Uptime uptime;
|
2014-02-25 17:32:23 +01:00
|
|
|
static Thermometer thermometer;
|
2014-02-23 21:12:13 +01:00
|
|
|
|
|
|
|
|
2014-02-19 08:43:15 +01:00
|
|
|
void setup() {
|
2014-03-08 00:23:46 +01:00
|
|
|
Serial.begin(9600);
|
|
|
|
|
2014-03-08 20:32:38 +01:00
|
|
|
|
|
|
|
Config::initialize();
|
|
|
|
|
|
|
|
|
2014-03-05 18:57:08 +01:00
|
|
|
spiInit();
|
|
|
|
|
2014-02-23 21:12:13 +01:00
|
|
|
cmdServer.begin();
|
2014-03-05 18:57:08 +01:00
|
|
|
#ifdef ENABLE_CONFIGURATION_INVALID_CMD
|
2014-03-04 19:08:19 +01:00
|
|
|
configInvalidateCmd.registerYourself(&cmdServer);
|
2014-03-05 18:57:08 +01:00
|
|
|
#endif
|
2014-02-23 21:12:13 +01:00
|
|
|
uptime.begin(&cmdServer);
|
2014-02-25 17:32:23 +01:00
|
|
|
thermometer.begin(&cmdServer);
|
2014-02-20 23:33:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-02-19 08:43:15 +01:00
|
|
|
void loop() {
|
2014-02-23 21:12:13 +01:00
|
|
|
cmdServer.exec();
|
|
|
|
uptime.exec();
|
2014-02-25 17:32:23 +01:00
|
|
|
thermometer.exec();
|
2014-02-19 08:43:15 +01:00
|
|
|
}
|