From d08867986e02982148759072986ead1da693dc30 Mon Sep 17 00:00:00 2001 From: Florian Heilmann Date: Mon, 14 Nov 2016 11:29:45 +0100 Subject: [PATCH] Add autotemp capabilities to M104 This allows M104 to pass the F and B parameters to enable autotemp as well --- Marlin/Marlin_main.cpp | 6 +++++- Marlin/planner.cpp | 4 ++-- Marlin/planner.h | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 72f63a4f3..2dd6610f2 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5089,6 +5089,10 @@ inline void gcode_M104() { if (code_value_temp_abs() > thermalManager.degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING); } + + #if ENABLED(AUTOTEMP) + planner.autotemp_M104_M109(); + #endif } #if HAS_TEMP_HOTEND || HAS_TEMP_BED @@ -5284,7 +5288,7 @@ inline void gcode_M109() { } #if ENABLED(AUTOTEMP) - planner.autotemp_M109(); + planner.autotemp_M104_M109(); #endif #if TEMP_RESIDENCY_TIME > 0 diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 6daa22d2b..ab03d9fe3 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -1361,7 +1361,7 @@ void Planner::refresh_positioning() { #if ENABLED(AUTOTEMP) - void Planner::autotemp_M109() { + void Planner::autotemp_M104_M109() { autotemp_enabled = code_seen('F'); if (autotemp_enabled) autotemp_factor = code_value_temp_diff(); if (code_seen('S')) autotemp_min = code_value_temp_abs(); @@ -1379,4 +1379,4 @@ void Planner::refresh_positioning() { SERIAL_EOL; } -#endif \ No newline at end of file +#endif diff --git a/Marlin/planner.h b/Marlin/planner.h index 251dd6bea..8b8d49865 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -372,7 +372,7 @@ class Planner { static float autotemp_factor; static bool autotemp_enabled; static void getHighESpeed(); - static void autotemp_M109(); + static void autotemp_M104_M109(); #endif private: