Closed elcojacobs closed 9 years ago
This is fixed in: https://github.com/BrewPi/firmware/compare/cb4ae685101d17adde08fda7942d373f170f55a9...8807f2efe1d39e467bc8123e7919e948e709d297
String conversion functions now return bool and take a pointer to temperature as argument. The temperature is not written if the string is invalid, avoiding the need to write to an intermediate value:
if(stringToTempDiff(target, value)){
eepromManager.storeTempConstantsAndSettings(); // value parsed correctly
}
Also introduced DISABLED_TEMP in addition to invalid temp to indicate a disabled setpoint independent of mode.
Merged in 0.2.9
The strings that are received over serial for setpoints and other settings are not error checked.
atol
just returns 0 on error, which is indistinguishable fromatol("0")
.By using
strtol
instead, we can check the end pointer after the function and handle parse errors.