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>2021-08-26 11:21:56 +0300
committerDavid Crocker <dcrocker@eschertech.com>2021-08-26 11:21:56 +0300
commit7b470f4af01019dc0bb3b4dce6843310ab36d38e (patch)
tree87caa68b8eb9214c6be040361e0444f031a9a088 /src/GCodes
parenta10282cfaa62b225ce9f96291459ee87d690334d (diff)
Refactored PS_ON handling
Diffstat (limited to 'src/GCodes')
-rw-r--r--src/GCodes/GCodes.cpp4
-rw-r--r--src/GCodes/GCodes.h2
-rw-r--r--src/GCodes/GCodes2.cpp6
3 files changed, 4 insertions, 8 deletions
diff --git a/src/GCodes/GCodes.cpp b/src/GCodes/GCodes.cpp
index 9a0c9c0b..4b8ae502 100644
--- a/src/GCodes/GCodes.cpp
+++ b/src/GCodes/GCodes.cpp
@@ -68,7 +68,7 @@ GCodes::GCodes(Platform& p) noexcept :
#if HAS_VOLTAGE_MONITOR
, powerFailScript(nullptr)
#endif
- , isFlashing(false), isFlashingPanelDue(false), lastFilamentError(FilamentSensorStatus::ok), lastWarningMillis(0), atxPowerControlled(false)
+ , isFlashing(false), isFlashingPanelDue(false), lastFilamentError(FilamentSensorStatus::ok), lastWarningMillis(0)
#if HAS_MASS_STORAGE
, sdTimingFile(nullptr)
#endif
@@ -4900,7 +4900,7 @@ void GCodes::CheckHeaterFault() noexcept
case HeaterFaultState::stopping:
if (millis() - heaterFaultTime >= 1000) // wait 1 second for the message to be picked up by DWC and PanelDue
{
- platform.AtxPowerOff(false);
+ platform.AtxPowerOff();
heaterFaultState = HeaterFaultState::stopped;
}
break;
diff --git a/src/GCodes/GCodes.h b/src/GCodes/GCodes.h
index 255ac57b..c3ce1099 100644
--- a/src/GCodes/GCodes.h
+++ b/src/GCodes/GCodes.h
@@ -211,7 +211,6 @@ public:
void SetMappedFanSpeed(float f) noexcept; // Set the speeds of fans mapped for the current tool
void HandleReply(GCodeBuffer& gb, GCodeResult rslt, const char *reply) noexcept; // Handle G-Code replies
void EmergencyStop() noexcept; // Cancel everything
- bool AtxPowerControlled() const noexcept { return atxPowerControlled; }
const GridDefinition& GetDefaultGrid() const { return defaultGrid; }; // Get the default grid definition
bool AssignGrid(const char axesLetters[2], const float axis0Range[2], const float axis1Range[2], float radius, float spacing[2]) noexcept; // Assign the heightmap using the given parameters
@@ -689,7 +688,6 @@ private:
// Misc
uint32_t lastWarningMillis; // When we last sent a warning message for things that can happen very often
AxesBitmap axesToSenseLength; // The axes on which we are performing axis length sensing
- bool atxPowerControlled;
#if HAS_MASS_STORAGE
static constexpr uint32_t SdTimingByteIncrement = 8 * 1024; // how many timing bytes we write at a time
diff --git a/src/GCodes/GCodes2.cpp b/src/GCodes/GCodes2.cpp
index 3c4b954c..9e3553be 100644
--- a/src/GCodes/GCodes2.cpp
+++ b/src/GCodes/GCodes2.cpp
@@ -1271,17 +1271,15 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeEx
break;
case 80: // ATX power on
- atxPowerControlled = true;
- platform.AtxPowerOn();
+ result = platform.HandleM80(gb, reply);
break;
case 81: // ATX power off
- atxPowerControlled = true;
if (!LockMovementAndWaitForStandstill(gb))
{
return false;
}
- platform.AtxPowerOff(gb.Seen('S') && gb.GetUIValue() != 0);
+ result = platform.HandleM81(gb, reply);
break;
case 82: // Use absolute extruder positioning