PowerMeter: Whitespace and {} fixes
This commit is contained in:
parent
00def1d8d1
commit
19b2dd4c7a
@ -58,7 +58,7 @@ void PowerMeterClass::init()
|
|||||||
HttpPowerMeter.init();
|
HttpPowerMeter.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(config.PowerMeter_Source == SOURCE_SML) {
|
if (config.PowerMeter_Source == SOURCE_SML) {
|
||||||
pinMode(SML_RX_PIN, INPUT);
|
pinMode(SML_RX_PIN, INPUT);
|
||||||
inputSerial.begin(9600, SWSERIAL_8N1, SML_RX_PIN, -1, false, 128, 95);
|
inputSerial.begin(9600, SWSERIAL_8N1, SML_RX_PIN, -1, false, 128, 95);
|
||||||
inputSerial.enableRx(true);
|
inputSerial.enableRx(true);
|
||||||
@ -184,14 +184,16 @@ bool PowerMeterClass::smlReadLoop()
|
|||||||
unsigned char smlCurrentChar = inputSerial.read();
|
unsigned char smlCurrentChar = inputSerial.read();
|
||||||
sml_states_t smlCurrentState = smlState(smlCurrentChar);
|
sml_states_t smlCurrentState = smlState(smlCurrentChar);
|
||||||
if (smlCurrentState == SML_LISTEND) {
|
if (smlCurrentState == SML_LISTEND) {
|
||||||
for(auto& handler: smlHandlerList) {
|
for (auto& handler: smlHandlerList) {
|
||||||
if (smlOBISCheck(handler.OBIS)) {
|
if (smlOBISCheck(handler.OBIS)) {
|
||||||
handler.Fn(readVal);
|
handler.Fn(readVal);
|
||||||
*handler.Arg = readVal;
|
*handler.Arg = readVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (smlCurrentState == SML_FINAL)
|
} else if (smlCurrentState == SML_FINAL) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user