From a64156388fc92da1d151a1094e25d9d89240bb38 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 25 Jul 2015 06:21:11 +0200 Subject: o Cleaning up #if usage and config.h. --- app.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'app.cpp') 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 @@ -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); -- cgit v1.2.3