Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2020-12-09 18:00:01 +0300
committerDavid Crocker <dcrocker@eschertech.com>2020-12-09 18:00:01 +0300
commit7cc102915a85aef371d569e7b6da6fe5bc47ea97 (patch)
treeb458b690b36bf7437834b259e3c7d59abc0cd0cc /src/FilamentMonitors
parentc559e4ef5084e4118e1634872cbcf5c8bbe1cd07 (diff)
Laser & magnetic filament monitors bug fix
If the sensor is not enabled, sensor fault reports and lack of received data no longer pause the print
Diffstat (limited to 'src/FilamentMonitors')
-rw-r--r--src/FilamentMonitors/LaserFilamentMonitor.cpp11
-rw-r--r--src/FilamentMonitors/RotatingMagnetFilamentMonitor.cpp11
2 files changed, 12 insertions, 10 deletions
diff --git a/src/FilamentMonitors/LaserFilamentMonitor.cpp b/src/FilamentMonitors/LaserFilamentMonitor.cpp
index 8e3db8f8..d7d00b20 100644
--- a/src/FilamentMonitors/LaserFilamentMonitor.cpp
+++ b/src/FilamentMonitors/LaserFilamentMonitor.cpp
@@ -350,7 +350,7 @@ FilamentSensorStatus LaserFilamentMonitor::Check(bool isPrinting, bool fromIsr,
extrusionCommandedThisSegment = extrusionCommandedSinceLastSync = movementMeasuredThisSegment = movementMeasuredSinceLastSync = 0.0;
}
- return ret;
+ return (comparisonEnabled) ? ret : FilamentSensorStatus::ok;
}
// Compare the amount commanded with the amount of extrusion measured, and set up for the next comparison
@@ -444,10 +444,11 @@ FilamentSensorStatus LaserFilamentMonitor::Clear() noexcept
Reset(); // call this first so that haveStartBitData and synced are false when we call HandleIncomingData
HandleIncomingData(); // to keep the diagnostics up to date
- return (!dataReceived) ? FilamentSensorStatus::noDataReceived
- : (sensorError) ? FilamentSensorStatus::sensorError
- : ((sensorValue & switchOpenMask) != 0) ? FilamentSensorStatus::noFilament
- : FilamentSensorStatus::ok;
+ return (!comparisonEnabled) ? FilamentSensorStatus::ok
+ : (!dataReceived) ? FilamentSensorStatus::noDataReceived
+ : (sensorError) ? FilamentSensorStatus::sensorError
+ : ((sensorValue & switchOpenMask) != 0) ? FilamentSensorStatus::noFilament
+ : FilamentSensorStatus::ok;
}
// Print diagnostic info for this sensor
diff --git a/src/FilamentMonitors/RotatingMagnetFilamentMonitor.cpp b/src/FilamentMonitors/RotatingMagnetFilamentMonitor.cpp
index 20f8a32d..5780ee39 100644
--- a/src/FilamentMonitors/RotatingMagnetFilamentMonitor.cpp
+++ b/src/FilamentMonitors/RotatingMagnetFilamentMonitor.cpp
@@ -379,7 +379,7 @@ FilamentSensorStatus RotatingMagnetFilamentMonitor::Check(bool isPrinting, bool
extrusionCommandedThisSegment = extrusionCommandedSinceLastSync = movementMeasuredThisSegment = movementMeasuredSinceLastSync = 0.0;
}
- return ret;
+ return (comparisonEnabled) ? ret : FilamentSensorStatus::ok;
}
// Compare the amount commanded with the amount of extrusion measured, and set up for the next comparison
@@ -477,10 +477,11 @@ FilamentSensorStatus RotatingMagnetFilamentMonitor::Clear() noexcept
Reset(); // call this first so that haveStartBitData and synced are false when we call HandleIncomingData
HandleIncomingData(); // to keep the diagnostics up to date
- return (!dataReceived) ? FilamentSensorStatus::noDataReceived
- : (sensorError) ? FilamentSensorStatus::sensorError
- : ((sensorValue & switchOpenMask) != 0) ? FilamentSensorStatus::noFilament
- : FilamentSensorStatus::ok;
+ return (!comparisonEnabled) ? FilamentSensorStatus::ok
+ : (!dataReceived) ? FilamentSensorStatus::noDataReceived
+ : (sensorError) ? FilamentSensorStatus::sensorError
+ : ((sensorValue & switchOpenMask) != 0) ? FilamentSensorStatus::noFilament
+ : FilamentSensorStatus::ok;
}
// Print diagnostic info for this sensor