From adf4a4421c93d90bde644e7651c11f2edb5a4a38 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 18 Jan 2015 00:07:53 +0100 Subject: o Fixing a couple of embarrasing bugs after using arduino-mk. --- app.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'app.cpp') diff --git a/app.cpp b/app.cpp index 7c5507a..1a96192 100644 --- a/app.cpp +++ b/app.cpp @@ -18,11 +18,11 @@ struct sm_sensor { uint16_t warning_value; uint16_t update_interval; uint8_t name_length; - uint8_t name[SENSOR_NAME_LEN]; + char name[SENSOR_NAME_LEN]; } sensors[SENSOR_COUNT] = { // A Pin, D1 Pin, D2 Pin, Value, Warning Value, Update Interval, Length of Name, Name - { 8, 3, 5, 0, 10, 0, 9, 'sensor #1'}, - { 10, 11, 12, 0, 10, 0, 9, 'sensor #2'}, + { 8, 3, 5, 0, 10, 0, 9, "Sensor #1"}, + { 10, 11, 12, 0, 10, 0, 9, "Sensor #2"}, }; static unsigned long next_update[SENSOR_COUNT]; @@ -100,8 +100,6 @@ static void write_name(uint8_t const* name, uint8_t len) { } void write_req(struct sm_req const& req) { - int i; - Serial.print(">> "); switch(req.code) { @@ -154,8 +152,6 @@ void write_req(struct sm_req const& req) { } void write_res(struct sm_res const& res) { - int i; - Serial.print("<< "); switch(res.code) { @@ -290,6 +286,7 @@ void on_soil_moisture_ctrl(uint8_t *data, uint8_t len) { break; default: + body_len = 0; res.code = SM_CMD_FAIL; break; } -- cgit v1.2.3