From 23f2e600792e60747755363eb8099525282e1bb9 Mon Sep 17 00:00:00 2001 From: livello Date: Wed, 7 Nov 2018 13:49:30 +0300 Subject: [PATCH] fix flash_64kb error. debugSerial in Item.cpp --- lighthub/item.cpp | 43 ++++++++++++++----------------------------- lighthub/item.h | 2 +- platformio.ini | 1 - 3 files changed, 15 insertions(+), 31 deletions(-) diff --git a/lighthub/item.cpp b/lighthub/item.cpp index 3cf51f5..8e6859c 100644 --- a/lighthub/item.cpp +++ b/lighthub/item.cpp @@ -81,20 +81,10 @@ void Item::Parse() { for (int i = aJson.getArraySize(itemArr); i < 4; i++) aJson.addItemToArray(itemArr, aJson.createItem( int(defval[i]))); //Enlarge item to 4 elements. VAL=int if no other definition in conf - - itemType = aJson.getArrayItem(itemArr, I_TYPE)->valueint; itemArg = aJson.getArrayItem(itemArr, I_ARG); itemVal = aJson.getArrayItem(itemArr, I_VAL); - -/* - Serial.print(F(" Item:")); - Serial.print(itemArr->name); - Serial.print(F(" T:")); - Serial.print(itemType); - Serial.print(F(" =")); - Serial.println(getArg()); - */ + debugSerial << (F(" Item:") << itemArr->name << F(" T:") << itemType << F(" =") << getArg() << eol; } } @@ -117,13 +107,12 @@ uint8_t Item::getCmd(bool ext) { } -void Item::setCmd(uint8_t cmd) { - aJsonObject *t = aJson.getArrayItem(itemArr, I_CMD); - if (t) +void Item::setCmd(uint8_t cmdValue) { + aJsonObject *itemCmd = aJson.getArrayItem(itemArr, I_CMD); + if (itemCmd) { - t->valueint = cmd; - Serial.print(F("SetCmd:")); - Serial.println(cmd); + itemCmd->valueint = cmdValue; + debugSerial<type != aJson_Int) return; - // Serial.print(F(" Store ")); - // Serial.print(F(" Val=")); - // Serial.println(par); + debugSerial<")); - Serial.println(valstr); + debugSerial<")<