diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-12-18 12:06:29 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-12-18 12:06:29 +0300 |
commit | 0562425411ecde77d87695512b77b3568d07fcd6 (patch) | |
tree | abe343f8c46194709152a0fe1776933c7ed8caf6 /src/FilamentMonitors | |
parent | f7f75b23537708ac293e7e22e5b38a24473d707b (diff) |
Filament monitors can now be deleted usimng M591 D# P0
Also added WatchBuffer debug code to RepRap.cpp
Diffstat (limited to 'src/FilamentMonitors')
-rw-r--r-- | src/FilamentMonitors/FilamentMonitor.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/FilamentMonitors/FilamentMonitor.cpp b/src/FilamentMonitors/FilamentMonitor.cpp index cc2b225d..429e96b7 100644 --- a/src/FilamentMonitors/FilamentMonitor.cpp +++ b/src/FilamentMonitors/FilamentMonitor.cpp @@ -145,6 +145,11 @@ bool FilamentMonitor::IsValid() const noexcept reprap.SensorsUpdated(); } + if (newSensorType == 0) + { + return GCodeResult::ok; // M591 D# P0 just deletes any existing sensor + } + gb.MustSee('C'); // make sure the port name parameter is present sensor = Create(extruder, newSensorType, gb, reply); // create the new sensor if (sensor == nullptr) |