diff options
-rw-r--r-- | src/FilamentMonitors/LaserFilamentMonitor.cpp | 6 | ||||
-rw-r--r-- | src/FilamentMonitors/RotatingMagnetFilamentMonitor.cpp | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/FilamentMonitors/LaserFilamentMonitor.cpp b/src/FilamentMonitors/LaserFilamentMonitor.cpp index d20d8adf..aa68eb8d 100644 --- a/src/FilamentMonitors/LaserFilamentMonitor.cpp +++ b/src/FilamentMonitors/LaserFilamentMonitor.cpp @@ -125,6 +125,11 @@ GCodeResult LaserFilamentMonitor::Configure(GCodeBuffer& gb, const StringRef& re const GCodeResult rslt = CommonConfigure(gb, reply, InterruptMode::change, seen); if (rslt <= GCodeResult::warning) { + if (seen) + { + Init(); // Init() resets dataReceived and version, so only do it if the port has been configured + } + gb.TryGetFValue('L', calibrationFactor, seen); gb.TryGetFValue('E', minimumExtrusionCheckLength, seen); @@ -158,7 +163,6 @@ GCodeResult LaserFilamentMonitor::Configure(GCodeBuffer& gb, const StringRef& re if (seen) { - Init(); reprap.SensorsUpdated(); } else diff --git a/src/FilamentMonitors/RotatingMagnetFilamentMonitor.cpp b/src/FilamentMonitors/RotatingMagnetFilamentMonitor.cpp index 2957411d..df8e65b8 100644 --- a/src/FilamentMonitors/RotatingMagnetFilamentMonitor.cpp +++ b/src/FilamentMonitors/RotatingMagnetFilamentMonitor.cpp @@ -127,6 +127,11 @@ GCodeResult RotatingMagnetFilamentMonitor::Configure(GCodeBuffer& gb, const Stri const GCodeResult rslt = CommonConfigure(gb, reply, InterruptMode::change, seen); if (rslt <= GCodeResult::warning) { + if (seen) + { + Init(); // Init() resets dataReceived and version, so only do it if the port has been configured + } + gb.TryGetFValue('L', mmPerRev, seen); gb.TryGetFValue('E', minimumExtrusionCheckLength, seen); @@ -160,7 +165,6 @@ GCodeResult RotatingMagnetFilamentMonitor::Configure(GCodeBuffer& gb, const Stri if (seen) { - Init(); reprap.SensorsUpdated(); } else |