diff --git a/ampel-firmware/ampel-firmware.h b/ampel-firmware/ampel-firmware.h index 629e180f589ec0fd08a9e6b0b64ccbf87dcce76a..41fe46bd593aa82a1a3c133e08f1fabe88e7b490 100644 --- a/ampel-firmware/ampel-firmware.h +++ b/ampel-firmware/ampel-firmware.h @@ -37,8 +37,4 @@ #include "co2_sensor.h" #include "led_effects.h" -void keepServicesAlive(); -void checkFlashButton(); -void checkSerialInput(); - #endif diff --git a/ampel-firmware/ampel-firmware.ino b/ampel-firmware/ampel-firmware.ino index df16f22c271ec34490249651afde879be634aa12..8d04504665e014bd52e1d66f38c0e14864d2fc9e 100644 --- a/ampel-firmware/ampel-firmware.ino +++ b/ampel-firmware/ampel-firmware.ino @@ -122,6 +122,13 @@ void setup() { #endif } +/***************************************************************** + * Helper functions * + *****************************************************************/ +void keepServicesAlive(); +void checkFlashButton(); +void checkSerialInput(); + /***************************************************************** * Main loop * *****************************************************************/ diff --git a/ampel-firmware/mqtt.h b/ampel-firmware/mqtt.h index fb769d66ccddf6a3c390c2e976c52de5717564a6..4d1088345f061646e9c05fb95e378fbe7feec252 100644 --- a/ampel-firmware/mqtt.h +++ b/ampel-firmware/mqtt.h @@ -7,9 +7,11 @@ #include "sensor_console.h" #include "src/lib/PubSubClient/src/PubSubClient.h" #include "wifi_util.h" + namespace config { extern uint16_t mqtt_sending_interval; // [s] } + namespace mqtt { extern char last_successful_publish[]; extern bool connected; diff --git a/ampel-firmware/sensor_console.h b/ampel-firmware/sensor_console.h index e15241416c4ca45d6ad83992cf9609af51f0dc43..b46e212e06c308e15ba7497509c33ffd104932ad 100644 --- a/ampel-firmware/sensor_console.h +++ b/ampel-firmware/sensor_console.h @@ -8,10 +8,11 @@ */ namespace sensor_console { + void defineCommand(const char *command, void (*function)(void), const __FlashStringHelper *ifsh); + void defineIntCommand(const char *command, void (*function)(int32_t), const __FlashStringHelper *ifsh); + void processSerialInput(const byte in_byte); void runCommand(const char *command); - void defineIntCommand(const char *command, void (*function)(int32_t), const __FlashStringHelper *ifsh); - void defineCommand(const char *command, void (*function)(void), const __FlashStringHelper *ifsh); } #endif diff --git a/ampel-firmware/util.h b/ampel-firmware/util.h index a2673331e320174cba430c03c0bbf31caa68da06..093cf28ab8034ca8fe33bc3c7038f611bccd7726 100644 --- a/ampel-firmware/util.h +++ b/ampel-firmware/util.h @@ -42,8 +42,9 @@ public: Ampel(); }; +extern Ampel ampel; + //NOTE: Only use seconds() for duration comparison, not timestamps comparison. Otherwise, problems happen when millis roll over. #define seconds() (millis() / 1000UL) -extern Ampel ampel; #endif