aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-01-18 00:07:53 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-01-18 00:07:53 +0100
commitadf4a4421c93d90bde644e7651c11f2edb5a4a38 (patch)
tree432eaaa252234adb35e822d5918bb126de5f8dd2
parenta50f58aed59d325dc73da795df2a5cf4253c171f (diff)
downloadtrygvisio_soil_moisture-adf4a4421c93d90bde644e7651c11f2edb5a4a38.tar.gz
trygvisio_soil_moisture-adf4a4421c93d90bde644e7651c11f2edb5a4a38.tar.bz2
trygvisio_soil_moisture-adf4a4421c93d90bde644e7651c11f2edb5a4a38.tar.xz
trygvisio_soil_moisture-adf4a4421c93d90bde644e7651c11f2edb5a4a38.zip
o Fixing a couple of embarrasing bugs after using arduino-mk.
-rw-r--r--app.cpp11
1 files changed, 4 insertions, 7 deletions
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;
}