Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/classes/IoTScenario.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,13 +709,6 @@ int IoTScenario::gettok() {
}

NumStr = "";
if (LastChar == '-') {
LastChar = getLastChar();
if (isdigit(LastChar))
NumStr = "-";
else
return '-';
}
if (isdigit(LastChar)) { // Число: [0-9.]+
do {
NumStr += (char)LastChar;
Expand Down Expand Up @@ -1009,6 +1002,12 @@ ExprAST *IoTScenario::ParsePrimary(String *IDNames, bool callFromCondition) {
return ParseQuotesExpr();
case tok_if:
return ParseIfExpr(IDNames);
case '-': {
getNextToken();
ExprAST *Operand = ParsePrimary(IDNames, callFromCondition);
if (!Operand) return nullptr;
return new BinaryExprAST('-', new NumberExprAST("0"), Operand);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/modules/sensors/AnalogAdc/AnalogAdc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class AnalogAdc : public IoTItem
//Serial.print("adcAverage = " + String(_adcAverage) + " \t");
//Serial.println("realSteps = " + String(realSteps));
realSteps = 0;
_adcAverage = 0;
}
regEvent(value.valD, "AnalogAdc"); // обязательный вызов хотяб один
}
Expand Down