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:
authorChristian Hammacher <bmasterc@gmail.com>2021-07-21 14:50:29 +0300
committerChristian Hammacher <bmasterc@gmail.com>2021-07-21 14:50:29 +0300
commit865e5c8b3d99639b3f978a6434bcaebac89b5b68 (patch)
treebdcab74337a221a71708bd39ae414f0f3fe811e6 /src/Heating
parent72fc1c8ff2be93a31baa7ac57b4e85e4f9533a39 (diff)
parent7bfc38a39b5b094dfa44af65a1bca227eea8bac2 (diff)
Merge remote-tracking branch 'origin/3.4-dev' into v3-chrishamm
Diffstat (limited to 'src/Heating')
-rw-r--r--src/Heating/Heat.cpp16
-rw-r--r--src/Heating/Heat.h3
-rw-r--r--src/Heating/Heater.h1
-rw-r--r--src/Heating/LocalHeater.h1
-rw-r--r--src/Heating/RemoteHeater.h1
5 files changed, 21 insertions, 1 deletions
diff --git a/src/Heating/Heat.cpp b/src/Heating/Heat.cpp
index ed81067d..a7ec0ac9 100644
--- a/src/Heating/Heat.cpp
+++ b/src/Heating/Heat.cpp
@@ -658,6 +658,22 @@ void Heat::SwitchOffAll(bool includingChamberAndBed) noexcept
}
}
+// Turn off all local heaters. Safe to call from an ISR. Called only from the tick ISR.
+void Heat::SwitchOffAllLocalFromISR() noexcept
+{
+ for (Heater* h : heaters)
+ {
+ if (h != nullptr
+#if SUPPORT_CAN_EXPANSION
+ && h->IsLocal()
+#endif
+ )
+ {
+ h->SwitchOff();
+ }
+ }
+}
+
void Heat::Standby(int heater, const Tool *tool) noexcept
{
const auto h = FindHeater(heater);
diff --git a/src/Heating/Heat.h b/src/Heating/Heat.h
index bcd9e2ed..7402eae2 100644
--- a/src/Heating/Heat.h
+++ b/src/Heating/Heat.h
@@ -73,7 +73,8 @@ public:
bool AllHeatersAtSetTemperatures(bool includingBed, float tolerance) const noexcept; // Is everything at temperature within tolerance?
- void SwitchOffAll(bool includingChamberAndBed) noexcept; // Turn all heaters off
+ void SwitchOffAll(bool includingChamberAndBed) noexcept; // Turn all heaters off. Not safe to call from an ISR.
+ void SwitchOffAllLocalFromISR() noexcept; // Turn off all local heaters. Safe to call from an ISR.
void SuspendHeaters(bool sus) noexcept; // Suspend the heaters to conserve power or while probing
GCodeResult ResetFault(int heater, const StringRef& reply) noexcept; // Reset a heater fault for a specific heater or all heaters
diff --git a/src/Heating/Heater.h b/src/Heating/Heater.h
index c5b088b7..fea96985 100644
--- a/src/Heating/Heater.h
+++ b/src/Heating/Heater.h
@@ -50,6 +50,7 @@ public:
virtual void FeedForwardAdjustment(float fanPwmChange, float extrusionChange) noexcept = 0;
#if SUPPORT_CAN_EXPANSION
+ virtual bool IsLocal() const noexcept = 0;
virtual void UpdateRemoteStatus(CanAddress src, const CanHeaterReport& report) noexcept = 0;
virtual void UpdateHeaterTuning(CanAddress src, const CanMessageHeaterTuningReport& msg) noexcept = 0;
#endif
diff --git a/src/Heating/LocalHeater.h b/src/Heating/LocalHeater.h
index db6db03d..c107c2d3 100644
--- a/src/Heating/LocalHeater.h
+++ b/src/Heating/LocalHeater.h
@@ -41,6 +41,7 @@ public:
void FeedForwardAdjustment(float fanPwmChange, float extrusionChange) noexcept override;
#if SUPPORT_CAN_EXPANSION
+ bool IsLocal() const noexcept override { return true; }
void UpdateRemoteStatus(CanAddress src, const CanHeaterReport& report) noexcept override { }
void UpdateHeaterTuning(CanAddress src, const CanMessageHeaterTuningReport& msg) noexcept override { }
#endif
diff --git a/src/Heating/RemoteHeater.h b/src/Heating/RemoteHeater.h
index 0391426b..67bd8eb3 100644
--- a/src/Heating/RemoteHeater.h
+++ b/src/Heating/RemoteHeater.h
@@ -30,6 +30,7 @@ public:
float GetAccumulator() const noexcept override; // Return the integral accumulator
void Suspend(bool sus) noexcept override; // Suspend the heater to conserve power or while doing Z probing
void FeedForwardAdjustment(float fanPwmChange, float extrusionChange) noexcept override;
+ bool IsLocal() const noexcept override { return false; }
void UpdateRemoteStatus(CanAddress src, const CanHeaterReport& report) noexcept override;
void UpdateHeaterTuning(CanAddress src, const CanMessageHeaterTuningReport& msg) noexcept override;