Commit 9f6604b1 authored by Eric Duminil's avatar Eric Duminil
Browse files

Headers refactor.

parent e8460aba
Pipeline #3143 passed with stage
in 1 minute and 48 seconds
...@@ -37,8 +37,4 @@ ...@@ -37,8 +37,4 @@
#include "co2_sensor.h" #include "co2_sensor.h"
#include "led_effects.h" #include "led_effects.h"
void keepServicesAlive();
void checkFlashButton();
void checkSerialInput();
#endif #endif
...@@ -122,6 +122,13 @@ void setup() { ...@@ -122,6 +122,13 @@ void setup() {
#endif #endif
} }
/*****************************************************************
* Helper functions *
*****************************************************************/
void keepServicesAlive();
void checkFlashButton();
void checkSerialInput();
/***************************************************************** /*****************************************************************
* Main loop * * Main loop *
*****************************************************************/ *****************************************************************/
......
...@@ -7,9 +7,11 @@ ...@@ -7,9 +7,11 @@
#include "sensor_console.h" #include "sensor_console.h"
#include "src/lib/PubSubClient/src/PubSubClient.h" #include "src/lib/PubSubClient/src/PubSubClient.h"
#include "wifi_util.h" #include "wifi_util.h"
namespace config { namespace config {
extern uint16_t mqtt_sending_interval; // [s] extern uint16_t mqtt_sending_interval; // [s]
} }
namespace mqtt { namespace mqtt {
extern char last_successful_publish[]; extern char last_successful_publish[];
extern bool connected; extern bool connected;
......
...@@ -8,10 +8,11 @@ ...@@ -8,10 +8,11 @@
*/ */
namespace sensor_console { 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 processSerialInput(const byte in_byte);
void runCommand(const char *command); 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 #endif
...@@ -42,8 +42,9 @@ public: ...@@ -42,8 +42,9 @@ public:
Ampel(); Ampel();
}; };
extern Ampel ampel;
//NOTE: Only use seconds() for duration comparison, not timestamps comparison. Otherwise, problems happen when millis roll over. //NOTE: Only use seconds() for duration comparison, not timestamps comparison. Otherwise, problems happen when millis roll over.
#define seconds() (millis() / 1000UL) #define seconds() (millis() / 1000UL)
extern Ampel ampel;
#endif #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