aboutsummaryrefslogtreecommitdiff
path: root/app.cpp
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-07-25 06:21:11 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2015-07-25 19:37:44 +0200
commita64156388fc92da1d151a1094e25d9d89240bb38 (patch)
treef65eb7c8b4d7dccb400b67ebc7b82e861ffec13c /app.cpp
parent77e261f12089bd7db854d21fc81a42eaa60e0b67 (diff)
downloadtrygvisio_soil_moisture-a64156388fc92da1d151a1094e25d9d89240bb38.tar.gz
trygvisio_soil_moisture-a64156388fc92da1d151a1094e25d9d89240bb38.tar.bz2
trygvisio_soil_moisture-a64156388fc92da1d151a1094e25d9d89240bb38.tar.xz
trygvisio_soil_moisture-a64156388fc92da1d151a1094e25d9d89240bb38.zip
o Cleaning up #if usage and config.h.
Diffstat (limited to 'app.cpp')
-rw-r--r--app.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/app.cpp b/app.cpp
index e347b46..aef96d7 100644
--- a/app.cpp
+++ b/app.cpp
@@ -1,5 +1,6 @@
#include "app.h"
#include "Debug.h"
+#include "config-check.h"
#include <EEPROM.h>
@@ -8,7 +9,7 @@
#elif SM_BOARD_VERSION == 2
#define SENSOR_COUNT 4
#else
-#error "SM_BOARD_VERSION must be set. See config.h"
+#error "SM_BOARD_VERSION must be set to a valid value. See config-check.h"
#endif
#define LED_PIN 13
@@ -138,7 +139,7 @@ void sm_loop() {
}
}
-#ifdef SM_DEBUG == 1
+#if SM_DEBUG
static void write_name(uint8_t const* name, uint8_t len) {
for (int i = 0; i < len; i++) {
@@ -258,7 +259,7 @@ void on_soil_moisture_ctrl(uint8_t *data, uint8_t len) {
struct sm_res res;
uint8_t sensor;
-#if SM_DEBUG == 1
+#if SM_DEBUG
write_req(*req);
#endif
@@ -361,7 +362,7 @@ void on_soil_moisture_ctrl(uint8_t *data, uint8_t len) {
notify_soil_moisture(res, body_len);
}
-#if PERSISTENT_CONFIGURATION_SUPPORT == 1
+#ifdef PERSISTENT_CONFIGURATION_SUPPORT
static int store_string(int index, uint8_t len, char *chars) {
EEPROM.write(index++, len);