diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-11-23 20:57:28 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-11-23 20:57:28 +0300 |
commit | 82ac6acab642c61136c2a77c230047711c296823 (patch) | |
tree | f4c3c639935fb1a193b4d826710f3ec80735b4b9 /src/Heating | |
parent | 8f62d0f52ea82fc6a0325daa97f5ede5203dc980 (diff) |
Support M308 L999 and H999 on expansion boards
Diffstat (limited to 'src/Heating')
-rw-r--r-- | src/Heating/Sensors/RemoteSensor.cpp | 4 | ||||
-rw-r--r-- | src/Heating/Sensors/Thermistor.cpp | 15 |
2 files changed, 13 insertions, 6 deletions
diff --git a/src/Heating/Sensors/RemoteSensor.cpp b/src/Heating/Sensors/RemoteSensor.cpp index 26443d70..1d4e4f7a 100644 --- a/src/Heating/Sensors/RemoteSensor.cpp +++ b/src/Heating/Sensors/RemoteSensor.cpp @@ -28,9 +28,9 @@ RemoteSensor::~RemoteSensor() GCodeResult RemoteSensor::Configure(GCodeBuffer& gb, const StringRef& reply, bool& changed) { TryConfigureSensorName(gb, changed); - CanMessageGenericConstructor cons(M308Params); + CanMessageGenericConstructor cons(M308NewParams); cons.PopulateFromCommand(gb); - const GCodeResult ret = cons.SendAndGetResponse(CanMessageType::m308, boardAddress, reply); + const GCodeResult ret = cons.SendAndGetResponse(CanMessageType::m308New, boardAddress, reply); if ((ret == GCodeResult::ok || ret == GCodeResult::warning) && StringStartsWith(reply.c_str(), "type ")) { // It's just a query for the sensor parameters, so prefix the sensor number and name diff --git a/src/Heating/Sensors/Thermistor.cpp b/src/Heating/Sensors/Thermistor.cpp index 0bed3cf3..4fa8e1e0 100644 --- a/src/Heating/Sensors/Thermistor.cpp +++ b/src/Heating/Sensors/Thermistor.cpp @@ -104,9 +104,9 @@ GCodeResult Thermistor::Configure(GCodeBuffer& gb, const StringRef& reply, bool& if (gb.Seen('L')) { const int lVal = gb.GetIValue(); -#if HAS_VREF_MONITOR if (lVal == 999) { +#if HAS_VREF_MONITOR bool valid; const int32_t val = GetRawReading(valid); if (valid) @@ -140,20 +140,24 @@ GCodeResult Thermistor::Configure(GCodeBuffer& gb, const StringRef& reply, bool& reply.copy("Temperature reading is not valid"); return GCodeResult::error; } +#else + reply.copy("Thermistor input auto calibration is not supported by this hardware"); + return GCodeResult::error; +#endif } else -#endif { adcLowOffset = (int8_t)constrain<int>(lVal, std::numeric_limits<int8_t>::min(), std::numeric_limits<int8_t>::max()); } changed = true; } + if (gb.Seen('H')) { const int hVal = gb.GetIValue(); -#if HAS_VREF_MONITOR if (hVal == 999) { +#if HAS_VREF_MONITOR bool valid; const int32_t val = GetRawReading(valid); if (valid) @@ -197,9 +201,12 @@ GCodeResult Thermistor::Configure(GCodeBuffer& gb, const StringRef& reply, bool& reply.copy("Temperature reading is not valid"); return GCodeResult::error; } +#else + reply.copy("Thermistor input auto calibration is not supported by this hardware"); + return GCodeResult::error; +#endif } else -#endif { adcHighOffset = (int8_t)constrain<int>(hVal, std::numeric_limits<int8_t>::min(), std::numeric_limits<int8_t>::max()); } |