-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af72def
commit bc56407
Showing
6 changed files
with
106 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/** | ||
* Marlin 3D Printer Firmware | ||
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] | ||
* | ||
* Based on Sprinter and grbl. | ||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
/** | ||
* gcode/temp/M86-M87.cpp | ||
* | ||
* Hotend Idle Timeout | ||
*/ | ||
|
||
#include "../../inc/MarlinConfigPre.h" | ||
|
||
#if ENABLED(HOTEND_IDLE_TIMEOUT) | ||
|
||
#include "../gcode.h" | ||
#include "../../feature/hotend_idle.h" | ||
|
||
void GcodeSuite::M86_report(const bool forReplay/*=true*/) { | ||
report_heading(forReplay, F("Hotend Idle Timeout")); | ||
SERIAL_ECHOLNPGM(" M86" | ||
" B", hotend_idle.bed_target | ||
, " E", hotend_idle.nozzle_target | ||
, " S", hotend_idle.timeout | ||
, " T", hotend_idle.trigger | ||
); | ||
} | ||
|
||
/** | ||
* M86: Set / Report Hotend Idle Timeout | ||
* | ||
* Parameters | ||
* S<seconds> : Idle timeout. Set to 0 to disable. | ||
* E<temp> : Extruder idle temperature to set on timeout | ||
* B<temp> : Bed idle temperature to set on timeout | ||
* T<temp> : Minimum extruder temperature to consider for timeout (> idle temperature) | ||
*/ | ||
void GcodeSuite::M86() { | ||
if (!parser.seen_any()) return M86_report(); | ||
if (parser.seenval('S')) hotend_idle.timeout = parser.value_ushort(); | ||
if (parser.seenval('T')) hotend_idle.trigger = parser.value_celsius(); | ||
if (parser.seenval('E')) hotend_idle.nozzle_target = parser.value_celsius(); | ||
if (parser.seenval('B')) hotend_idle.bed_target = parser.value_celsius(); | ||
const celsius_t min_trigger = hotend_idle.nozzle_target + TEMP_HYSTERESIS; | ||
if (hotend_idle.trigger <= min_trigger) | ||
SERIAL_ECHOLNPGM("?Idle Timeout (T) trigger temperature should be over ", min_trigger, "C."); | ||
} | ||
|
||
/** | ||
* M86: Cancel Hotend Idle Timeout (by setting the timeout period to 0) | ||
*/ | ||
void GcodeSuite::M87() { | ||
hotend_idle.timeout = 0; | ||
} | ||
|
||
#endif // HOTEND_IDLE_TIMEOUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters