🎨 Define HAS_PREHEAT conditional

This commit is contained in:
Scott Lahteine
2021-10-27 21:15:58 -05:00
committed by Scott Lahteine
parent 1fd4258423
commit 84f9490149
55 changed files with 183 additions and 182 deletions

View File

@ -520,7 +520,7 @@ void GcodeSuite::G26() {
g26.keep_heaters_on = parser.boolval('K');
// Accept 'I' if temperature presets are defined
#if PREHEAT_COUNT
#if HAS_PREHEAT
const uint8_t preset_index = parser.seenval('I') ? _MIN(parser.value_byte(), PREHEAT_COUNT - 1) + 1 : 0;
#endif
@ -530,7 +530,7 @@ void GcodeSuite::G26() {
celsius_t bedtemp = 0;
// Use the 'I' index if temperature presets are defined
#if PREHEAT_COUNT
#if HAS_PREHEAT
if (preset_index) bedtemp = ui.material_preset[preset_index - 1].bed_temp;
#endif
@ -613,7 +613,7 @@ void GcodeSuite::G26() {
celsius_t noztemp = 0;
// Accept 'I' if temperature presets are defined
#if PREHEAT_COUNT
#if HAS_PREHEAT
if (preset_index) noztemp = ui.material_preset[preset_index - 1].hotend_temp;
#endif

View File

@ -640,7 +640,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 120: M120(); break; // M120: Enable endstops
case 121: M121(); break; // M121: Disable endstops
#if PREHEAT_COUNT
#if HAS_PREHEAT
case 145: M145(); break; // M145: Set material heatup parameters
#endif

View File

@ -749,7 +749,7 @@ private:
static void M193();
#endif
#if PREHEAT_COUNT
#if HAS_PREHEAT
static void M145();
static void M145_report(const bool forReplay=true);
#endif

View File

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h"
#if PREHEAT_COUNT
#if HAS_PREHEAT
#include "../gcode.h"
#include "../../lcd/marlinui.h"
@ -79,4 +79,4 @@ void GcodeSuite::M145_report(const bool forReplay/*=true*/) {
}
}
#endif // PREHEAT_COUNT
#endif // HAS_PREHEAT

View File

@ -88,7 +88,7 @@ void GcodeSuite::M104_M109(const bool isM109) {
celsius_t temp = 0;
// Accept 'I' if temperature presets are defined
#if PREHEAT_COUNT
#if HAS_PREHEAT
got_temp = parser.seenval('I');
if (got_temp) {
const uint8_t index = parser.value_byte();

View File

@ -32,7 +32,7 @@
#include "../../module/planner.h"
#endif
#if PREHEAT_COUNT
#if HAS_PREHEAT
#include "../../lcd/marlinui.h"
#endif
@ -75,7 +75,7 @@ void GcodeSuite::M106() {
uint16_t speed = dspeed;
// Accept 'I' if temperature presets are defined
#if PREHEAT_COUNT
#if HAS_PREHEAT
const bool got_preset = parser.seenval('I');
if (got_preset) speed = ui.material_preset[_MIN(parser.value_byte(), PREHEAT_COUNT - 1)].fan_speed;
#else

View File

@ -63,7 +63,7 @@ void GcodeSuite::M140_M190(const bool isM190) {
celsius_t temp = 0;
// Accept 'I' if temperature presets are defined
#if PREHEAT_COUNT
#if HAS_PREHEAT
got_temp = parser.seenval('I');
if (got_temp) {
const uint8_t index = parser.value_byte();