code
stringlengths 1
1.05M
| repo_name
stringlengths 6
83
| path
stringlengths 3
242
| language
stringclasses 222
values | license
stringclasses 20
values | size
int64 1
1.05M
|
|---|---|---|---|---|---|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_HOME_OFFSET
#include "../gcode.h"
#include "../../module/motion.h"
#include "../../lcd/marlinui.h"
#include "../../libs/buzzer.h"
#include "../../MarlinCore.h"
/**
* M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y
*
* *** TODO: Deprecate M206 for SCARA in favor of M665.
*/
void GcodeSuite::M206() {
if (!parser.seen_any()) return M206_report();
LOOP_NUM_AXES(a)
if (parser.seenval(AXIS_CHAR(a))) set_home_offset((AxisEnum)a, parser.value_axis_units((AxisEnum)a));
#if ENABLED(MORGAN_SCARA)
if (parser.seenval('T')) set_home_offset(A_AXIS, parser.value_float()); // Theta
if (parser.seenval('P')) set_home_offset(B_AXIS, parser.value_float()); // Psi
#endif
report_current_position();
}
void GcodeSuite::M206_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_HOME_OFFSET));
SERIAL_ECHOLNPGM_P(
#if IS_CARTESIAN
LIST_N(DOUBLE(NUM_AXES),
PSTR(" M206 X"), LINEAR_UNIT(home_offset.x),
SP_Y_STR, LINEAR_UNIT(home_offset.y),
SP_Z_STR, LINEAR_UNIT(home_offset.z),
SP_I_STR, I_AXIS_UNIT(home_offset.i),
SP_J_STR, J_AXIS_UNIT(home_offset.j),
SP_K_STR, K_AXIS_UNIT(home_offset.k),
SP_U_STR, U_AXIS_UNIT(home_offset.u),
SP_V_STR, V_AXIS_UNIT(home_offset.v),
SP_W_STR, W_AXIS_UNIT(home_offset.w)
)
#else
PSTR(" M206 Z"), LINEAR_UNIT(home_offset.z)
#endif
);
}
/**
* M428: Set home_offset based on the distance between the
* current_position and the nearest "reference point."
* If an axis is past center its endstop position
* is the reference-point. Otherwise it uses 0. This allows
* the Z offset to be set near the bed when using a max endstop.
*
* M428 can't be used more than 2cm away from 0 or an endstop.
*
* Use M206 to set these values directly.
*/
void GcodeSuite::M428() {
if (homing_needed_error()) return;
xyz_float_t diff;
LOOP_NUM_AXES(i) {
diff[i] = base_home_pos((AxisEnum)i) - current_position[i];
if (!WITHIN(diff[i], -20, 20) && home_dir((AxisEnum)i) > 0)
diff[i] = -current_position[i];
if (!WITHIN(diff[i], -20, 20)) {
SERIAL_ERROR_MSG(STR_ERR_M428_TOO_FAR);
LCD_ALERTMESSAGE(MSG_ERR_M428_TOO_FAR);
ERR_BUZZ();
return;
}
}
LOOP_NUM_AXES(i) set_home_offset((AxisEnum)i, diff[i]);
report_current_position();
LCD_MESSAGE(MSG_HOME_OFFSETS_APPLIED);
OKAY_BUZZ();
}
#endif // HAS_HOME_OFFSET
|
2301_81045437/Marlin
|
Marlin/src/gcode/geometry/M206_M428.cpp
|
C++
|
agpl-3.0
| 3,439
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../gcode.h"
#include "../queue.h" // for last_N
/**
* M110: Set Current Line Number
*/
void GcodeSuite::M110() {
if (parser.seenval('N'))
queue.set_current_line_number(parser.value_long());
}
|
2301_81045437/Marlin
|
Marlin/src/gcode/host/M110.cpp
|
C++
|
agpl-3.0
| 1,076
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(HOST_KEEPALIVE_FEATURE)
#include "../gcode.h"
/**
* M113: Get or set Host Keepalive interval (0 to disable)
*
* S<seconds> Optional. Set the keepalive interval.
*/
void GcodeSuite::M113() {
if (parser.seenval('S')) {
host_keepalive_interval = parser.value_byte();
NOMORE(host_keepalive_interval, 60);
}
else
SERIAL_ECHO_MSG("M113 S", host_keepalive_interval);
}
#endif // HOST_KEEPALIVE_FEATURE
|
2301_81045437/Marlin
|
Marlin/src/gcode/host/M113.cpp
|
C++
|
agpl-3.0
| 1,336
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#include "../gcode.h"
#include "../../module/motion.h"
#include "../../module/stepper.h"
#if ENABLED(M114_DETAIL)
void report_all_axis_pos(const xyze_pos_t &pos, const uint8_t n=LOGICAL_AXES, const uint8_t precision=3) {
for (uint8_t a = 0; a < n; ++a) {
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[a]));
if (pos[a] >= 0) SERIAL_CHAR(' ');
SERIAL_ECHO(p_float_t(pos[a], precision));
}
SERIAL_EOL();
}
inline void report_linear_axis_pos(const xyze_pos_t &pos) { report_all_axis_pos(pos, XYZ); }
void report_linear_axis_pos(const xyz_pos_t &pos, const uint8_t precision=3) {
LOOP_NUM_AXES(a) SERIAL_ECHO(FPSTR(pgm_read_ptr(&SP_AXIS_LBL[a])), p_float_t(pos[a], precision));
SERIAL_EOL();
}
void report_current_position_detail() {
// Position as sent by G-code
SERIAL_ECHOPGM("\nLogical:");
report_linear_axis_pos(current_position.asLogical());
// Cartesian position in native machine space
SERIAL_ECHOPGM("Raw: ");
report_linear_axis_pos(current_position);
xyze_pos_t leveled = current_position;
#if HAS_LEVELING
// Current position with leveling applied
SERIAL_ECHOPGM("Leveled:");
planner.apply_leveling(leveled);
report_linear_axis_pos(leveled);
// Test planner un-leveling. This should match the Raw result.
SERIAL_ECHOPGM("UnLevel:");
xyze_pos_t unleveled = leveled;
planner.unapply_leveling(unleveled);
report_linear_axis_pos(unleveled);
#endif
#if IS_KINEMATIC
// Kinematics applied to the leveled position
SERIAL_ECHOPGM(TERN(POLAR, "Polar", TERN(IS_SCARA, "Scara", "Delta")) "K: " );
inverse_kinematics(leveled); // writes delta[]
report_linear_axis_pos(delta);
#endif
planner.synchronize();
SERIAL_ECHOPGM("Stepper:");
LOOP_LOGICAL_AXES(i) {
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[i]), stepper.position((AxisEnum)i));
}
SERIAL_EOL();
#if IS_SCARA
const xy_float_t deg = {
planner.get_axis_position_degrees(A_AXIS),
planner.get_axis_position_degrees(B_AXIS)
};
SERIAL_ECHOPGM("Degrees:");
report_all_axis_pos(deg, 2);
#endif
SERIAL_ECHOPGM("FromStp:");
get_cartesian_from_steppers(); // writes 'cartes' (with forward kinematics)
xyze_pos_t from_steppers = LOGICAL_AXIS_ARRAY(
planner.get_axis_position_mm(E_AXIS),
cartes.x, cartes.y, cartes.z,
planner.get_axis_position_mm(I_AXIS),
planner.get_axis_position_mm(J_AXIS),
planner.get_axis_position_mm(K_AXIS),
planner.get_axis_position_mm(U_AXIS),
planner.get_axis_position_mm(V_AXIS),
planner.get_axis_position_mm(W_AXIS)
);
report_all_axis_pos(from_steppers);
const xyze_float_t diff = from_steppers - leveled;
SERIAL_ECHOPGM("Diff: ");
report_all_axis_pos(diff);
TERN_(FULL_REPORT_TO_HOST_FEATURE, report_current_grblstate_moving());
}
#endif // M114_DETAIL
/**
* M114: Report the current position to host.
* Since steppers are moving, the count positions are
* projected by using planner calculations.
* D - Report more detail. This syncs the planner. (Requires M114_DETAIL)
* E - Report E stepper position (Requires M114_DETAIL)
* R - Report the realtime position instead of projected.
*/
void GcodeSuite::M114() {
#if ENABLED(M114_DETAIL)
if (parser.seen_test('D')) {
IF_DISABLED(M114_LEGACY, planner.synchronize());
report_current_position();
report_current_position_detail();
return;
}
#if HAS_EXTRUDERS
if (parser.seen_test('E')) {
SERIAL_ECHOLNPGM("Count E:", stepper.position(E_AXIS));
return;
}
#endif
#endif
TERN_(M114_REALTIME, if (parser.seen_test('R')) return report_real_position());
TERN_(M114_LEGACY, planner.synchronize());
report_current_position_projected();
TERN_(FULL_REPORT_TO_HOST_FEATURE, report_current_grblstate_moving());
}
|
2301_81045437/Marlin
|
Marlin/src/gcode/host/M114.cpp
|
C++
|
agpl-3.0
| 4,890
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(CAPABILITIES_REPORT)
#include "../gcode.h"
#include "../queue.h" // for getting the command port
#if ENABLED(M115_GEOMETRY_REPORT)
#include "../../module/motion.h"
#endif
#if ENABLED(CASE_LIGHT_ENABLE)
#include "../../feature/caselight.h"
#endif
#if !defined(MACHINE_UUID) && ENABLED(HAS_STM32_UID)
#include "../../libs/hex_print.h"
#endif
//#define MINIMAL_CAP_LINES // Don't even mention the disabled capabilities
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
inline void cap_line(FSTR_P const name, const bool ena=true) {
#if ENABLED(MINIMAL_CAP_LINES)
if (ena) SERIAL_ECHOLNPGM("Cap:", name, ":1");
#else
SERIAL_ECHOPGM("Cap:", name);
SERIAL_CHAR(':', '0' + ena);
SERIAL_EOL();
#endif
}
#endif
/**
* M115: Capabilities string and extended capabilities report
* If a capability is not reported, hosts should assume
* the capability is not present.
*
* NOTE: Always make sure to add new capabilities to the RepRap Wiki
* at https://reprap.org/wiki/Firmware_Capabilities_Protocol
*/
void GcodeSuite::M115() {
// Hosts should match one of these
#define MACHINE_KINEMATICS "" \
TERN_(COREXY, "COREXY") TERN_(COREYX, "COREYX") \
TERN_(COREXZ, "COREXZ") TERN_(COREZX, "COREZX") \
TERN_(COREYZ, "COREYZ") TERN_(COREZY, "COREZY") \
TERN_(MARKFORGED_XY, "MARKFORGED_XY") TERN_(MARKFORGED_YX, "MARKFORGED_YX") \
TERN_(POLARGRAPH, "POLARGRAPH") \
TERN_(POLAR, "POLAR") \
TERN_(DELTA, "DELTA") \
TERN_(IS_SCARA, "SCARA") \
TERN_(IS_CARTESIAN, "Cartesian") \
TERN_(BELTPRINTER, " BELTPRINTER")
SERIAL_ECHOPGM("FIRMWARE_NAME:Marlin"
" " DETAILED_BUILD_VERSION " (" __DATE__ " " __TIME__ ")"
" SOURCE_CODE_URL:" SOURCE_CODE_URL
" PROTOCOL_VERSION:" PROTOCOL_VERSION
" MACHINE_TYPE:" MACHINE_NAME
" KINEMATICS:" MACHINE_KINEMATICS
" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)
#if NUM_AXES != XYZ
" AXIS_COUNT:" STRINGIFY(NUM_AXES)
#endif
#if defined(MACHINE_UUID) || ENABLED(HAS_STM32_UID)
" UUID:"
#endif
#ifdef MACHINE_UUID
MACHINE_UUID
#endif
);
#if !defined(MACHINE_UUID) && ENABLED(HAS_STM32_UID)
/**
* STM32-based devices have a 96-bit CPU device serial number.
* Used by LumenPnP / OpenPNP to keep track of unique hardware/configurations.
* https://github.com/opulo-inc/lumenpnp
* This code should work on all STM32-based boards.
*/
#if ENABLED(STM32_UID_SHORT_FORM)
const uint32_t * const UID = (uint32_t*)UID_BASE;
for (uint8_t i = 0; i < 3; i++) print_hex_long(UID[i]);
#else
const uint16_t * const UID = (uint16_t*)UID_BASE; // Little-endian!
SERIAL_ECHO(F("CEDE2A2F-"));
for (uint8_t i = 1; i <= 6; i++) {
print_hex_word(UID[(i % 2) ? i : i - 2]); // 1111-0000-3333-222255554444
if (i <= 3) SERIAL_ECHO(C('-'));
}
#endif
#endif
SERIAL_EOL();
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
// The port that sent M115
serial_index_t port = queue.ring_buffer.command_port();
// PAREN_COMMENTS
TERN_(PAREN_COMMENTS, cap_line(F("PAREN_COMMENTS")));
// QUOTED_STRINGS
TERN_(GCODE_QUOTED_STRINGS, cap_line(F("QUOTED_STRINGS")));
// SERIAL_XON_XOFF
cap_line(F("SERIAL_XON_XOFF"), ENABLED(SERIAL_XON_XOFF));
// BINARY_FILE_TRANSFER (M28 B1)
cap_line(F("BINARY_FILE_TRANSFER"), ENABLED(BINARY_FILE_TRANSFER)); // TODO: Use SERIAL_IMPL.has_feature(port, SerialFeature::BinaryFileTransfer) once implemented
// EEPROM (M500, M501)
cap_line(F("EEPROM"), ENABLED(EEPROM_SETTINGS));
// Volumetric Extrusion (M200)
cap_line(F("VOLUMETRIC"), DISABLED(NO_VOLUMETRICS));
// AUTOREPORT_POS (M154)
cap_line(F("AUTOREPORT_POS"), ENABLED(AUTO_REPORT_POSITION));
// AUTOREPORT_TEMP (M155)
cap_line(F("AUTOREPORT_TEMP"), ENABLED(AUTO_REPORT_TEMPERATURES));
// PROGRESS (M530 S L, M531 <file>, M532 X L)
cap_line(F("PROGRESS"), false);
// Print Job timer M75, M76, M77
cap_line(F("PRINT_JOB"));
// AUTOLEVEL (G29)
cap_line(F("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL));
// RUNOUT (M412, M600)
cap_line(F("RUNOUT"), ENABLED(FILAMENT_RUNOUT_SENSOR));
// Z_PROBE (G30)
cap_line(F("Z_PROBE"), ENABLED(HAS_BED_PROBE));
// MESH_REPORT (M420 V)
cap_line(F("LEVELING_DATA"), ENABLED(HAS_LEVELING));
// BUILD_PERCENT (M73)
cap_line(F("BUILD_PERCENT"), ENABLED(SET_PROGRESS_PERCENT));
// SOFTWARE_POWER (M80, M81)
cap_line(F("SOFTWARE_POWER"), ENABLED(PSU_CONTROL));
// TOGGLE_LIGHTS (M355)
cap_line(F("TOGGLE_LIGHTS"), ENABLED(CASE_LIGHT_ENABLE));
cap_line(F("CASE_LIGHT_BRIGHTNESS"), TERN0(CASE_LIGHT_ENABLE, caselight.has_brightness()));
// SPINDLE AND LASER CONTROL (M3, M4, M5)
#if ENABLED(SPINDLE_FEATURE)
cap_line(F("SPINDLE"));
#elif ENABLED(LASER_FEATURE)
cap_line(F("LASER"));
#endif
// EMERGENCY_PARSER (M108, M112, M410, M876)
cap_line(F("EMERGENCY_PARSER"), ENABLED(EMERGENCY_PARSER));
// HOST ACTION COMMANDS (paused, resume, resumed, cancel, etc.)
cap_line(F("HOST_ACTION_COMMANDS"), ENABLED(HOST_ACTION_COMMANDS));
// PROMPT SUPPORT (M876)
cap_line(F("PROMPT_SUPPORT"), ENABLED(HOST_PROMPT_SUPPORT));
// SDCARD (M20, M23, M24, etc.)
cap_line(F("SDCARD"), ENABLED(HAS_MEDIA));
// MULTI_VOLUME (M21 S/M21 U)
#if HAS_MEDIA
cap_line(F("MULTI_VOLUME"), ENABLED(MULTI_VOLUME));
#endif
// REPEAT (M808)
cap_line(F("REPEAT"), ENABLED(GCODE_REPEAT_MARKERS));
// SD_WRITE (M928, M28, M29)
cap_line(F("SD_WRITE"), ENABLED(HAS_MEDIA) && DISABLED(SDCARD_READONLY));
// AUTOREPORT_SD_STATUS (M27 extension)
cap_line(F("AUTOREPORT_SD_STATUS"), ENABLED(AUTO_REPORT_SD_STATUS));
// LONG_FILENAME_HOST_SUPPORT (M33)
cap_line(F("LONG_FILENAME"), ENABLED(LONG_FILENAME_HOST_SUPPORT));
// LONG_FILENAME_WRITE_SUPPORT (M23, M28, M30...)
cap_line(F("LFN_WRITE"), ENABLED(LONG_FILENAME_WRITE_SUPPORT));
// CUSTOM_FIRMWARE_UPLOAD (M20 F)
cap_line(F("CUSTOM_FIRMWARE_UPLOAD"), ENABLED(CUSTOM_FIRMWARE_UPLOAD));
// EXTENDED_M20 (M20 L)
cap_line(F("EXTENDED_M20"), ENABLED(LONG_FILENAME_HOST_SUPPORT));
// THERMAL_PROTECTION
cap_line(F("THERMAL_PROTECTION"), ENABLED(THERMALLY_SAFE));
// MOTION_MODES (M80-M89)
cap_line(F("MOTION_MODES"), ENABLED(GCODE_MOTION_MODES));
// ARC_SUPPORT (G2-G3)
cap_line(F("ARCS"), ENABLED(ARC_SUPPORT));
// BABYSTEPPING (M290)
cap_line(F("BABYSTEPPING"), ENABLED(BABYSTEPPING));
// EP_BABYSTEP (M293, M294)
cap_line(F("EP_BABYSTEP"), ENABLED(EP_BABYSTEPPING));
// CHAMBER_TEMPERATURE (M141, M191)
cap_line(F("CHAMBER_TEMPERATURE"), ENABLED(HAS_HEATED_CHAMBER));
// COOLER_TEMPERATURE (M143, M193)
cap_line(F("COOLER_TEMPERATURE"), ENABLED(HAS_COOLER));
// MEATPACK Compression
cap_line(F("MEATPACK"), SERIAL_IMPL.has_feature(port, SerialFeature::MeatPack));
// CONFIG_EXPORT
cap_line(F("CONFIG_EXPORT"), ENABLED(CONFIGURATION_EMBEDDING));
// Machine Geometry
#if ENABLED(M115_GEOMETRY_REPORT)
constexpr xyz_pos_t bmin{0},
bmax = NUM_AXIS_ARRAY(X_BED_SIZE, Y_BED_SIZE, Z_MAX_POS, I_MAX_POS, J_MAX_POS, K_MAX_POS, U_MAX_POS, V_MAX_POS, W_MAX_POS),
dmin = NUM_AXIS_ARRAY(X_MIN_POS, Y_MIN_POS, Z_MIN_POS, I_MIN_POS, J_MIN_POS, K_MIN_POS, U_MIN_POS, V_MIN_POS, W_MIN_POS),
dmax = NUM_AXIS_ARRAY(X_MAX_POS, Y_MAX_POS, Z_MAX_POS, I_MAX_POS, J_MAX_POS, K_MAX_POS, U_MAX_POS, V_MAX_POS, W_MAX_POS);
xyz_pos_t cmin = bmin, cmax = bmax;
apply_motion_limits(cmin);
apply_motion_limits(cmax);
const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(),
wmin = cmin.asLogical(), wmax = cmax.asLogical();
SERIAL_ECHOPGM(
"area:{"
"full:{"
"min:{"
LIST_N(DOUBLE(NUM_AXES),
"x:", lmin.x, ",y:", lmin.y, ",z:", lmin.z,
",i:", lmin.i, ",j:", lmin.j, ",k:", lmin.k,
",u:", lmin.u, ",v:", lmin.v, ",w:", lmin.w
),
"},max:{"
LIST_N(DOUBLE(NUM_AXES),
"x:", lmax.x, ",y:", lmax.y, ",z:", lmax.z,
",i:", lmax.i, ",j:", lmax.j, ",k:", lmax.k,
",u:", lmax.u, ",v:", lmax.v, ",w:", lmax.w
),
"}" // max
"}," // full
);
SERIAL_ECHOLNPGM(
"work:{"
"min:{"
LIST_N(DOUBLE(NUM_AXES),
"x:", wmin.x, ",y:", wmin.y, ",z:", wmin.z,
",i:", wmin.i, ",j:", wmin.j, ",k:", wmin.k,
",u:", wmin.u, ",v:", wmin.v, ",w:", wmin.w
),
"},max:{"
LIST_N(DOUBLE(NUM_AXES),
"x:", wmax.x, ",y:", wmax.y, ",z:", wmax.z,
",i:", wmax.i, ",j:", wmax.j, ",k:", wmax.k,
",u:", wmax.u, ",v:", wmax.v, ",w:", wmax.w
),
"}" // max
"}" // work
"}" // area
);
#endif
#endif // EXTENDED_CAPABILITIES_REPORT
}
#endif // CAPABILITIES_REPORT
|
2301_81045437/Marlin
|
Marlin/src/gcode/host/M115.cpp
|
C++
|
agpl-3.0
| 10,173
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../gcode.h"
#include "../../core/serial.h"
/**
* M118: Display a message in the host console.
*
* A1 Prepend '// ' for an action command, as in OctoPrint
* E1 Have the host 'echo:' the text
* Pn Redirect to another serial port
* 0 : Announce to all ports
* 1-9 : Serial ports 1 to 9
*/
void GcodeSuite::M118() {
bool hasE = false, hasA = false;
#if HAS_MULTI_SERIAL
int8_t port = -1; // Assume no redirect
#endif
char *p = parser.string_arg;
for (uint8_t i = 3; i--;) {
// A1, E1, and Pn are always parsed out
if (!( ((p[0] == 'A' || p[0] == 'E') && p[1] == '1') || (p[0] == 'P' && NUMERIC(p[1])) )) break;
switch (p[0]) {
case 'A': hasA = true; break;
case 'E': hasE = true; break;
#if HAS_MULTI_SERIAL
case 'P': port = p[1] - '0'; break;
#endif
}
p += 2;
while (*p == ' ') ++p;
}
PORT_REDIRECT(WITHIN(port, 0, NUM_SERIAL) ? (port ? SERIAL_PORTMASK(port - 1) : SerialMask::All) : multiSerial.portMask);
if (hasE) SERIAL_ECHO_START();
if (hasA) SERIAL_ECHOPGM("//");
SERIAL_ECHOLN(p);
}
|
2301_81045437/Marlin
|
Marlin/src/gcode/host/M118.cpp
|
C++
|
agpl-3.0
| 1,969
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../gcode.h"
#include "../../module/endstops.h"
/**
* M119: Output endstop states to serial output
*/
void GcodeSuite::M119() {
endstops.report_states();
}
|
2301_81045437/Marlin
|
Marlin/src/gcode/host/M119.cpp
|
C++
|
agpl-3.0
| 1,035
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 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/>.
*
*/
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(AUTO_REPORT_POSITION)
#include "../gcode.h"
#include "../../module/motion.h"
/**
* M154: Set position auto-report interval. M154 S<seconds>
*/
void GcodeSuite::M154() {
if (parser.seenval('S'))
position_auto_reporter.set_interval(parser.value_byte());
}
#endif // AUTO_REPORT_POSITION
|
2301_81045437/Marlin
|
Marlin/src/gcode/host/M154.cpp
|
C++
|
agpl-3.0
| 1,213
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(EXPECTED_PRINTER_CHECK)
#include "../gcode.h"
#include "../../MarlinCore.h"
#include "../../lcd/marlinui.h"
/**
* M16: Expected Printer Check
*/
void GcodeSuite::M16() {
if (strcmp_P(parser.string_arg, PSTR(MACHINE_NAME)))
kill(GET_TEXT_F(MSG_KILL_EXPECTED_PRINTER));
}
#endif // EXPECTED_PRINTER_CHECK
|
2301_81045437/Marlin
|
Marlin/src/gcode/host/M16.cpp
|
C++
|
agpl-3.0
| 1,231
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(REPETIER_GCODE_M360)
#include "../gcode.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#if HAS_EXTRUDERS
#include "../../module/temperature.h"
#endif
static void config_prefix(PGM_P const name, PGM_P const pref=nullptr, const int8_t ind=-1) {
SERIAL_ECHOPGM("Config:");
if (pref) SERIAL_ECHOPGM_P(pref);
if (ind >= 0) { SERIAL_ECHO(ind); SERIAL_CHAR(':'); }
SERIAL_ECHOPGM_P(name, C(':'));
}
static void config_line(PGM_P const name, const float val, PGM_P const pref=nullptr, const int8_t ind=-1) {
config_prefix(name, pref, ind);
SERIAL_ECHOLN(val);
}
static void config_line(FSTR_P const name, const float val, FSTR_P const pref=nullptr, const int8_t ind=-1) {
config_line(FTOP(name), val, FTOP(pref) , ind);
}
static void config_line_e(const int8_t e, PGM_P const name, const float val) {
config_line(name, val, PSTR("Extr."), e + 1);
}
static void config_line_e(const int8_t e, FSTR_P const name, const float val) {
config_line_e(e, FTOP(name), val);
}
/**
* M360: Report Firmware configuration
* in RepRapFirmware-compatible format
*/
void GcodeSuite::M360() {
PGMSTR(X_STR, "X");
PGMSTR(Y_STR, "Y");
PGMSTR(Z_STR, "Z");
PGMSTR(JERK_STR, "Jerk");
//
// Basics and Enabled items
//
config_line(F("Baudrate"), BAUDRATE);
config_line(F("InputBuffer"), MAX_CMD_SIZE);
config_line(F("PrintlineCache"), BUFSIZE);
config_line(F("MixingExtruder"), ENABLED(MIXING_EXTRUDER));
config_line(F("SDCard"), ENABLED(HAS_MEDIA));
config_line(F("Fan"), ENABLED(HAS_FAN));
config_line(F("LCD"), ENABLED(HAS_DISPLAY));
config_line(F("SoftwarePowerSwitch"), 1);
config_line(F("SupportLocalFilamentchange"), ENABLED(ADVANCED_PAUSE_FEATURE));
config_line(F("CaseLights"), ENABLED(CASE_LIGHT_ENABLE));
config_line(F("ZProbe"), ENABLED(HAS_BED_PROBE));
config_line(F("Autolevel"), ENABLED(HAS_LEVELING));
config_line(F("EEPROM"), ENABLED(EEPROM_SETTINGS));
//
// Homing Directions
//
PGMSTR(H_DIR_STR, "HomeDir");
config_line(H_DIR_STR, X_HOME_DIR, X_STR);
config_line(H_DIR_STR, Y_HOME_DIR, Y_STR);
config_line(H_DIR_STR, Z_HOME_DIR, Z_STR);
//
// XYZ Axis Jerk
//
#if ENABLED(CLASSIC_JERK)
if (planner.max_jerk.x == planner.max_jerk.y)
config_line(F("XY"), planner.max_jerk.x, FPSTR(JERK_STR));
else {
config_line(X_STR, planner.max_jerk.x, JERK_STR);
config_line(Y_STR, planner.max_jerk.y, JERK_STR);
}
config_line(Z_STR, planner.max_jerk.z, JERK_STR);
#endif
//
// Firmware Retraction
//
config_line(F("SupportG10G11"), ENABLED(FWRETRACT));
#if ENABLED(FWRETRACT)
PGMSTR(RET_STR, "Retraction");
PGMSTR(UNRET_STR, "RetractionUndo");
PGMSTR(SPEED_STR, "Speed");
// M10 Retract with swap (long) moves
config_line(F("Length"), fwretract.settings.retract_length, FPSTR(RET_STR));
config_line(SPEED_STR, fwretract.settings.retract_feedrate_mm_s, RET_STR);
config_line(F("ZLift"), fwretract.settings.retract_zraise, FPSTR(RET_STR));
config_line(F("LongLength"), fwretract.settings.swap_retract_length, FPSTR(RET_STR));
// M11 Recover (undo) with swap (long) moves
config_line(SPEED_STR, fwretract.settings.retract_recover_feedrate_mm_s, UNRET_STR);
config_line(F("ExtraLength"), fwretract.settings.retract_recover_extra, FPSTR(UNRET_STR));
config_line(F("ExtraLongLength"), fwretract.settings.swap_retract_recover_extra, FPSTR(UNRET_STR));
config_line(F("LongSpeed"), fwretract.settings.swap_retract_recover_feedrate_mm_s, FPSTR(UNRET_STR));
#endif
//
// Workspace boundaries
//
const xyz_pos_t dmin = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS },
dmax = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
xyz_pos_t cmin = dmin, cmax = dmax;
apply_motion_limits(cmin);
apply_motion_limits(cmax);
const xyz_pos_t wmin = cmin.asLogical(), wmax = cmax.asLogical();
PGMSTR(MIN_STR, "Min");
PGMSTR(MAX_STR, "Max");
PGMSTR(SIZE_STR, "Size");
config_line(MIN_STR, wmin.x, X_STR);
config_line(MIN_STR, wmin.y, Y_STR);
config_line(MIN_STR, wmin.z, Z_STR);
config_line(MAX_STR, wmax.x, X_STR);
config_line(MAX_STR, wmax.y, Y_STR);
config_line(MAX_STR, wmax.z, Z_STR);
config_line(SIZE_STR, wmax.x - wmin.x, X_STR);
config_line(SIZE_STR, wmax.y - wmin.y, Y_STR);
config_line(SIZE_STR, wmax.z - wmin.z, Z_STR);
//
// Print and Travel Acceleration
//
#define _ACCEL(A,B) _MIN(planner.settings.max_acceleration_mm_per_s2[A##_AXIS], planner.settings.B)
PGMSTR(P_ACC_STR, "PrintAccel");
PGMSTR(T_ACC_STR, "TravelAccel");
config_line(P_ACC_STR, _ACCEL(X, acceleration), X_STR);
config_line(P_ACC_STR, _ACCEL(Y, acceleration), Y_STR);
config_line(P_ACC_STR, _ACCEL(Z, acceleration), Z_STR);
config_line(T_ACC_STR, _ACCEL(X, travel_acceleration), X_STR);
config_line(T_ACC_STR, _ACCEL(Y, travel_acceleration), Y_STR);
config_line(T_ACC_STR, _ACCEL(Z, travel_acceleration), Z_STR);
config_prefix(PSTR("PrinterType"));
SERIAL_ECHOLNPGM(
TERN_(DELTA, "Delta")
TERN_(IS_SCARA, "SCARA")
TERN_(POLAR, "Polar")
TERN_(IS_CORE, "Core")
TERN_(MARKFORGED_XY, "MarkForgedXY")
TERN_(MARKFORGED_YX, "MarkForgedYX")
TERN_(IS_CARTESIAN, "Cartesian")
);
//
// Heated Bed
//
config_line(F("HeatedBed"), ENABLED(HAS_HEATED_BED));
#if HAS_HEATED_BED
config_line(F("MaxBedTemp"), BED_MAX_TARGET);
#endif
//
// Per-Extruder settings
//
config_line(F("NumExtruder"), EXTRUDERS);
#if HAS_EXTRUDERS
EXTRUDER_LOOP() {
#if HAS_LINEAR_E_JERK
config_line_e(e, JERK_STR, planner.max_e_jerk[E_INDEX_N(e)]);
#elif ENABLED(CLASSIC_JERK)
config_line_e(e, JERK_STR, planner.max_jerk.e);
#endif
config_line_e(e, F("MaxSpeed"), planner.settings.max_feedrate_mm_s[E_AXIS_N(e)]);
config_line_e(e, F("Acceleration"), planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(e)]);
config_line_e(e, F("Diameter"), TERN(NO_VOLUMETRICS, DEFAULT_NOMINAL_FILAMENT_DIA, planner.filament_size[e]));
config_line_e(e, F("MaxTemp"), thermalManager.hotend_maxtemp[e]);
}
#endif
}
#endif
|
2301_81045437/Marlin
|
Marlin/src/gcode/host/M360.cpp
|
C++
|
agpl-3.0
| 7,308
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_GCODE_M876
#include "../../feature/host_actions.h"
#include "../gcode.h"
#include "../../MarlinCore.h"
/**
* M876: Handle Prompt Response
*/
void GcodeSuite::M876() {
if (parser.seenval('S')) hostui.handle_response((uint8_t)parser.value_int());
}
#endif // HAS_GCODE_M876
|
2301_81045437/Marlin
|
Marlin/src/gcode/host/M876.cpp
|
C++
|
agpl-3.0
| 1,189
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfigPre.h"
#if HAS_RESUME_CONTINUE
#include "../../inc/MarlinConfig.h"
#include "../gcode.h"
#include "../../module/planner.h" // for synchronize()
#include "../../MarlinCore.h" // for wait_for_user_response()
#if HAS_MARLINUI_MENU
#include "../../lcd/marlinui.h"
#elif ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#endif
#if ENABLED(HOST_PROMPT_SUPPORT)
#include "../../feature/host_actions.h"
#endif
/**
* M0: Unconditional stop - Wait for user button press on LCD
* M1: Conditional stop - Wait for user button press on LCD
*/
void GcodeSuite::M0_M1() {
millis_t ms = 0;
if (parser.seenval('P')) ms = parser.value_millis(); // Milliseconds to wait
if (parser.seenval('S')) ms = parser.value_millis_from_seconds(); // Seconds to wait
planner.synchronize();
#if HAS_MARLINUI_MENU
if (parser.string_arg)
ui.set_status_no_expire(parser.string_arg);
else {
LCD_MESSAGE(MSG_USERWAIT);
#if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
ui.reset_progress_bar_timeout();
#endif
}
#elif ENABLED(DWIN_LCD_PROUI) // ExtUI with icon, string, button title
if (parser.string_arg)
ExtUI::onUserConfirmRequired(ICON_Continue_1, parser.string_arg, GET_TEXT_F(MSG_USERWAIT));
else
ExtUI::onUserConfirmRequired(ICON_Stop_1, GET_TEXT_F(MSG_STOPPED), GET_TEXT_F(MSG_USERWAIT));
#elif ENABLED(EXTENSIBLE_UI)
if (parser.string_arg)
ExtUI::onUserConfirmRequired(parser.string_arg); // String in an SRAM buffer
else
ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_USERWAIT));
#else
if (parser.string_arg) {
SERIAL_ECHO_START();
SERIAL_ECHOLN(parser.string_arg);
}
#endif
#if ENABLED(HOST_PROMPT_SUPPORT)
if (parser.string_arg)
hostui.continue_prompt(parser.string_arg);
else
hostui.continue_prompt(parser.codenum ? F("M1 Stop") : F("M0 Stop"));
#endif
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(ms));
TERN_(HAS_MARLINUI_MENU, ui.reset_status());
}
#endif // HAS_RESUME_CONTINUE
|
2301_81045437/Marlin
|
Marlin/src/gcode/lcd/M0_M1.cpp
|
C++
|
agpl-3.0
| 2,968
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_STATUS_MESSAGE
#include "../gcode.h"
#include "../../lcd/marlinui.h"
/**
* M117: Set LCD Status Message
*/
void GcodeSuite::M117() {
if (parser.string_arg && parser.string_arg[0])
ui.set_status_no_expire(parser.string_arg);
else
ui.reset_status();
}
#endif // HAS_STATUS_MESSAGE
|
2301_81045437/Marlin
|
Marlin/src/gcode/lcd/M117.cpp
|
C++
|
agpl-3.0
| 1,206
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_PREHEAT
#include "../gcode.h"
#include "../../lcd/marlinui.h"
#if HAS_HOTEND
#include "../../module/temperature.h"
#endif
/**
* M145: Set the heatup state for a material in the LCD menu
*
* S<material>
* H<hotend temp>
* B<bed temp>
* F<fan speed>
*/
void GcodeSuite::M145() {
const uint8_t material = (uint8_t)parser.intval('S');
if (material >= PREHEAT_COUNT)
SERIAL_ERROR_MSG(STR_ERR_MATERIAL_INDEX);
else {
preheat_t &mat = ui.material_preset[material];
#if HAS_HOTEND
if (parser.seenval('H'))
mat.hotend_temp = constrain(parser.value_int(), thermalManager.extrude_min_temp, thermalManager.hotend_max_target(0));
#endif
#if HAS_HEATED_BED
if (parser.seenval('B'))
mat.bed_temp = constrain(parser.value_int(), BED_MINTEMP, BED_MAX_TARGET);
#endif
#if HAS_FAN
if (parser.seenval('F'))
mat.fan_speed = constrain(parser.value_int(), 0, 255);
#endif
}
}
void GcodeSuite::M145_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F(STR_MATERIAL_HEATUP));
for (uint8_t i = 0; i < PREHEAT_COUNT; ++i) {
report_echo_start(forReplay);
SERIAL_ECHOLNPGM_P(
PSTR(" M145 S"), i
#if HAS_HOTEND
, PSTR(" H"), parser.to_temp_units(ui.material_preset[i].hotend_temp)
#endif
#if HAS_HEATED_BED
, SP_B_STR, parser.to_temp_units(ui.material_preset[i].bed_temp)
#endif
#if HAS_FAN
, PSTR(" F"), ui.material_preset[i].fan_speed
#endif
);
}
}
#endif // HAS_PREHEAT
|
2301_81045437/Marlin
|
Marlin/src/gcode/lcd/M145.cpp
|
C++
|
agpl-3.0
| 2,493
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_LCD_CONTRAST
#include "../gcode.h"
#include "../../lcd/marlinui.h"
/**
* M250: Read and optionally set the LCD contrast
*/
void GcodeSuite::M250() {
if (LCD_CONTRAST_MIN < LCD_CONTRAST_MAX && parser.seenval('C'))
ui.set_contrast(parser.value_byte());
else
M250_report();
}
void GcodeSuite::M250_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_LCD_CONTRAST));
SERIAL_ECHOLNPGM(" M250 C", ui.contrast);
}
#endif // HAS_LCD_CONTRAST
|
2301_81045437/Marlin
|
Marlin/src/gcode/lcd/M250.cpp
|
C++
|
agpl-3.0
| 1,426
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2022 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(EDITABLE_DISPLAY_TIMEOUT)
#include "../gcode.h"
#include "../../lcd/marlinui.h"
/**
* M255: Set the LCD sleep timeout (in minutes)
* S<minutes> - Period of inactivity required for display / backlight sleep
*/
void GcodeSuite::M255() {
if (parser.seenval('S')) {
const int m = parser.value_int();
#if HAS_DISPLAY_SLEEP
ui.sleep_timeout_minutes = constrain(m, ui.sleep_timeout_min, ui.sleep_timeout_max);
#else
ui.backlight_timeout_minutes = constrain(m, ui.backlight_timeout_min, ui.backlight_timeout_max);
#endif
}
else
M255_report();
}
void GcodeSuite::M255_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_DISPLAY_SLEEP));
SERIAL_ECHOLNPGM(" M255 S",
TERN(HAS_DISPLAY_SLEEP, ui.sleep_timeout_minutes, ui.backlight_timeout_minutes),
" ; (minutes)"
);
}
#endif // EDITABLE_DISPLAY_TIMEOUT
|
2301_81045437/Marlin
|
Marlin/src/gcode/lcd/M255.cpp
|
C++
|
agpl-3.0
| 1,825
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_LCD_BRIGHTNESS
#include "../gcode.h"
#include "../../lcd/marlinui.h"
/**
* M256: Set the LCD brightness
*/
void GcodeSuite::M256() {
if (parser.seenval('B'))
ui.set_brightness(parser.value_int());
else
M256_report();
}
void GcodeSuite::M256_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_LCD_BRIGHTNESS));
SERIAL_ECHOLNPGM(" M256 B", ui.brightness);
}
#endif // HAS_LCD_BRIGHTNESS
|
2301_81045437/Marlin
|
Marlin/src/gcode/lcd/M256.cpp
|
C++
|
agpl-3.0
| 1,377
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_SOUND
#include "../gcode.h"
#include "../../lcd/marlinui.h" // i2c-based BUZZ
#include "../../libs/buzzer.h" // Buzzer, if possible
/**
* M300: Play a Tone / Add a tone to the queue
*
* S<frequency> - (Hz) The frequency of the tone. 0 for silence.
* P<duration> - (ms) The duration of the tone.
*
* With SOUND_MENU_ITEM:
* E<0|1> - Mute or enable sound
*/
void GcodeSuite::M300() {
#if ENABLED(SOUND_MENU_ITEM)
if (parser.seen('E')) {
ui.sound_on = parser.value_bool();
return;
}
#endif
const uint16_t frequency = parser.ushortval('S', 260);
uint16_t duration = parser.ushortval('P', 1000);
// Limits the tone duration to 0-5 seconds.
NOMORE(duration, 5000U);
BUZZ(duration, frequency);
}
#endif // HAS_SOUND
|
2301_81045437/Marlin
|
Marlin/src/gcode/lcd/M300.cpp
|
C++
|
agpl-3.0
| 1,678
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_MULTI_LANGUAGE
#include "../gcode.h"
#include "../../MarlinCore.h"
#include "../../lcd/marlinui.h"
/**
* M414: Set the language for the UI
*
* Parameters
* S<index> : The language to select
*/
void GcodeSuite::M414() {
if (parser.seenval('S'))
ui.set_language(parser.value_byte());
else
M414_report();
}
void GcodeSuite::M414_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_UI_LANGUAGE));
SERIAL_ECHOLNPGM(" M414 S", ui.language);
}
#endif // HAS_MULTI_LANGUAGE
|
2301_81045437/Marlin
|
Marlin/src/gcode/lcd/M414.cpp
|
C++
|
agpl-3.0
| 1,464
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(SET_PROGRESS_MANUALLY)
#include "../gcode.h"
#include "../../lcd/marlinui.h"
#include "../../sd/cardreader.h"
#include "../../libs/numtostr.h"
/**
* M73: Set percentage complete (for display on LCD)
*
* Example:
* M73 P25.63 ; Set progress to 25.63%
* M73 R456 ; Set remaining time to 456 minutes
* M73 C12 ; Set next interaction countdown to 12 minutes
* M73 ; Report current values
*
* M73 Progress: ---%; Time left: -----m; Change: -----m;
*
* When PRINT_PROGRESS_SHOW_DECIMALS is enabled - reports percent with 100% / 23.4% / 3.45% format
*
*/
void GcodeSuite::M73() {
#if ENABLED(SET_PROGRESS_PERCENT)
if (parser.seenval('P'))
ui.set_progress((PROGRESS_SCALE) > 1
? parser.value_float() * (PROGRESS_SCALE)
: parser.value_byte()
);
#endif
#if ENABLED(SET_REMAINING_TIME)
if (parser.seenval('R')) ui.set_remaining_time(60 * parser.value_ulong());
#endif
#if ENABLED(SET_INTERACTION_TIME)
if (parser.seenval('C')) ui.set_interaction_time(60 * parser.value_ulong());
#endif
#if ENABLED(M73_REPORT)
if (TERN1(M73_REPORT_SD_ONLY, IS_SD_PRINTING())) {
SERIAL_ECHO_START();
SERIAL_ECHOPGM(" M73");
#if ENABLED(SET_PROGRESS_PERCENT)
SERIAL_ECHOPGM(" Progress: ", TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui.get_progress_percent()), "%;");
#endif
#if ENABLED(SET_REMAINING_TIME)
SERIAL_ECHOPGM(" Time left: ", ui.remaining_time / 60, "m;");
#endif
#if ENABLED(SET_INTERACTION_TIME)
SERIAL_ECHOPGM(" Change: ", ui.interaction_time / 60, "m;");
#endif
SERIAL_EOL();
}
#endif
}
#endif // SET_PROGRESS_MANUALLY
|
2301_81045437/Marlin
|
Marlin/src/gcode/lcd/M73.cpp
|
C++
|
agpl-3.0
| 2,636
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
#include "../gcode.h"
#if HAS_TFT_LVGL_UI
#include "../../lcd/extui/mks_ui/draw_touch_calibration.h"
#else
#include "../../lcd/menu/menu.h"
#endif
/**
* M995: Touch screen calibration for TFT display
*/
void GcodeSuite::M995() {
#if HAS_TFT_LVGL_UI
lv_draw_touch_calibration_screen();
#else
ui.goto_screen(touch_screen_calibration);
#endif
}
#endif // TOUCH_SCREEN_CALIBRATION
|
2301_81045437/Marlin
|
Marlin/src/gcode/lcd/M995.cpp
|
C++
|
agpl-3.0
| 1,341
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../gcode.h"
#include "../../module/motion.h"
#include "../../MarlinCore.h"
#if ALL(FWRETRACT, FWRETRACT_AUTORETRACT)
#include "../../feature/fwretract.h"
#endif
#include "../../sd/cardreader.h"
#if ENABLED(NANODLP_Z_SYNC)
#include "../../module/planner.h"
#endif
extern xyze_pos_t destination;
#if ENABLED(VARIABLE_G0_FEEDRATE)
feedRate_t fast_move_feedrate = MMM_TO_MMS(G0_FEEDRATE);
#endif
/**
* G0, G1: Coordinated movement of X Y Z E axes
*/
void GcodeSuite::G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move/*=false*/)) {
if (!MOTION_CONDITIONS) return;
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_RUNNING));
#ifdef G0_FEEDRATE
feedRate_t old_feedrate;
#if ENABLED(VARIABLE_G0_FEEDRATE)
if (fast_move) {
old_feedrate = feedrate_mm_s; // Back up the (old) motion mode feedrate
feedrate_mm_s = fast_move_feedrate; // Get G0 feedrate from last usage
}
#endif
#endif
get_destination_from_command(); // Get X Y [Z[I[J[K]]]] [E] F (and set cutter power)
#ifdef G0_FEEDRATE
if (fast_move) {
#if ENABLED(VARIABLE_G0_FEEDRATE)
fast_move_feedrate = feedrate_mm_s; // Save feedrate for the next G0
#else
old_feedrate = feedrate_mm_s; // Back up the (new) motion mode feedrate
feedrate_mm_s = MMM_TO_MMS(G0_FEEDRATE); // Get the fixed G0 feedrate
#endif
}
#endif
#if ALL(FWRETRACT, FWRETRACT_AUTORETRACT)
if (MIN_AUTORETRACT <= MAX_AUTORETRACT) {
// When M209 Autoretract is enabled, convert E-only moves to firmware retract/recover moves
if (fwretract.autoretract_enabled && parser.seen_test('E')
&& !parser.seen(STR_AXES_MAIN)
) {
const float echange = destination.e - current_position.e;
// Is this a retract or recover move?
if (WITHIN(ABS(echange), MIN_AUTORETRACT, MAX_AUTORETRACT) && fwretract.retracted[active_extruder] == (echange > 0.0)) {
current_position.e = destination.e; // Hide a G1-based retract/recover from calculations
sync_plan_position_e(); // AND from the planner
return fwretract.retract(echange < 0.0); // Firmware-based retract/recover (double-retract ignored)
}
}
}
#endif // FWRETRACT
#if ANY(IS_SCARA, POLAR)
fast_move ? prepare_fast_move_to_destination() : prepare_line_to_destination();
#else
prepare_line_to_destination();
#endif
#ifdef G0_FEEDRATE
// Restore the motion mode feedrate
if (fast_move) feedrate_mm_s = old_feedrate;
#endif
#if ENABLED(NANODLP_Z_SYNC)
#if ENABLED(NANODLP_ALL_AXIS)
#define _MOVE_SYNC parser.seenval('X') || parser.seenval('Y') || parser.seenval('Z') // For any move wait and output sync message
#else
#define _MOVE_SYNC parser.seenval('Z') // Only for Z move
#endif
if (_MOVE_SYNC) {
planner.synchronize();
SERIAL_ECHOLNPGM(STR_Z_MOVE_COMP);
}
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE));
#else
TERN_(FULL_REPORT_TO_HOST_FEATURE, report_current_grblstate_moving());
#endif
}
|
2301_81045437/Marlin
|
Marlin/src/gcode/motion/G0_G1.cpp
|
C++
|
agpl-3.0
| 4,044
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(ARC_SUPPORT)
#include "../gcode.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#include "../../module/temperature.h"
#if ENABLED(DELTA)
#include "../../module/delta.h"
#elif ENABLED(SCARA)
#include "../../module/scara.h"
#endif
#if N_ARC_CORRECTION < 1
#undef N_ARC_CORRECTION
#define N_ARC_CORRECTION 1
#endif
#ifndef MIN_CIRCLE_SEGMENTS
#define MIN_CIRCLE_SEGMENTS 72 // 5° per segment
#endif
#if !defined(MAX_ARC_SEGMENT_MM) && defined(MIN_ARC_SEGMENT_MM)
#define MAX_ARC_SEGMENT_MM MIN_ARC_SEGMENT_MM
#elif !defined(MIN_ARC_SEGMENT_MM) && defined(MAX_ARC_SEGMENT_MM)
#define MIN_ARC_SEGMENT_MM MAX_ARC_SEGMENT_MM
#endif
#define ARC_LIJKUVW_CODE(L,I,J,K,U,V,W) CODE_N(SUB2(NUM_AXES),L,I,J,K,U,V,W)
#define ARC_LIJKUVWE_CODE(L,I,J,K,U,V,W,E) ARC_LIJKUVW_CODE(L,I,J,K,U,V,W); CODE_ITEM_E(E)
/**
* Plan an arc in 2 dimensions, with linear motion in the other axes.
* The arc is traced with many small linear segments according to the configuration.
*/
void plan_arc(
const xyze_pos_t &cart, // Destination position
const ab_float_t &offset, // Center of rotation relative to current_position
const bool clockwise, // Clockwise?
const uint8_t circles // Take the scenic route
) {
#if ENABLED(CNC_WORKSPACE_PLANES)
AxisEnum axis_p, axis_q, axis_l;
switch (gcode.workspace_plane) {
default:
case GcodeSuite::PLANE_XY: axis_p = X_AXIS; axis_q = Y_AXIS; axis_l = Z_AXIS; break;
case GcodeSuite::PLANE_YZ: axis_p = Y_AXIS; axis_q = Z_AXIS; axis_l = X_AXIS; break;
case GcodeSuite::PLANE_ZX: axis_p = Z_AXIS; axis_q = X_AXIS; axis_l = Y_AXIS; break;
}
#else
constexpr AxisEnum axis_p = X_AXIS, axis_q = Y_AXIS OPTARG(HAS_Z_AXIS, axis_l = Z_AXIS);
#endif
// Radius vector from center to current location
ab_float_t rvec = -offset;
const float radius = HYPOT(rvec.a, rvec.b),
center_P = current_position[axis_p] - rvec.a,
center_Q = current_position[axis_q] - rvec.b,
rt_X = cart[axis_p] - center_P,
rt_Y = cart[axis_q] - center_Q;
// Starting position of the move for all non-arc axes
// i.e., only one of X, Y, or Z, plus the rest.
ARC_LIJKUVWE_CODE(
float start_L = current_position[axis_l],
float start_I = current_position.i,
float start_J = current_position.j,
float start_K = current_position.k,
float start_U = current_position.u,
float start_V = current_position.v,
float start_W = current_position.w,
float start_E = current_position.e
);
// Angle of rotation between position and target from the circle center.
float angular_travel, abs_angular_travel;
// Minimum number of segments in an arc move
uint16_t min_segments = 1;
// Do a full circle if starting and ending positions are "identical"
if (NEAR(current_position[axis_p], cart[axis_p]) && NEAR(current_position[axis_q], cart[axis_q])) {
// Preserve direction for circles
angular_travel = clockwise ? -RADIANS(360) : RADIANS(360);
abs_angular_travel = RADIANS(360);
min_segments = MIN_CIRCLE_SEGMENTS;
}
else {
// Calculate the angle
angular_travel = ATAN2(rvec.a * rt_Y - rvec.b * rt_X, rvec.a * rt_X + rvec.b * rt_Y);
// Angular travel too small to detect? Just return.
if (!angular_travel) return;
// Make sure angular travel over 180 degrees goes the other way around.
switch (((angular_travel < 0) << 1) | clockwise) {
case 1: angular_travel -= RADIANS(360); break; // Positive but CW? Reverse direction.
case 2: angular_travel += RADIANS(360); break; // Negative but CCW? Reverse direction.
}
abs_angular_travel = ABS(angular_travel);
// Apply minimum segments to the arc
const float portion_of_circle = abs_angular_travel / RADIANS(360); // Portion of a complete circle (0 < N < 1)
min_segments = CEIL((MIN_CIRCLE_SEGMENTS) * portion_of_circle); // Minimum segments for the arc
}
// Total travel on all the non-arc axes
ARC_LIJKUVWE_CODE(
float travel_L = cart[axis_l] - start_L,
float travel_I = cart.i - start_I,
float travel_J = cart.j - start_J,
float travel_K = cart.k - start_K,
float travel_U = cart.u - start_U,
float travel_V = cart.v - start_V,
float travel_W = cart.w - start_W,
float travel_E = cart.e - start_E
);
// If "P" specified circles, call plan_arc recursively then continue with the rest of the arc
if (TERN0(ARC_P_CIRCLES, circles)) {
const float total_angular = abs_angular_travel + circles * RADIANS(360), // Total rotation with all circles and remainder
part_per_circle = RADIANS(360) / total_angular; // Each circle's part of the total
ARC_LIJKUVWE_CODE(
const float per_circle_L = travel_L * part_per_circle, // X, Y, or Z movement per circle
const float per_circle_I = travel_I * part_per_circle, // The rest are also non-arc
const float per_circle_J = travel_J * part_per_circle,
const float per_circle_K = travel_K * part_per_circle,
const float per_circle_U = travel_U * part_per_circle,
const float per_circle_V = travel_V * part_per_circle,
const float per_circle_W = travel_W * part_per_circle,
const float per_circle_E = travel_E * part_per_circle // E movement per circle
);
xyze_pos_t temp_position = current_position;
for (uint16_t n = circles; n--;) {
ARC_LIJKUVWE_CODE( // Destination Linear Axes
temp_position[axis_l] += per_circle_L, // Linear X, Y, or Z
temp_position.i += per_circle_I, // The rest are also non-circular
temp_position.j += per_circle_J,
temp_position.k += per_circle_K,
temp_position.u += per_circle_U,
temp_position.v += per_circle_V,
temp_position.w += per_circle_W,
temp_position.e += per_circle_E // Destination E axis
);
plan_arc(temp_position, offset, clockwise, 0); // Plan a single whole circle
}
// Get starting coordinates for the remainder from the current position
ARC_LIJKUVWE_CODE(
start_L = current_position[axis_l],
start_I = current_position.i,
start_J = current_position.j,
start_K = current_position.k,
start_U = current_position.u,
start_V = current_position.v,
start_W = current_position.w,
start_E = current_position.e
);
// Update travel distance for the remainder
ARC_LIJKUVWE_CODE(
travel_L = cart[axis_l] - start_L, // Linear X, Y, or Z
travel_I = cart.i - start_I, // The rest are also non-arc
travel_J = cart.j - start_J,
travel_K = cart.k - start_K,
travel_U = cart.u - start_U,
travel_V = cart.v - start_V,
travel_W = cart.w - start_W,
travel_E = cart.e - start_E
);
}
// Millimeters in the arc, assuming it's flat
const float flat_mm = radius * abs_angular_travel;
// Return if the move is near zero
if (flat_mm < 0.0001f
GANG_N(SUB2(NUM_AXES), // Two axes for the arc
&& NEAR_ZERO(travel_L), // Linear X, Y, or Z
&& NEAR_ZERO(travel_I),
&& NEAR_ZERO(travel_J),
&& NEAR_ZERO(travel_K),
&& NEAR_ZERO(travel_U),
&& NEAR_ZERO(travel_V),
&& NEAR_ZERO(travel_W)
)
) {
#if HAS_EXTRUDERS
if (!NEAR_ZERO(travel_E)) gcode.G0_G1(); // Handle retract/recover as G1
return;
#endif
}
// Feedrate for the move, scaled by the feedrate multiplier
const feedRate_t scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s);
// Get the ideal segment length for the move based on settings
const float ideal_segment_mm = (
#if ARC_SEGMENTS_PER_SEC // Length based on segments per second and feedrate
constrain(scaled_fr_mm_s * RECIPROCAL(ARC_SEGMENTS_PER_SEC), MIN_ARC_SEGMENT_MM, MAX_ARC_SEGMENT_MM)
#else
MAX_ARC_SEGMENT_MM // Length using the maximum segment size
#endif
);
// Number of whole segments based on the ideal segment length
const float nominal_segments = _MAX(FLOOR(flat_mm / ideal_segment_mm), min_segments),
nominal_segment_mm = flat_mm / nominal_segments;
// The number of whole segments in the arc, with best attempt to honor MIN_ARC_SEGMENT_MM and MAX_ARC_SEGMENT_MM
const uint16_t segments = nominal_segment_mm > (MAX_ARC_SEGMENT_MM) ? CEIL(flat_mm / (MAX_ARC_SEGMENT_MM)) :
nominal_segment_mm < (MIN_ARC_SEGMENT_MM) ? _MAX(1, FLOOR(flat_mm / (MIN_ARC_SEGMENT_MM))) :
nominal_segments;
const float segment_mm = flat_mm / segments;
// Add hints to help optimize the move
PlannerHints hints;
#if ENABLED(FEEDRATE_SCALING)
hints.inv_duration = (scaled_fr_mm_s / flat_mm) * segments;
#endif
/**
* Vector rotation by transformation matrix: r is the original vector, r_T is the rotated vector,
* and phi is the angle of rotation. Based on the solution approach by Jens Geisler.
* r_T = [cos(phi) -sin(phi);
* sin(phi) cos(phi)] * r ;
*
* For arc generation, the center of the circle is the axis of rotation and the radius vector is
* defined from the circle center to the initial position. Each line segment is formed by successive
* vector rotations. This requires only two cos() and sin() computations to form the rotation
* matrix for the duration of the entire arc. Error may accumulate from numerical round-off, since
* all double numbers are single precision on the Arduino. (True double precision will not have
* round off issues for CNC applications.) Single precision error can accumulate to be greater than
* tool precision in some cases. Therefore, arc path correction is implemented.
*
* Small angle approximation may be used to reduce computation overhead further. This approximation
* holds for everything, but very small circles and large MAX_ARC_SEGMENT_MM values. In other words,
* theta_per_segment would need to be greater than 0.1 rad and N_ARC_CORRECTION would need to be large
* to cause an appreciable drift error. N_ARC_CORRECTION~=25 is more than small enough to correct for
* numerical drift error. N_ARC_CORRECTION may be on the order a hundred(s) before error becomes an
* issue for CNC machines with the single precision Arduino calculations.
*
* This approximation also allows plan_arc to immediately insert a line segment into the planner
* without the initial overhead of computing cos() or sin(). By the time the arc needs to be applied
* a correction, the planner should have caught up to the lag caused by the initial plan_arc overhead.
* This is important when there are successive arc motions.
*/
xyze_pos_t raw;
// Don't calculate rotation parameters for trivial single-segment arcs
if (segments > 1) {
// Vector rotation matrix values
const float theta_per_segment = angular_travel / segments,
sq_theta_per_segment = sq(theta_per_segment),
sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6,
cos_T = 1 - 0.5f * sq_theta_per_segment; // Small angle approximation
ARC_LIJKUVWE_CODE(
const float per_segment_L = travel_L / segments,
const float per_segment_I = travel_I / segments,
const float per_segment_J = travel_J / segments,
const float per_segment_K = travel_K / segments,
const float per_segment_U = travel_U / segments,
const float per_segment_V = travel_V / segments,
const float per_segment_W = travel_W / segments,
const float per_segment_E = travel_E / segments
);
// Initialize all linear axes and E
ARC_LIJKUVWE_CODE(
raw[axis_l] = start_L,
raw.i = start_I,
raw.j = start_J,
raw.k = start_K,
raw.u = start_U,
raw.v = start_V,
raw.w = start_W,
raw.e = start_E
);
millis_t next_idle_ms = millis() + 200UL;
#if N_ARC_CORRECTION > 1
int8_t arc_recalc_count = N_ARC_CORRECTION;
#endif
// An arc can always complete within limits from a speed which...
// a) is <= any configured maximum speed,
// b) does not require centripetal force greater than any configured maximum acceleration,
// c) is <= nominal speed,
// d) allows the print head to stop in the remining length of the curve within all configured maximum accelerations.
// The last has to be calculated every time through the loop.
const float limiting_accel = _MIN(planner.settings.max_acceleration_mm_per_s2[axis_p], planner.settings.max_acceleration_mm_per_s2[axis_q]),
limiting_speed = _MIN(planner.settings.max_feedrate_mm_s[axis_p], planner.settings.max_feedrate_mm_s[axis_q]),
limiting_speed_sqr = _MIN(sq(limiting_speed), limiting_accel * radius, sq(scaled_fr_mm_s));
for (uint16_t i = 1; i < segments; i++) { // Iterate (segments-1) times
thermalManager.task();
const millis_t ms = millis();
if (ELAPSED(ms, next_idle_ms)) {
next_idle_ms = ms + 200UL;
idle();
}
#if N_ARC_CORRECTION > 1
if (--arc_recalc_count) {
// Apply vector rotation matrix to previous rvec.a / 1
const float r_new_Y = rvec.a * sin_T + rvec.b * cos_T;
rvec.a = rvec.a * cos_T - rvec.b * sin_T;
rvec.b = r_new_Y;
}
else
#endif
{
#if N_ARC_CORRECTION > 1
arc_recalc_count = N_ARC_CORRECTION;
#endif
// Arc correction to radius vector. Computed only every N_ARC_CORRECTION increments.
// Compute exact location by applying transformation matrix from initial radius vector(=-offset).
// To reduce stuttering, the sin and cos could be computed at different times.
// For now, compute both at the same time.
const float Ti = i * theta_per_segment, cos_Ti = cos(Ti), sin_Ti = sin(Ti);
rvec.a = -offset[0] * cos_Ti + offset[1] * sin_Ti;
rvec.b = -offset[0] * sin_Ti - offset[1] * cos_Ti;
}
// Update raw location
raw[axis_p] = center_P + rvec.a;
raw[axis_q] = center_Q + rvec.b;
ARC_LIJKUVWE_CODE(
raw[axis_l] = start_L + per_segment_L * i,
raw.i = start_I + per_segment_I * i,
raw.j = start_J + per_segment_J * i,
raw.k = start_K + per_segment_K * i,
raw.u = start_U + per_segment_U * i,
raw.v = start_V + per_segment_V * i,
raw.w = start_W + per_segment_W * i,
raw.e = start_E + per_segment_E * i
);
apply_motion_limits(raw);
#if HAS_LEVELING && !PLANNER_LEVELING
planner.apply_leveling(raw);
#endif
// calculate safe speed for stopping by the end of the arc
const float arc_mm_remaining = flat_mm - segment_mm * i;
hints.safe_exit_speed_sqr = _MIN(limiting_speed_sqr, 2 * limiting_accel * arc_mm_remaining);
if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, hints))
break;
hints.curve_radius = radius;
}
}
// Ensure last segment arrives at target location.
raw = cart;
apply_motion_limits(raw);
#if HAS_LEVELING && !PLANNER_LEVELING
planner.apply_leveling(raw);
#endif
hints.curve_radius = 0;
hints.safe_exit_speed_sqr = 0.0f;
planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, hints);
current_position = cart;
} // plan_arc
/**
* G2: Clockwise Arc
* G3: Counterclockwise Arc
*
* This command has two forms: IJ-form (JK, KI) and R-form.
*
* - Depending on the current Workspace Plane orientation,
* use parameters IJ/JK/KI to specify the XY/YZ/ZX offsets.
* At least one of the IJ/JK/KI parameters is required.
* XY/YZ/ZX can be omitted to do a complete circle.
* The given XY/YZ/ZX is not error-checked. The arc ends
* based on the angle of the destination.
* Mixing IJ/JK/KI with R will throw an error.
*
* - R specifies the radius. X or Y (Y or Z / Z or X) is required.
* Omitting both XY/YZ/ZX will throw an error.
* XY/YZ/ZX must differ from the current XY/YZ/ZX.
* Mixing R with IJ/JK/KI will throw an error.
*
* - P specifies the number of full circles to do
* before the specified arc move.
*
* Examples:
*
* G2 I10 ; CW circle centered at X+10
* G3 X20 Y12 R14 ; CCW circle with r=14 ending at X20 Y12
*/
void GcodeSuite::G2_G3(const bool clockwise) {
if (!MOTION_CONDITIONS) return;
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_RUNNING));
#if ENABLED(SF_ARC_FIX)
const bool relative_mode_backup = relative_mode;
relative_mode = true;
#endif
get_destination_from_command(); // Get X Y [Z[I[J[K...]]]] [E] F (and set cutter power)
TERN_(SF_ARC_FIX, relative_mode = relative_mode_backup);
ab_float_t arc_offset = { 0, 0 };
if (parser.seenval('R')) {
const float r = parser.value_linear_units();
if (r) {
const xy_pos_t p1 = current_position, p2 = destination;
if (p1 != p2) {
const xy_pos_t d2 = (p2 - p1) * 0.5f; // XY vector to midpoint of move from current
const float e = clockwise ^ (r < 0) ? -1 : 1, // clockwise -1/1, counterclockwise 1/-1
len = d2.magnitude(), // Distance to mid-point of move from current
h2 = (r - len) * (r + len), // factored to reduce rounding error
h = (h2 >= 0) ? SQRT(h2) : 0.0f; // Distance to the arc pivot-point from midpoint
const xy_pos_t s = { -d2.y, d2.x }; // Perpendicular bisector. (Divide by len for unit vector.)
arc_offset = d2 + s / len * e * h; // The calculated offset (mid-point if |r| <= len)
}
}
}
else {
#if ENABLED(CNC_WORKSPACE_PLANES)
char achar, bchar;
switch (workspace_plane) {
default:
case GcodeSuite::PLANE_XY: achar = 'I'; bchar = 'J'; break;
case GcodeSuite::PLANE_YZ: achar = 'J'; bchar = 'K'; break;
case GcodeSuite::PLANE_ZX: achar = 'K'; bchar = 'I'; break;
}
#else
constexpr char achar = 'I', bchar = 'J';
#endif
if (parser.seenval(achar)) arc_offset.a = parser.value_linear_units();
if (parser.seenval(bchar)) arc_offset.b = parser.value_linear_units();
}
if (arc_offset) {
#if ENABLED(ARC_P_CIRCLES)
// P indicates number of circles to do
const int8_t circles_to_do = parser.byteval('P');
if (!WITHIN(circles_to_do, 0, 100))
SERIAL_ERROR_MSG(STR_ERR_ARC_ARGS);
#else
constexpr uint8_t circles_to_do = 0;
#endif
// Send the arc to the planner
plan_arc(destination, arc_offset, clockwise, circles_to_do);
reset_stepper_timeout();
}
else
SERIAL_ERROR_MSG(STR_ERR_ARC_ARGS);
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE));
}
#endif // ARC_SUPPORT
|
2301_81045437/Marlin
|
Marlin/src/gcode/motion/G2_G3.cpp
|
C++
|
agpl-3.0
| 20,210
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../gcode.h"
#include "../../module/planner.h"
#include "../../lcd/marlinui.h"
/**
* G4: Dwell S<seconds> or P<milliseconds>
*/
void GcodeSuite::G4() {
millis_t dwell_ms = 0;
if (parser.seenval('P')) dwell_ms = parser.value_millis(); // milliseconds to wait
if (parser.seenval('S')) dwell_ms = parser.value_millis_from_seconds(); // seconds to wait
planner.synchronize();
#if ENABLED(NANODLP_Z_SYNC)
SERIAL_ECHOLNPGM(STR_Z_MOVE_COMP);
#endif
if (dwell_ms) {
if (!ui.has_status()) LCD_MESSAGE(MSG_DWELL);
dwell(dwell_ms);
}
}
|
2301_81045437/Marlin
|
Marlin/src/gcode/motion/G4.cpp
|
C++
|
agpl-3.0
| 1,431
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(BEZIER_CURVE_SUPPORT)
#if AXIS_COLLISION('I') || AXIS_COLLISION('J')
#error "G5 parameter 'I' or 'J' collision with axis name."
#endif
#include "../../module/motion.h"
#include "../../module/planner_bezier.h"
/**
* Parameters interpreted according to:
* https://linuxcnc.org/docs/2.7/html/gcode/g-code.html#gcode:g5
* However I, J omission is not supported at this point; all
* parameters can be omitted and default to zero.
*/
#include "../gcode.h"
#include "../../MarlinCore.h" // for IsRunning()
/**
* G5: Cubic B-spline
*/
void GcodeSuite::G5() {
if (MOTION_CONDITIONS) {
#if ENABLED(CNC_WORKSPACE_PLANES)
if (workspace_plane != PLANE_XY) {
SERIAL_ERROR_MSG(STR_ERR_BAD_PLANE_MODE);
return;
}
#endif
get_destination_from_command();
const xy_pos_t offsets[2] = {
{ parser.linearval('I'), parser.linearval('J') },
{ parser.linearval('P'), parser.linearval('Q') }
};
cubic_b_spline(current_position, destination, offsets, MMS_SCALED(feedrate_mm_s), active_extruder);
current_position = destination;
}
}
#endif // BEZIER_CURVE_SUPPORT
|
2301_81045437/Marlin
|
Marlin/src/gcode/motion/G5.cpp
|
C++
|
agpl-3.0
| 2,038
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(DIRECT_STEPPING)
#include "../../feature/direct_stepping.h"
#include "../gcode.h"
#include "../../module/planner.h"
/**
* G6: Direct Stepper Move
*/
void GcodeSuite::G6() {
// TODO: feedrate support?
if (parser.seen('R'))
planner.last_page_step_rate = parser.value_ulong();
if (!DirectStepping::Config::DIRECTIONAL) {
#define PAGE_DIR_SET(N,A) do{ if (parser.seen(N)) planner.last_page_dir.A = !!parser.value_byte(); } while(0)
LOGICAL_AXIS_CODE(
PAGE_DIR_SET('E',E),
PAGE_DIR_SET('X',X), PAGE_DIR_SET('Y',Y), PAGE_DIR_SET('Z',Z),
PAGE_DIR_SET(AXIS4_NAME,I), PAGE_DIR_SET(AXIS5_NAME,J), PAGE_DIR_SET(AXIS6_NAME,K),
PAGE_DIR_SET(AXIS5_NAME,U), PAGE_DIR_SET(AXIS6_NAME,V), PAGE_DIR_SET(AXIS7_NAME,W)
);
}
// No index means we just set the state
if (!parser.seen('I')) return;
// No speed is set, can't schedule the move
if (!planner.last_page_step_rate) return;
const page_idx_t page_idx = (page_idx_t)parser.value_ulong();
uint16_t num_steps = DirectStepping::Config::TOTAL_STEPS;
if (parser.seen('S')) num_steps = parser.value_ushort();
planner.buffer_page(page_idx, 0, num_steps);
reset_stepper_timeout();
}
#endif // DIRECT_STEPPING
|
2301_81045437/Marlin
|
Marlin/src/gcode/motion/G6.cpp
|
C++
|
agpl-3.0
| 2,125
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(GCODE_MOTION_MODES)
#include "../gcode.h"
/**
* G80: Cancel current motion mode
*/
void GcodeSuite::G80() {
parser.cancel_motion_mode();
}
#endif // GCODE_MOTION_MODES
|
2301_81045437/Marlin
|
Marlin/src/gcode/motion/G80.cpp
|
C++
|
agpl-3.0
| 1,092
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(BABYSTEPPING)
#include "../gcode.h"
#include "../../feature/babystep.h"
#include "../../module/probe.h"
#include "../../module/planner.h"
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
#include "../../core/serial.h"
#endif
#if ENABLED(MESH_BED_LEVELING)
#include "../../feature/bedlevel/bedlevel.h"
#endif
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
FORCE_INLINE void mod_probe_offset(const_float_t offs) {
if (TERN1(BABYSTEP_HOTEND_Z_OFFSET, active_extruder == 0)) {
probe.offset.z += offs;
SERIAL_ECHO_MSG(STR_PROBE_OFFSET " " STR_Z, probe.offset.z);
}
else {
#if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
hotend_offset[active_extruder].z -= offs;
SERIAL_ECHO_MSG(STR_PROBE_OFFSET STR_Z ": ", hotend_offset[active_extruder].z);
#endif
}
}
#endif
/**
* M290: Babystepping
*
* Send 'R' or no parameters for a report.
*
* X<linear> - Distance to step X
* Y<linear> - Distance to step Y
* Z<linear> - Distance to step Z
* S<linear> - Distance to step Z (alias for Z)
*
* With BABYSTEP_ZPROBE_OFFSET:
* P0 - Don't adjust the Z probe offset
*/
void GcodeSuite::M290() {
#if ENABLED(BABYSTEP_XY)
LOOP_NUM_AXES(a)
if (parser.seenval(AXIS_CHAR(a)) || (a == Z_AXIS && parser.seenval('S'))) {
const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2);
babystep.add_mm((AxisEnum)a, offs);
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
if (a == Z_AXIS && parser.boolval('P', true)) mod_probe_offset(offs);
#endif
}
#else
if (parser.seenval('Z') || parser.seenval('S')) {
const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2);
babystep.add_mm(Z_AXIS, offs);
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
if (parser.boolval('P', true)) mod_probe_offset(offs);
#endif
}
#endif
if (!parser.seen(STR_AXES_MAIN) || parser.seen('R')) {
SERIAL_ECHO_START();
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
SERIAL_ECHOLNPGM(STR_PROBE_OFFSET " " STR_Z, probe.offset.z);
#endif
#if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
{
SERIAL_ECHOLNPGM_P(
PSTR("Hotend "), active_extruder
#if ENABLED(BABYSTEP_XY)
, PSTR("Offset X"), hotend_offset[active_extruder].x
, SP_Y_STR, hotend_offset[active_extruder].y
, SP_Z_STR
#else
, PSTR("Offset Z")
#endif
, hotend_offset[active_extruder].z
);
}
#endif
#if ENABLED(MESH_BED_LEVELING)
SERIAL_ECHOLNPGM("MBL Adjust Z", bedlevel.z_offset);
#endif
#if ENABLED(BABYSTEP_DISPLAY_TOTAL)
{
SERIAL_ECHOLNPGM_P(
#if ENABLED(BABYSTEP_XY)
PSTR("Babystep X"), babystep.axis_total[X_AXIS]
, SP_Y_STR, babystep.axis_total[Y_AXIS]
, SP_Z_STR
#else
PSTR("Babystep Z")
#endif
, babystep.axis_total[BS_TOTAL_IND(Z_AXIS)]
);
}
#endif
}
}
#if ENABLED(EP_BABYSTEPPING) && DISABLED(EMERGENCY_PARSER)
// Without Emergency Parser M293/M294 will be added to the queue
void GcodeSuite::M293() { babystep.z_up(); }
void GcodeSuite::M294() { babystep.z_down(); }
#endif
#endif // BABYSTEPPING
|
2301_81045437/Marlin
|
Marlin/src/gcode/motion/M290.cpp
|
C++
|
agpl-3.0
| 4,108
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../gcode.h"
#include "../../module/planner.h"
/**
* M400: Finish all moves
*/
void GcodeSuite::M400() {
planner.synchronize();
}
|
2301_81045437/Marlin
|
Marlin/src/gcode/motion/M400.cpp
|
C++
|
agpl-3.0
| 1,009
|
/**
* 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(OTA_FIRMWARE_UPDATE)
#include "../gcode.h"
#include "../../libs/BL24CXX.h"
#if ENABLED(CREALITY_RTS)
#include "../../lcd/rts/lcd_rts.h"
#endif
#define OTA_FLAG_EEPROM 90
//#define DEBUG_OUT 1
#include "../../core/debug_out.h"
/**
* M936: Set one of the OTA update flags.
* V2 = Upgrade the motherboard firmware
* V3 = Upgrade the RTS controller firmware
*/
void GcodeSuite::M936() {
static uint8_t ota_update_flag = 0x00;
const int16_t ota = parser.intval('V', -1);
switch (ota) {
case 2:
// Set the OTA board firmware upgrade flag ahead of reboot.
ota_update_flag = 0x01;
DEBUG_ECHOLNPGM("Motherboard upgrade flag set");
TERN_(CREALITY_RTS, RTS_Error(Error_205));
break;
#if ENABLED(CREALITY_RTS)
case 3:
// Set the OTA screen firmware upgrade flag ahead of reboot.
ota_update_flag = 0x02;
DEBUG_ECHOLNPGM("DWIN upgrade flag set");
TERN_(CREALITY_RTS, RTS_Error(Error_206));
break;
#endif
}
switch (ota) {
case 2: TERN_(CREALITY_RTS, case 3:)
BL24CXX::write(OTA_FLAG_EEPROM, &ota_update_flag, sizeof(ota_update_flag));
safe_delay(100);
hal.reboot();
}
}
#endif // OTA_FIRMWARE_UPDATE
|
2301_81045437/Marlin
|
Marlin/src/gcode/ota/M936.cpp
|
C++
|
agpl-3.0
| 2,136
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
/**
* parser.cpp - Parser for a G-Code line, providing a parameter interface.
*/
#include "parser.h"
#include "../MarlinCore.h"
// Must be declared for allocation and to satisfy the linker
// Zero values need no initialization.
bool GCodeParser::volumetric_enabled;
#if ENABLED(INCH_MODE_SUPPORT)
float GCodeParser::linear_unit_factor, GCodeParser::volumetric_unit_factor;
#endif
#if ENABLED(TEMPERATURE_UNITS_SUPPORT)
TempUnit GCodeParser::input_temp_units = TEMPUNIT_C;
#endif
char *GCodeParser::command_ptr,
*GCodeParser::string_arg,
*GCodeParser::value_ptr;
char GCodeParser::command_letter;
uint16_t GCodeParser::codenum;
#if USE_GCODE_SUBCODES
uint8_t GCodeParser::subcode;
#endif
#if ENABLED(GCODE_MOTION_MODES)
int16_t GCodeParser::motion_mode_codenum = -1;
#if USE_GCODE_SUBCODES
uint8_t GCodeParser::motion_mode_subcode;
#endif
#endif
#if ENABLED(FASTER_GCODE_PARSER)
// Optimized Parameters
uint32_t GCodeParser::codebits; // found bits
uint8_t GCodeParser::param[26]; // parameter offsets from command_ptr
#else
char *GCodeParser::command_args; // start of parameters
#endif
// Create a global instance of the G-Code parser singleton
GCodeParser parser;
/**
* Clear all code-seen (and value pointers)
*
* Since each param is set/cleared on seen codes,
* this may be optimized by commenting out ZERO(param)
*/
void GCodeParser::reset() {
string_arg = nullptr; // No whole line argument
command_letter = '?'; // No command letter
codenum = 0; // No command code
TERN_(USE_GCODE_SUBCODES, subcode = 0); // No command sub-code
#if ENABLED(FASTER_GCODE_PARSER)
codebits = 0; // No codes yet
//ZERO(param); // No parameters (should be safe to comment out this line)
#endif
}
#if ENABLED(GCODE_QUOTED_STRINGS)
// Pass the address after the first quote (if any)
char* GCodeParser::unescape_string(char* &src) {
if (*src == '"') ++src; // Skip the leading quote
char * const out = src; // Start of the string
char *dst = src; // Prepare to unescape and terminate
for (;;) {
char c = *src++; // Get the next char
switch (c) {
case '\\': c = *src++; break; // Get the escaped char
case '"' : c = '\0'; break; // Convert bare quote to nul
}
if (!(*dst++ = c)) break; // Copy and break on nul
}
return out;
}
#endif
/**
* Populate the command line state (command_letter, codenum, subcode, and string_arg)
* by parsing a single line of G-Code. 58 bytes of SRAM are used to speed up seen/value.
*/
void GCodeParser::parse(char *p) {
reset(); // No codes to report
auto uppercase = [](char c) {
if (TERN0(GCODE_CASE_INSENSITIVE, WITHIN(c, 'a', 'z')))
c += 'A' - 'a';
return c;
};
// Skip spaces
while (*p == ' ') ++p;
// Skip N[-0-9] if included in the command line
if (uppercase(*p) == 'N' && NUMERIC_SIGNED(p[1])) {
//TERN_(FASTER_GCODE_PARSER, set('N', p + 1)); // (optional) Set the 'N' parameter value
p += 2; // skip N[-0-9]
while (NUMERIC(*p)) ++p; // skip [0-9]*
while (*p == ' ') ++p; // skip [ ]*
}
// *p now points to the current command, which should be G, M, or T
command_ptr = p;
// Get the command letter, which must be G, M, or T
const char letter = uppercase(*p++);
// Nullify asterisk and trailing whitespace
char *starpos = strchr(p, '*');
if (starpos) {
--starpos; // *
while (*starpos == ' ') --starpos; // spaces...
starpos[1] = '\0';
}
#if ANY(MARLIN_DEV_MODE, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
#define SIGNED_CODENUM 1
#endif
/**
* Screen for good command letters.
* With Realtime Reporting, commands S000, P000, and R000 are allowed.
*/
#if ENABLED(REALTIME_REPORTING_COMMANDS)
switch (letter) {
case 'P': case 'R' ... 'S': {
uint8_t digits = 0;
char *a = p;
while (*a++ == '0') digits++; // Count up '0' characters
if (digits == 3) { // Three '0' digits is a good command
codenum = 0;
command_letter = letter;
return;
}
}
}
#endif
/**
* Screen for good command letters. G, M, and T are always accepted.
* With Motion Modes enabled any axis letter can come first.
*/
switch (letter) {
case 'G': case 'M': case 'T': TERN_(MARLIN_DEV_MODE, case 'D':) {
// Skip spaces to get the numeric part
while (*p == ' ') p++;
#if HAS_PRUSA_MMU2
if (letter == 'T') {
// check for special MMU2 T?/Tx/Tc commands
if (*p == '?' || *p == 'x' || *p == 'c') {
command_letter = letter;
string_arg = p;
return;
}
}
#endif
// Bail if there's no command code number
if (!TERN(SIGNED_CODENUM, NUMERIC_SIGNED(*p), NUMERIC(*p))) {
if (TERN0(HAS_MULTI_EXTRUDER, letter == 'T')) {
p[0] = '*'; p[1] = '\0'; string_arg = p; // Convert 'T' alone into 'T*'
command_letter = letter;
}
return;
}
// Save the command letter at this point
// A '?' signifies an unknown command
command_letter = letter;
#if ENABLED(SIGNED_CODENUM)
int sign = 1; // Allow for a negative code like D-1 or T-1
if (*p == '-') { sign = -1; ++p; }
#endif
// Get the code number - integer digits only
codenum = 0;
do { codenum = codenum * 10 + *p++ - '0'; } while (NUMERIC(*p));
// Apply the sign, if any
TERN_(SIGNED_CODENUM, codenum *= sign);
// Allow for decimal point in command
#if USE_GCODE_SUBCODES
if (*p == '.') {
p++;
while (NUMERIC(*p))
subcode = subcode * 10 + *p++ - '0';
}
#endif
// Skip all spaces to get to the first argument, or nul
while (*p == ' ') p++;
#if ENABLED(GCODE_MOTION_MODES)
if (letter == 'G'
&& (codenum <= TERN(ARC_SUPPORT, 3, 1) || TERN0(BEZIER_CURVE_SUPPORT, codenum == 5) || TERN0(G38_PROBE_TARGET, codenum == 38))
) {
motion_mode_codenum = codenum;
TERN_(USE_GCODE_SUBCODES, motion_mode_subcode = subcode);
}
#endif
} break;
#if ENABLED(GCODE_MOTION_MODES)
#if ANY(BEZIER_CURVE_SUPPORT, ARC_SUPPORT)
case 'I' ... 'J': case 'P':
if (TERN1(BEZIER_CURVE_SUPPORT, motion_mode_codenum != 5)
&& TERN1(ARC_P_CIRCLES, !WITHIN(motion_mode_codenum, 2, 3))
) return;
#endif
#if ENABLED(BEZIER_CURVE_SUPPORT)
case 'Q': if (motion_mode_codenum != 5) return;
#endif
#if ENABLED(ARC_SUPPORT)
case 'R': if (!WITHIN(motion_mode_codenum, 2, 3)) return;
#endif
LOGICAL_AXIS_GANG(case 'E':, case 'X':, case 'Y':, case 'Z':, case AXIS4_NAME:, case AXIS5_NAME:, case AXIS6_NAME:, case AXIS7_NAME:, case AXIS8_NAME:, case AXIS9_NAME:)
case 'F':
if (motion_mode_codenum < 0) return;
command_letter = 'G';
codenum = motion_mode_codenum;
TERN_(USE_GCODE_SUBCODES, subcode = motion_mode_subcode);
p--; // Back up one character to use the current parameter
break;
#endif
default: return;
}
// The command parameters (if any) start here, for sure!
IF_DISABLED(FASTER_GCODE_PARSER, command_args = p); // Scan for parameters in seen()
// Only use string_arg for these M codes
if (letter == 'M') switch (codenum) {
TERN_(GCODE_MACROS, case 810 ... 819:)
TERN_(EXPECTED_PRINTER_CHECK, case 16:)
case 23: case 28: case 30: case 117 ... 118: case 928:
string_arg = unescape_string(p);
return;
default: break;
}
#if ENABLED(DEBUG_GCODE_PARSER)
const bool debug = codenum == 800;
#endif
/**
* Find all parameters, set flags and pointers for fast parsing
*
* Most codes ignore 'string_arg', but those that want a string will get the right pointer.
* The following loop assigns the first "parameter" having no numeric value to 'string_arg'.
* This allows M0/M1 with expire time to work: "M0 S5 You Win!"
* For 'M118' you must use 'E1' and 'A1' rather than just 'E' or 'A'
*/
#if ENABLED(GCODE_QUOTED_STRINGS)
bool quoted_string_arg = false;
#endif
string_arg = nullptr;
while (const char param = uppercase(*p++)) { // Get the next parameter. A NUL ends the loop
// Special handling for M32 [P] !/path/to/file.g#
// The path must be the last parameter
if (param == '!' && is_command('M', 32)) {
string_arg = p; // Name starts after '!'
char * const lb = strchr(p, '#'); // Already seen '#' as SD char (to pause buffering)
if (lb) *lb = '\0'; // Safe to mark the end of the filename
return;
}
#if ENABLED(GCODE_QUOTED_STRINGS)
if (!quoted_string_arg && param == '"') {
quoted_string_arg = true;
string_arg = unescape_string(p);
}
#endif
#if ENABLED(FASTER_GCODE_PARSER)
// Arguments MUST be uppercase for fast G-Code parsing
#define PARAM_OK(P) WITHIN((P), 'A', 'Z')
#else
#define PARAM_OK(P) true
#endif
if (PARAM_OK(param)) {
while (*p == ' ') p++; // Skip spaces between parameters & values
#if ENABLED(GCODE_QUOTED_STRINGS)
const bool is_str = (*p == '"'), has_val = is_str || valid_float(p);
char * const valptr = has_val ? is_str ? unescape_string(p) : p : nullptr;
#else
const bool has_val = valid_float(p);
#if ENABLED(FASTER_GCODE_PARSER)
char * const valptr = has_val ? p : nullptr;
#endif
#endif
#if ENABLED(DEBUG_GCODE_PARSER)
if (debug) {
SERIAL_ECHOPGM("Got param ", C(param), " at index ", p - command_ptr - 1);
if (has_val) SERIAL_ECHOPGM(" (has_val)");
}
#endif
if (!has_val && !string_arg) { // No value? First time, keep as string_arg
string_arg = p - 1;
#if ENABLED(DEBUG_GCODE_PARSER)
if (debug) SERIAL_ECHOPGM(" string_arg: ", hex_address((void*)string_arg)); // DEBUG
#endif
}
if (TERN0(DEBUG_GCODE_PARSER, debug)) SERIAL_EOL();
TERN_(FASTER_GCODE_PARSER, set(param, valptr)); // Set parameter exists and pointer (nullptr for no value)
}
else if (!string_arg) { // Not A-Z? First time, keep as the string_arg
string_arg = p - 1;
#if ENABLED(DEBUG_GCODE_PARSER)
if (debug) SERIAL_ECHOPGM(" string_arg: ", hex_address((void*)string_arg)); // DEBUG
#endif
}
if (!WITHIN(*p, 'A', 'Z')) { // Another parameter right away?
while (*p && DECIMAL_SIGNED(*p)) p++; // Skip over the value section of a parameter
while (*p == ' ') p++; // Skip over all spaces
}
}
}
#if ENABLED(CNC_COORDINATE_SYSTEMS)
// Parse the next parameter as a new command
bool GCodeParser::chain() {
#if ENABLED(FASTER_GCODE_PARSER)
char *next_command = command_ptr;
if (next_command) {
while (*next_command && *next_command != ' ') ++next_command;
while (*next_command == ' ') ++next_command;
if (!*next_command) next_command = nullptr;
}
#else
const char *next_command = command_args;
#endif
if (next_command) parse(next_command);
return !!next_command;
}
#endif // CNC_COORDINATE_SYSTEMS
void GCodeParser::unknown_command_warning() {
SERIAL_ECHO_MSG(STR_UNKNOWN_COMMAND, command_ptr, "\"");
}
#if ENABLED(DEBUG_GCODE_PARSER)
void GCodeParser::debug() {
SERIAL_ECHOPGM("Command: ", command_ptr, " (", command_letter);
SERIAL_ECHO(codenum);
SERIAL_ECHOLNPGM(")");
#if ENABLED(FASTER_GCODE_PARSER)
SERIAL_ECHOPGM(" args: { ");
for (char c = 'A'; c <= 'Z'; ++c) if (seen(c)) SERIAL_CHAR(c, ' ');
SERIAL_CHAR('}');
#else
SERIAL_ECHOPGM(" args: { ", command_args, " }");
#endif
if (string_arg) {
SERIAL_ECHOPGM(" string: \"", string_arg);
SERIAL_CHAR('"');
}
SERIAL_ECHOLNPGM("\n");
for (char c = 'A'; c <= 'Z'; ++c) {
if (seen(c)) {
SERIAL_ECHOPGM("Code '", c); SERIAL_ECHOPGM("':");
if (has_value()) {
SERIAL_ECHOLNPGM(
"\n float: ", value_float(),
"\n long: ", value_long(),
"\n ulong: ", value_ulong(),
"\n millis: ", value_millis(),
"\n sec-ms: ", value_millis_from_seconds(),
"\n int: ", value_int(),
"\n ushort: ", value_ushort(),
"\n byte: ", value_byte(),
"\n bool: ", value_bool(),
"\n linear: ", value_linear_units(),
"\n celsius: ", value_celsius()
);
}
else
SERIAL_ECHOLNPGM(" (no value)");
}
}
}
#endif // DEBUG_GCODE_PARSER
|
2301_81045437/Marlin
|
Marlin/src/gcode/parser.cpp
|
C++
|
agpl-3.0
| 14,015
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#pragma once
/**
* parser.h - Parser for a G-Code line, providing a parameter interface.
* Codes like M149 control the way the G-Code parser behaves,
* so settings for these codes are located in this class.
*/
#include "../inc/MarlinConfig.h"
//#define DEBUG_GCODE_PARSER
#if ENABLED(DEBUG_GCODE_PARSER)
#include "../libs/hex_print.h"
#endif
#if ENABLED(TEMPERATURE_UNITS_SUPPORT)
typedef enum : uint8_t { TEMPUNIT_C, TEMPUNIT_K, TEMPUNIT_F } TempUnit;
#endif
#if ENABLED(INCH_MODE_SUPPORT)
typedef enum : uint8_t { LINEARUNIT_MM, LINEARUNIT_INCH } LinearUnit;
#endif
/**
* G-Code parser
*
* - Parse a single G-code line for its letter, code, subcode, and parameters
* - FASTER_GCODE_PARSER:
* - Flags existing params (1 bit each)
* - Stores value offsets (1 byte each)
* - Provide accessors for parameters:
* - Parameter exists
* - Parameter has value
* - Parameter value in different units and types
*/
class GCodeParser {
private:
static char *value_ptr; // Set by seen, used to fetch the value
#if ENABLED(FASTER_GCODE_PARSER)
static uint32_t codebits; // Parameters pre-scanned
static uint8_t param[26]; // For A-Z, offsets into command args
#else
static char *command_args; // Args start here, for slow scan
#endif
public:
// Global states for G-Code-level units features
static bool volumetric_enabled;
#if ENABLED(INCH_MODE_SUPPORT)
static float linear_unit_factor, volumetric_unit_factor;
#endif
#if ENABLED(TEMPERATURE_UNITS_SUPPORT)
static TempUnit input_temp_units;
#endif
// Command line state
static char *command_ptr, // The command, so it can be echoed
*string_arg, // string of command line
command_letter; // G, M, or T
static uint16_t codenum; // 123
#if USE_GCODE_SUBCODES
static uint8_t subcode; // .1
#endif
#if ENABLED(GCODE_MOTION_MODES)
static int16_t motion_mode_codenum;
#if USE_GCODE_SUBCODES
static uint8_t motion_mode_subcode;
#endif
FORCE_INLINE static void cancel_motion_mode() { motion_mode_codenum = -1; }
#endif
#if ENABLED(DEBUG_GCODE_PARSER)
static void debug();
#endif
// Reset is done before parsing
static void reset();
#define LETTER_BIT(N) ((N) - 'A')
FORCE_INLINE static bool valid_signless(const char * const p) {
return NUMERIC(p[0]) || (p[0] == '.' && NUMERIC(p[1])); // .?[0-9]
}
FORCE_INLINE static bool valid_float(const char * const p) {
return valid_signless(p) || ((p[0] == '-' || p[0] == '+') && valid_signless(&p[1])); // [-+]?.?[0-9]
}
FORCE_INLINE static bool valid_number(const char * const p) {
// TODO: With MARLIN_DEV_MODE allow HEX values starting with "x"
return valid_float(p);
}
#if ENABLED(FASTER_GCODE_PARSER)
FORCE_INLINE static bool valid_int(const char * const p) {
return NUMERIC(p[0]) || ((p[0] == '-' || p[0] == '+') && NUMERIC(p[1])); // [-+]?[0-9]
}
// Set the flag and pointer for a parameter
static void set(const char c, char * const ptr) {
const uint8_t ind = LETTER_BIT(c);
if (ind >= COUNT(param)) return; // Only A-Z
SBI32(codebits, ind); // parameter exists
param[ind] = ptr ? ptr - command_ptr : 0; // parameter offset or 0
#if ENABLED(DEBUG_GCODE_PARSER)
if (codenum == 800) {
SERIAL_ECHOPGM("Set bit ", ind, " of codebits (", hex_address((void*)(codebits >> 16)));
print_hex_word((uint16_t)(codebits & 0xFFFF));
SERIAL_ECHOLNPGM(") | param = ", param[ind]);
}
#endif
}
// Code seen bit was set. If not found, value_ptr is unchanged.
// This allows "if (seen('A')||seen('B'))" to use the last-found value.
static bool seen(const char c) {
const uint8_t ind = LETTER_BIT(c);
if (ind >= COUNT(param)) return false; // Only A-Z
const bool b = TEST32(codebits, ind);
if (b) {
if (param[ind]) {
char * const ptr = command_ptr + param[ind];
value_ptr = valid_number(ptr) ? ptr : nullptr;
}
else
value_ptr = nullptr;
}
return b;
}
FORCE_INLINE static constexpr uint32_t letter_bits(const char * const str) {
return (str[0] ? _BV32(LETTER_BIT(str[0])) |
(str[1] ? _BV32(LETTER_BIT(str[1])) |
(str[2] ? _BV32(LETTER_BIT(str[2])) |
(str[3] ? _BV32(LETTER_BIT(str[3])) |
(str[4] ? _BV32(LETTER_BIT(str[4])) |
(str[5] ? _BV32(LETTER_BIT(str[5])) |
(str[6] ? _BV32(LETTER_BIT(str[6])) |
(str[7] ? _BV32(LETTER_BIT(str[7])) |
(str[8] ? _BV32(LETTER_BIT(str[8])) |
(str[9] ? _BV32(LETTER_BIT(str[9]))
: 0) : 0) : 0) : 0) : 0) : 0) : 0) : 0) : 0) : 0);
}
// At least one of a list of code letters was seen
#ifdef CPU_32_BIT
FORCE_INLINE static bool seen(const char * const str) { return !!(codebits & letter_bits(str)); }
#else
FORCE_INLINE static bool seen(const char * const str) {
const uint32_t letrbits = letter_bits(str);
const uint8_t * const cb = (uint8_t*)&codebits;
const uint8_t * const lb = (uint8_t*)&letrbits;
return (cb[0] & lb[0]) || (cb[1] & lb[1]) || (cb[2] & lb[2]) || (cb[3] & lb[3]);
}
#endif
static bool seen_any() { return !!codebits; }
FORCE_INLINE static bool seen_test(const char c) { return TEST32(codebits, LETTER_BIT(c)); }
#else // !FASTER_GCODE_PARSER
#if ENABLED(GCODE_CASE_INSENSITIVE)
FORCE_INLINE static char* strgchr(char *p, char g) {
auto uppercase = [](char c) {
return c + (WITHIN(c, 'a', 'z') ? 'A' - 'a' : 0);
};
const char d = uppercase(g);
for (char cc; (cc = uppercase(*p)); p++) if (cc == d) return p;
return nullptr;
}
#else
#define strgchr strchr
#endif
// Code is found in the string. If not found, value_ptr is unchanged.
// This allows "if (seen('A')||seen('B'))" to use the last-found value.
static bool seen(const char c) {
char *p = strgchr(command_args, c);
const bool b = !!p;
if (b) value_ptr = valid_number(&p[1]) ? &p[1] : nullptr;
return b;
}
static bool seen_any() { return *command_args == '\0'; }
FORCE_INLINE static bool seen_test(const char c) { return (bool)strgchr(command_args, c); }
// At least one of a list of code letters was seen
static bool seen(const char * const str) {
for (uint8_t i = 0; const char c = str[i]; i++)
if (seen_test(c)) return true;
return false;
}
#endif // !FASTER_GCODE_PARSER
// Seen any axis parameter
static bool seen_axis() { return seen(STR_AXES_LOGICAL); }
#if ENABLED(GCODE_QUOTED_STRINGS)
static char* unescape_string(char* &src);
#else
FORCE_INLINE static char* unescape_string(char* &src) { return src; }
#endif
// Populate all fields by parsing a single line of G-Code
// This uses 54 bytes of SRAM to speed up seen/value
static void parse(char * p);
#if ENABLED(CNC_COORDINATE_SYSTEMS)
// Parse the next parameter as a new command
static bool chain();
#endif
// Test whether the parsed command matches the input
static bool is_command(const char ltr, const uint16_t num) { return command_letter == ltr && codenum == num; }
// The code value pointer was set
FORCE_INLINE static bool has_value() { return !!value_ptr; }
// Seen a parameter with a value
static bool seenval(const char c) { return seen(c) && has_value(); }
// The value as a string
static char* value_string() { return value_ptr; }
// Float removes 'E' to prevent scientific notation interpretation
static float value_float() {
if (!value_ptr) return 0;
char *e = value_ptr;
for (;;) {
const char c = *e;
if (c == '\0' || c == ' ') break;
if (c == 'E' || c == 'e' || c == 'X' || c == 'x') {
*e = '\0';
const float ret = strtof(value_ptr, nullptr);
*e = c;
return ret;
}
++e;
}
return strtof(value_ptr, nullptr);
}
// Code value as a long or ulong
static int32_t value_long() { return value_ptr ? strtol(value_ptr, nullptr, 10) : 0L; }
static uint32_t value_ulong() { return value_ptr ? strtoul(value_ptr, nullptr, 10) : 0UL; }
// Code value for use as time
static millis_t value_millis() { return value_ulong(); }
static millis_t value_millis_from_seconds() { return (millis_t)SEC_TO_MS(value_float()); }
// Reduce to fewer bits
static int16_t value_int() { return (int16_t)value_long(); }
static uint16_t value_ushort() { return (uint16_t)value_long(); }
static uint8_t value_byte() { return (uint8_t)constrain(value_long(), 0, 255); }
// Bool is true with no value or non-zero
static bool value_bool() { return !has_value() || !!value_byte(); }
static constexpr bool axis_is_rotational(const AxisEnum axis) {
return (false
|| TERN0(AXIS4_ROTATES, axis == I_AXIS)
|| TERN0(AXIS5_ROTATES, axis == J_AXIS)
|| TERN0(AXIS6_ROTATES, axis == K_AXIS)
|| TERN0(AXIS7_ROTATES, axis == U_AXIS)
|| TERN0(AXIS8_ROTATES, axis == V_AXIS)
|| TERN0(AXIS9_ROTATES, axis == W_AXIS)
);
}
// Units modes: Inches, Fahrenheit, Kelvin
#if ENABLED(INCH_MODE_SUPPORT)
static float mm_to_linear_unit(const_float_t mm) { return mm / linear_unit_factor; }
static float mm_to_volumetric_unit(const_float_t mm) { return mm / (volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); }
// Init linear units by constructor
GCodeParser() { set_input_linear_units(LINEARUNIT_MM); }
static void set_input_linear_units(const LinearUnit units) {
switch (units) {
default:
case LINEARUNIT_MM: linear_unit_factor = 1.0f; break;
case LINEARUNIT_INCH: linear_unit_factor = 25.4f; break;
}
volumetric_unit_factor = POW(linear_unit_factor, 3);
}
static float axis_unit_factor(const AxisEnum axis) {
if (axis_is_rotational(axis)) return 1.0f;
#if HAS_EXTRUDERS
if (axis >= E_AXIS && volumetric_enabled) return volumetric_unit_factor;
#endif
return linear_unit_factor;
}
static float linear_value_to_mm(const_float_t v) { return v * linear_unit_factor; }
static float axis_value_to_mm(const AxisEnum axis, const float v) { return v * axis_unit_factor(axis); }
static float per_axis_value(const AxisEnum axis, const float v) { return v / axis_unit_factor(axis); }
#else
static constexpr float mm_to_linear_unit(const_float_t mm) { return mm; }
static constexpr float mm_to_volumetric_unit(const_float_t mm) { return mm; }
static constexpr float linear_value_to_mm(const_float_t v) { return v; }
static constexpr float axis_value_to_mm(const AxisEnum, const float v) { return v; }
static constexpr float per_axis_value(const AxisEnum, const float v) { return v; }
#endif
static bool using_inch_units() { return mm_to_linear_unit(1.0f) != 1.0f; }
#define IN_TO_MM(I) ((I) * 25.4f)
#define MM_TO_IN(M) ((M) / 25.4f)
#define LINEAR_UNIT(V) parser.mm_to_linear_unit(V)
#define VOLUMETRIC_UNIT(V) parser.mm_to_volumetric_unit(V)
#define I_AXIS_UNIT(V) TERN(AXIS4_ROTATES, (V), LINEAR_UNIT(V))
#define J_AXIS_UNIT(V) TERN(AXIS5_ROTATES, (V), LINEAR_UNIT(V))
#define K_AXIS_UNIT(V) TERN(AXIS6_ROTATES, (V), LINEAR_UNIT(V))
#define U_AXIS_UNIT(V) TERN(AXIS7_ROTATES, (V), LINEAR_UNIT(V))
#define V_AXIS_UNIT(V) TERN(AXIS8_ROTATES, (V), LINEAR_UNIT(V))
#define W_AXIS_UNIT(V) TERN(AXIS9_ROTATES, (V), LINEAR_UNIT(V))
static float value_linear_units() { return linear_value_to_mm(value_float()); }
static float value_axis_units(const AxisEnum axis) { return axis_value_to_mm(axis, value_float()); }
static float value_per_axis_units(const AxisEnum axis) { return per_axis_value(axis, value_float()); }
#if ENABLED(TEMPERATURE_UNITS_SUPPORT)
static void set_input_temp_units(const TempUnit units) { input_temp_units = units; }
static char temp_units_code() {
return input_temp_units == TEMPUNIT_K ? 'K' : input_temp_units == TEMPUNIT_F ? 'F' : 'C';
}
static FSTR_P temp_units_name() {
return input_temp_units == TEMPUNIT_K ? F("Kelvin") : input_temp_units == TEMPUNIT_F ? F("Fahrenheit") : F("Celsius");
}
#if HAS_MARLINUI_MENU && DISABLED(DISABLE_M503)
static float to_temp_units(celsius_t c) {
switch (input_temp_units) {
default:
case TEMPUNIT_C: return c;
case TEMPUNIT_K: return c + 273.15f;
case TEMPUNIT_F: return c * 0.5555555556f + 32;
}
}
#endif // HAS_MARLINUI_MENU && !DISABLE_M503
static celsius_t value_celsius() {
float f = value_float();
switch (input_temp_units) {
default:
case TEMPUNIT_C: break;
case TEMPUNIT_K: f -= 273.15f;
case TEMPUNIT_F: f = (f - 32) * 0.5555555556f;
}
return LROUND(f);
}
static celsius_t value_celsius_diff() {
float f = value_float();
switch (input_temp_units) {
default:
case TEMPUNIT_C:
case TEMPUNIT_K: break;
case TEMPUNIT_F: f *= 0.5555555556f;
}
return LROUND(f);
}
#else // !TEMPERATURE_UNITS_SUPPORT
static constexpr float to_temp_units(int16_t c) { return (float)c; }
static celsius_t value_celsius() { return value_int(); }
static celsius_t value_celsius_diff() { return value_int(); }
#endif // !TEMPERATURE_UNITS_SUPPORT
static feedRate_t value_feedrate() { return MMM_TO_MMS(value_linear_units()); }
void unknown_command_warning();
// Provide simple value accessors with default option
static char* stringval(const char c, char * const dval=nullptr) { return seenval(c) ? value_string() : dval; }
static float floatval(const char c, const float dval=0.0) { return seenval(c) ? value_float() : dval; }
static bool boolval(const char c, const bool dval=false) { return seenval(c) ? value_bool() : (seen(c) ? true : dval); }
static uint8_t byteval(const char c, const uint8_t dval=0) { return seenval(c) ? value_byte() : dval; }
static int16_t intval(const char c, const int16_t dval=0) { return seenval(c) ? value_int() : dval; }
static uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort() : dval; }
static int32_t longval(const char c, const int32_t dval=0) { return seenval(c) ? value_long() : dval; }
static uint32_t ulongval(const char c, const uint32_t dval=0) { return seenval(c) ? value_ulong() : dval; }
static float linearval(const char c, const float dval=0) { return seenval(c) ? value_linear_units() : dval; }
static float axisunitsval(const char c, const AxisEnum a, const float dval=0)
{ return seenval(c) ? value_axis_units(a) : dval; }
static celsius_t celsiusval(const char c, const celsius_t dval=0) { return seenval(c) ? value_celsius() : dval; }
static feedRate_t feedrateval(const char c, const feedRate_t dval=0) { return seenval(c) ? value_feedrate() : dval; }
#if ENABLED(MARLIN_DEV_MODE)
static uint8_t* hex_adr_val(const char c, uint8_t * const dval=nullptr) {
if (!seen(c) || *value_ptr != 'x') return dval;
uint8_t *out = nullptr;
for (char *vp = value_ptr + 1; HEXCHR(*vp) >= 0; vp++)
out = (uint8_t*)((uintptr_t(out) << 8) | HEXCHR(*vp));
return out;
}
static uint16_t hex_val(const char c, uint16_t const dval=0) {
if (!seen(c) || *value_ptr != 'x') return dval;
uint16_t out = 0;
for (char *vp = value_ptr + 1; HEXCHR(*vp) >= 0; vp++)
out = ((out) << 8) | HEXCHR(*vp);
return out;
}
#endif
};
extern GCodeParser parser;
|
2301_81045437/Marlin
|
Marlin/src/gcode/parser.h
|
C++
|
agpl-3.0
| 17,055
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_BED_PROBE
#include "../gcode.h"
#include "../../module/motion.h"
#include "../../module/probe.h"
#include "../../feature/bedlevel/bedlevel.h"
#include "../../lcd/marlinui.h"
#if HAS_PTC
#include "../../feature/probe_temp_comp.h"
#endif
#if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
#define VERBOSE_SINGLE_PROBE
#endif
/**
* G30: Do a single Z probe at the given XY (default: current)
*
* Parameters:
*
* X Probe X position (default current X)
* Y Probe Y position (default current Y)
* E Engage the probe for each probe (default 1)
* C Enable probe temperature compensation (0 or 1, default 1)
*/
void GcodeSuite::G30() {
xy_pos_t old_pos = current_position,
probepos = current_position;
const bool seenX = parser.seenval('X');
if (seenX) probepos.x = RAW_X_POSITION(parser.value_linear_units());
const bool seenY = parser.seenval('Y');
if (seenY) probepos.y = RAW_Y_POSITION(parser.value_linear_units());
probe.use_probing_tool();
if (probe.can_reach(probepos)) {
if (seenX) old_pos.x = probepos.x;
if (seenY) old_pos.y = probepos.y;
// Disable leveling so the planner won't mess with us
TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
remember_feedrate_scaling_off();
TERN_(VERBOSE_SINGLE_PROBE, process_subcommands_now(F("G28O")));
const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE;
TERN_(HAS_PTC, ptc.set_enabled(parser.boolval('C', true)));
const float measured_z = probe.probe_at_point(probepos, raise_after);
TERN_(HAS_PTC, ptc.set_enabled(true));
if (!isnan(measured_z)) {
const xy_pos_t lpos = probepos.asLogical();
SString<30> msg(
F("Bed X:"), p_float_t(lpos.x, 2),
F( " Y:"), p_float_t(lpos.y, 2),
F( " Z:"), p_float_t(measured_z, 3)
);
msg.echoln();
TERN_(VERBOSE_SINGLE_PROBE, ui.set_status(msg));
}
restore_feedrate_and_scaling();
do_blocking_move_to(old_pos);
if (raise_after == PROBE_PT_STOW)
probe.move_z_after_probing();
report_current_position();
}
else {
SERIAL_ECHOLN(GET_EN_TEXT_F(MSG_ZPROBE_OUT));
LCD_MESSAGE(MSG_ZPROBE_OUT);
}
probe.use_probing_tool(false);
}
#endif // HAS_BED_PROBE
|
2301_81045437/Marlin
|
Marlin/src/gcode/probe/G30.cpp
|
C++
|
agpl-3.0
| 3,186
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(Z_PROBE_SLED)
#include "../gcode.h"
#include "../../module/probe.h"
/**
* G31: Deploy the Z probe
*/
void GcodeSuite::G31() { probe.deploy(); }
/**
* G32: Stow the Z probe
*/
void GcodeSuite::G32() { probe.stow(); }
#endif // Z_PROBE_SLED
|
2301_81045437/Marlin
|
Marlin/src/gcode/probe/G31_G32.cpp
|
C++
|
agpl-3.0
| 1,159
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(G38_PROBE_TARGET)
#include "../gcode.h"
#include "../../module/endstops.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#include "../../module/probe.h"
inline void G38_single_probe(const uint8_t move_value) {
endstops.enable(true);
G38_move = move_value;
prepare_line_to_destination();
planner.synchronize();
G38_move = 0;
endstops.hit_on_purpose();
set_current_from_steppers_for_axis(ALL_AXES_ENUM);
sync_plan_position();
}
inline bool G38_run_probe() {
bool G38_pass_fail = false;
#if MULTIPLE_PROBING > 1
// Get direction of move and retract
xyz_float_t retract_mm;
LOOP_NUM_AXES(i) {
const float dist = destination[i] - current_position[i];
retract_mm[i] = ABS(dist) < G38_MINIMUM_MOVE ? 0 : home_bump_mm((AxisEnum)i) * (dist > 0 ? -1 : 1);
}
#endif
planner.synchronize(); // wait until the machine is idle
// Move flag value
#if ENABLED(G38_PROBE_AWAY)
const uint8_t move_value = parser.subcode;
#else
constexpr uint8_t move_value = 1;
#endif
G38_did_trigger = false;
// Move until destination reached or target hit
G38_single_probe(move_value);
if (G38_did_trigger) {
G38_pass_fail = true;
#if MULTIPLE_PROBING > 1
// Move away by the retract distance
destination = current_position + retract_mm;
endstops.enable(false);
prepare_line_to_destination();
planner.synchronize();
REMEMBER(fr, feedrate_mm_s, feedrate_mm_s * 0.25);
// Bump the target more slowly
destination -= retract_mm * 2;
G38_single_probe(move_value);
#endif
}
endstops.not_homing();
return G38_pass_fail;
}
/**
* G38 Probe Target
*
* G38.2 - Probe toward workpiece, stop on contact, signal error if failure
* G38.3 - Probe toward workpiece, stop on contact
*
* With G38_PROBE_AWAY:
*
* G38.4 - Probe away from workpiece, stop on contact break, signal error if failure
* G38.5 - Probe away from workpiece, stop on contact break
*/
void GcodeSuite::G38(const int8_t subcode) {
// Get X Y Z E F
get_destination_from_command();
remember_feedrate_scaling_off();
const bool error_on_fail = TERN(G38_PROBE_AWAY, !TEST(subcode, 0), subcode == 2);
// If any axis has enough movement, do the move
LOOP_NUM_AXES(i)
if (ABS(destination[i] - current_position[i]) >= G38_MINIMUM_MOVE) {
if (!parser.seenval('F')) feedrate_mm_s = homing_feedrate((AxisEnum)i);
// If G38.2 fails throw an error
if (!G38_run_probe() && error_on_fail) SERIAL_ERROR_MSG("Failed to reach target");
break;
}
restore_feedrate_and_scaling();
}
#endif // G38_PROBE_TARGET
|
2301_81045437/Marlin
|
Marlin/src/gcode/probe/G38.cpp
|
C++
|
agpl-3.0
| 3,571
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2022 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/>.
*
*/
/**
* M102.cpp - Configure Bed Distance Sensor
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(BD_SENSOR)
#include "../gcode.h"
#include "../../feature/bedlevel/bdl/bdl.h"
#include "../../MarlinCore.h" // for printingIsActive
/**
* M102: Configure the Bed Distance Sensor
*
* M102 S<10ths> : Set adjustable Z height in 10ths of a mm (e.g., 'M102 S4' enables adjusting for Z <= 0.4mm.)
* M102 S0 : Disable adjustable Z height.
*
* Negative S values are commands:
* M102 S-1 : Read BDsensor version
* M102 S-2 : Read BDsensor distance value
* M102 S-5 : Read raw Calibration data
* M102 S-6 : Start Calibration
*/
void GcodeSuite::M102() {
if (bdl.config_state < BDS_IDLE) {
SERIAL_ECHOLNPGM("BDsensor is busy:", bdl.config_state);
return;
}
if (parser.seenval('S')) {
const int8_t command = parser.value_int();
if (command == BDS_READ_MM)
SERIAL_ECHOLNPGM("Bed Distance:", bdl.read(), "mm");
else if ((command < BDS_IDLE) && printingIsActive())
return;
else
bdl.config_state = command;
}
}
#endif // BD_SENSOR
|
2301_81045437/Marlin
|
Marlin/src/gcode/probe/M102.cpp
|
C++
|
agpl-3.0
| 1,985
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_BED_PROBE
#include "../gcode.h"
#include "../../module/motion.h"
#include "../../module/probe.h"
#if HAS_BLTOUCH_HS_MODE
#include "../../feature/bltouch.h"
#endif
/**
* M401: Deploy and activate the Z probe
*
* With BLTOUCH_HS_MODE:
* H Report the current BLTouch HS mode state and exit
* S<bool> Set High Speed (HS) Mode and exit without deploy
*
* R<bool> Remain in place after deploying (and before activating) the probe
*/
void GcodeSuite::M401() {
#if HAS_BLTOUCH_HS_MODE
const bool seenH = parser.seen_test('H'),
seenS = parser.seen('S');
if (seenH || seenS) {
if (seenS) bltouch.high_speed_mode = parser.value_bool();
SERIAL_ECHO_START();
SERIAL_ECHOPGM("BLTouch HS mode ");
serialprintln_onoff(bltouch.high_speed_mode);
return;
}
#endif
probe.deploy(parser.boolval('R'));
TERN_(PROBE_TARE, probe.tare());
report_current_position();
}
/**
* M402: Deactivate and stow the Z probe
* R<bool> Remain in place after stowing (and before deactivating) the probe
*/
void GcodeSuite::M402() {
probe.stow(parser.boolval('R'));
#ifdef Z_AFTER_PROBING
do_z_clearance(Z_AFTER_PROBING);
#endif
report_current_position();
}
#endif // HAS_BED_PROBE
|
2301_81045437/Marlin
|
Marlin/src/gcode/probe/M401_M402.cpp
|
C++
|
agpl-3.0
| 2,156
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2022 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/>.
*
*/
/**
* M423.cpp - X-Axis Twist Compensation
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(X_AXIS_TWIST_COMPENSATION)
#include "../gcode.h"
#include "../../feature/x_twist.h"
#include "../../module/probe.h"
/**
* M423: Set a Z offset for X-Twist (added to the mesh on future G29).
* M423 [R] [A<startx>] [I<interval>] [X<index> Z<offset>]
*
* R - Reset the twist compensation data
* A<linear> - Set the X twist starting X position
* E<linear> - Set the X twist ending X position
* I<linear> - Set the X twist X-spacing directly
* X<index> - Index of a Z value in the list
* Z<linear> - A Z value to set
*/
void GcodeSuite::M423() {
bool do_report = true;
float new_spacing = 0;
if (parser.seen_test('R')) {
do_report = false;
xatc.reset();
}
if (parser.seenval('A')) {
do_report = false;
xatc.start = parser.value_float();
new_spacing = (probe.max_x() - xatc.start) / (XATC_MAX_POINTS - 1);
}
if (parser.seenval('E')) {
do_report = false;
new_spacing = (parser.value_float() - xatc.start) / (XATC_MAX_POINTS - 1);
}
else if (parser.seenval('I')) {
do_report = false;
new_spacing = parser.value_float();
}
if (new_spacing) xatc.spacing = new_spacing;
if (parser.seenval('X')) {
do_report = false;
const int8_t x = parser.value_int();
if (!WITHIN(x, 0, XATC_MAX_POINTS - 1))
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(X) out of range (0..", XATC_MAX_POINTS - 1, ")."));
else {
if (parser.seenval('Z'))
xatc.z_offset[x] = parser.value_linear_units();
else
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(Z) required."));
}
}
if (do_report) M423_report();
}
void GcodeSuite::M423_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F("X-Twist Correction"));
SERIAL_ECHOLNPGM(" M423 A", xatc.start, " I", xatc.spacing);
for (uint8_t x = 0; x < XATC_MAX_POINTS; ++x) {
const float z = xatc.z_offset[x];
SERIAL_ECHOPGM(" M423 X", x, " Z");
serial_offset(isnan(z) ? 0 : z);
SERIAL_EOL();
}
}
#endif // X_AXIS_TWIST_COMPENSATION
|
2301_81045437/Marlin
|
Marlin/src/gcode/probe/M423.cpp
|
C++
|
agpl-3.0
| 3,009
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_BED_PROBE
#include "../gcode.h"
#include "../../feature/bedlevel/bedlevel.h"
#include "../../module/probe.h"
/**
* M851: Set the nozzle-to-probe offsets in current units
*/
void GcodeSuite::M851() {
// No parameters? Show current state.
if (!parser.seen("XYZ")) return M851_report();
// Start with current offsets and modify
xyz_pos_t offs = probe.offset;
// Assume no errors
bool ok = true;
if (parser.seenval('X')) {
const float x = parser.value_float();
#if HAS_PROBE_XY_OFFSET
if (WITHIN(x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX))
offs.x = x;
else {
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("X out of range (", PROBE_OFFSET_XMIN, " to ", PROBE_OFFSET_XMAX, ")"));
ok = false;
}
#else
if (x) SERIAL_ECHOLNPGM(GCODE_ERR_MSG("X must be 0 (NOZZLE_AS_PROBE).")); // ...but let 'ok' stay true
#endif
}
if (parser.seenval('Y')) {
const float y = parser.value_float();
#if HAS_PROBE_XY_OFFSET
if (WITHIN(y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX))
offs.y = y;
else {
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Y out of range (", PROBE_OFFSET_YMIN, " to ", PROBE_OFFSET_YMAX, ")"));
ok = false;
}
#else
if (y) SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Y must be 0 (NOZZLE_AS_PROBE).")); // ...but let 'ok' stay true
#endif
}
if (parser.seenval('Z')) {
const float z = parser.value_float();
if (WITHIN(z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX))
offs.z = z;
else {
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Z out of range (", PROBE_OFFSET_ZMIN, " to ", PROBE_OFFSET_ZMAX, ")"));
ok = false;
}
}
// Save the new offsets
if (ok) probe.offset = offs;
}
void GcodeSuite::M851_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_Z_PROBE_OFFSET));
SERIAL_ECHOPGM_P(
#if HAS_PROBE_XY_OFFSET
PSTR(" M851 X"), LINEAR_UNIT(probe.offset_xy.x),
SP_Y_STR, LINEAR_UNIT(probe.offset_xy.y),
SP_Z_STR
#else
PSTR(" M851 X0 Y0 Z")
#endif
, LINEAR_UNIT(probe.offset.z)
, PSTR(" ;")
);
say_units();
}
#endif // HAS_BED_PROBE
|
2301_81045437/Marlin
|
Marlin/src/gcode/probe/M851.cpp
|
C++
|
agpl-3.0
| 3,094
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(MAGNETIC_PARKING_EXTRUDER)
#include "../gcode.h"
#include "../../module/tool_change.h"
#include "../../module/motion.h"
mpe_settings_t mpe_settings;
inline void mpe_settings_report() {
SERIAL_ECHO_MSG("Magnetic Parking Extruder");
SERIAL_ECHO_MSG("L: Left parking :", mpe_settings.parking_xpos[0]);
SERIAL_ECHO_MSG("R: Right parking :", mpe_settings.parking_xpos[1]);
SERIAL_ECHO_MSG("I: Grab Offset :", mpe_settings.grab_distance);
SERIAL_ECHO_MSG("J: Normal speed :", long(MMS_TO_MMM(mpe_settings.slow_feedrate)));
SERIAL_ECHO_MSG("H: High speed :", long(MMS_TO_MMM(mpe_settings.fast_feedrate)));
SERIAL_ECHO_MSG("D: Distance trav.:", mpe_settings.travel_distance);
SERIAL_ECHO_MSG("C: Compenstion :", mpe_settings.compensation_factor);
}
void mpe_settings_init() {
constexpr float pex[2] = PARKING_EXTRUDER_PARKING_X;
mpe_settings.parking_xpos[0] = pex[0]; // M951 L
mpe_settings.parking_xpos[1] = pex[1]; // M951 R
mpe_settings.grab_distance = PARKING_EXTRUDER_GRAB_DISTANCE; // M951 I
TERN_(HAS_HOME_OFFSET, set_home_offset(X_AXIS, -mpe_settings.grab_distance));
mpe_settings.slow_feedrate = MMM_TO_MMS(MPE_SLOW_SPEED); // M951 J
mpe_settings.fast_feedrate = MMM_TO_MMS(MPE_FAST_SPEED); // M951 H
mpe_settings.travel_distance = MPE_TRAVEL_DISTANCE; // M951 D
mpe_settings.compensation_factor = MPE_COMPENSATION; // M951 C
mpe_settings_report();
}
void GcodeSuite::M951() {
if (parser.seenval('L')) mpe_settings.parking_xpos[0] = parser.value_linear_units();
if (parser.seenval('R')) mpe_settings.parking_xpos[1] = parser.value_linear_units();
if (parser.seenval('I')) {
mpe_settings.grab_distance = parser.value_linear_units();
TERN_(HAS_HOME_OFFSET, set_home_offset(X_AXIS, -mpe_settings.grab_distance));
}
if (parser.seenval('J')) mpe_settings.slow_feedrate = MMM_TO_MMS(parser.value_linear_units());
if (parser.seenval('H')) mpe_settings.fast_feedrate = MMM_TO_MMS(parser.value_linear_units());
if (parser.seenval('D')) mpe_settings.travel_distance = parser.value_linear_units();
if (parser.seenval('C')) mpe_settings.compensation_factor = parser.value_float();
if (!parser.seen("CDHIJLR")) mpe_settings_report();
}
#endif // MAGNETIC_PARKING_EXTRUDER
|
2301_81045437/Marlin
|
Marlin/src/gcode/probe/M951.cpp
|
C++
|
agpl-3.0
| 3,286
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
/**
* queue.cpp - The G-code command queue
*/
#include "queue.h"
GCodeQueue queue;
#include "gcode.h"
#include "../lcd/marlinui.h"
#include "../sd/cardreader.h"
#include "../module/motion.h"
#include "../module/planner.h"
#include "../module/temperature.h"
#include "../MarlinCore.h"
#include "../core/bug_on.h"
#if ENABLED(BINARY_FILE_TRANSFER)
#include "../feature/binary_stream.h"
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
#include "../feature/powerloss.h"
#endif
#if ENABLED(GCODE_REPEAT_MARKERS)
#include "../feature/repeat.h"
#endif
// Frequently used G-code strings
PGMSTR(G28_STR, "G28");
GCodeQueue::SerialState GCodeQueue::serial_state[NUM_SERIAL] = { 0 };
GCodeQueue::RingBuffer GCodeQueue::ring_buffer = { 0 };
#if NO_TIMEOUTS > 0
static millis_t last_command_time = 0;
#endif
/**
* Track buffer underruns
*/
#if ENABLED(BUFFER_MONITORING)
uint32_t GCodeQueue::command_buffer_underruns = 0,
GCodeQueue::planner_buffer_underruns = 0;
bool GCodeQueue::command_buffer_empty = false,
GCodeQueue::planner_buffer_empty = false;
millis_t GCodeQueue::max_command_buffer_empty_duration = 0,
GCodeQueue::max_planner_buffer_empty_duration = 0,
GCodeQueue::command_buffer_empty_at = 0,
GCodeQueue::planner_buffer_empty_at = 0;
uint8_t GCodeQueue::auto_buffer_report_interval;
millis_t GCodeQueue::next_buffer_report_ms;
#endif
/**
* Serial command injection
*/
/**
* Next Injected PROGMEM Command pointer. (nullptr == empty)
* Internal commands are enqueued ahead of serial / SD commands.
*/
PGM_P GCodeQueue::injected_commands_P; // = nullptr
/**
* Injected SRAM Commands
*/
char GCodeQueue::injected_commands[64]; // = { 0 }
/**
* Commit the accumulated G-code command to the ring buffer,
* also setting its origin info.
*/
void GCodeQueue::RingBuffer::commit_command(const bool skip_ok
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind/*=-1*/)
) {
commands[index_w].skip_ok = skip_ok;
TERN_(HAS_MULTI_SERIAL, commands[index_w].port = serial_ind);
TERN_(POWER_LOSS_RECOVERY, recovery.commit_sdpos(index_w));
advance_pos(index_w, 1);
}
/**
* Copy a command from RAM into the main command buffer.
* Return true if the command was successfully added.
* Return false for a full buffer, or if the 'command' is a comment.
*/
bool GCodeQueue::RingBuffer::enqueue(const char *cmd, const bool skip_ok/*=true*/
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind/*=-1*/)
) {
if (*cmd == ';' || length >= BUFSIZE) return false;
strcpy(commands[index_w].buffer, cmd);
commit_command(skip_ok OPTARG(HAS_MULTI_SERIAL, serial_ind));
return true;
}
/**
* Enqueue with Serial Echo
* Return true if the command was consumed
*/
bool GCodeQueue::enqueue_one(const char * const cmd) {
//SERIAL_ECHOLNPGM("enqueue_one(\"", cmd, "\")");
if (*cmd == 0 || ISEOL(*cmd)) return true;
if (ring_buffer.enqueue(cmd)) {
SERIAL_ECHO_MSG(STR_ENQUEUEING, cmd, "\"");
return true;
}
return false;
}
/**
* Process the next "immediate" command from PROGMEM.
* Return 'true' if any commands were processed.
*/
bool GCodeQueue::process_injected_command_P() {
if (!injected_commands_P) return false;
char c;
size_t i = 0;
while ((c = pgm_read_byte(&injected_commands_P[i])) && c != '\n') i++;
// Extract current command and move pointer to next command
char cmd[i + 1];
memcpy_P(cmd, injected_commands_P, i);
cmd[i] = '\0';
injected_commands_P = c ? injected_commands_P + i + 1 : nullptr;
// Execute command if non-blank
if (i) {
parser.parse(cmd);
gcode.process_parsed_command();
}
return true;
}
/**
* Process the next "immediate" command from SRAM.
* Return 'true' if any commands were processed.
*/
bool GCodeQueue::process_injected_command() {
if (injected_commands[0] == '\0') return false;
char c;
size_t i = 0;
while ((c = injected_commands[i]) && c != '\n') i++;
// Execute a non-blank command
if (i) {
injected_commands[i] = '\0';
parser.parse(injected_commands);
gcode.process_parsed_command();
}
// Copy the next command into place
for (
uint8_t d = 0, s = i + !!c; // dst, src
(injected_commands[d] = injected_commands[s]); // copy, exit if 0
d++, s++ // next dst, src
);
return true;
}
/**
* Enqueue and return only when commands are actually enqueued.
* Never call this from a G-code handler!
*/
void GCodeQueue::enqueue_one_now(const char * const cmd) { while (!enqueue_one(cmd)) idle(); }
void GCodeQueue::enqueue_one_now(FSTR_P const fcmd) { while (!enqueue_one(fcmd)) idle(); }
/**
* Attempt to enqueue a single G-code command
* and return 'true' if successful.
*/
bool GCodeQueue::enqueue_one(FSTR_P const fcmd) {
size_t i = 0;
PGM_P p = FTOP(fcmd);
char c;
while ((c = pgm_read_byte(&p[i])) && c != '\n') i++;
char cmd[i + 1];
memcpy_P(cmd, p, i);
cmd[i] = '\0';
return ring_buffer.enqueue(cmd);
}
/**
* Enqueue from program memory and return only when commands are actually enqueued
* Never call this from a G-code handler!
*/
void GCodeQueue::enqueue_now_P(PGM_P const pgcode) {
size_t i = 0;
PGM_P p = pgcode;
for (;;) {
char c;
while ((c = pgm_read_byte(&p[i])) && c != '\n') i++;
char cmd[i + 1];
memcpy_P(cmd, p, i);
cmd[i] = '\0';
enqueue_one_now(cmd);
if (!c) break;
p += i + 1;
}
}
/**
* Send an "ok" message to the host, indicating
* that a command was successfully processed.
*
* If ADVANCED_OK is enabled also include:
* N<int> Line number of the command, if any
* P<int> Planner space remaining
* B<int> Block queue space remaining
*/
void GCodeQueue::RingBuffer::ok_to_send() {
#if NO_TIMEOUTS > 0
// Start counting from the last command's execution
last_command_time = millis();
#endif
CommandLine &command = commands[index_r];
#if HAS_MULTI_SERIAL
const serial_index_t serial_ind = command.port;
if (!serial_ind.valid()) return; // Optimization here, skip processing if it's not going anywhere
PORT_REDIRECT(SERIAL_PORTMASK(serial_ind)); // Reply to the serial port that sent the command
#endif
if (command.skip_ok) return;
SERIAL_ECHOPGM(STR_OK);
#if ENABLED(ADVANCED_OK)
char* p = command.buffer;
if (*p == 'N') {
SERIAL_CHAR(' ', *p++);
while (NUMERIC_SIGNED(*p))
SERIAL_CHAR(*p++);
}
SERIAL_ECHOPGM_P(SP_P_STR, planner.moves_free(), SP_B_STR, BUFSIZE - length);
#endif
SERIAL_EOL();
}
/**
* Send a "Resend: nnn" message to the host to
* indicate that a command needs to be re-sent.
*/
void GCodeQueue::flush_and_request_resend(const serial_index_t serial_ind) {
#if HAS_MULTI_SERIAL
if (!serial_ind.valid()) return; // Optimization here, skip if the command came from SD or Flash Drive
PORT_REDIRECT(SERIAL_PORTMASK(serial_ind)); // Reply to the serial port that sent the command
#endif
SERIAL_FLUSH();
SERIAL_ECHOLNPGM(STR_RESEND, serial_state[serial_ind.index].last_N + 1);
SERIAL_ECHOLNPGM(STR_OK);
}
static bool serial_data_available(serial_index_t index) {
const int a = SERIAL_IMPL.available(index);
#if ENABLED(RX_BUFFER_MONITOR) && RX_BUFFER_SIZE
if (a > RX_BUFFER_SIZE - 2) {
PORT_REDIRECT(SERIAL_PORTMASK(index));
SERIAL_ERROR_MSG("RX BUF overflow, increase RX_BUFFER_SIZE: ", a);
}
#endif
return a > 0;
}
#if NO_TIMEOUTS > 0
// Multiserial already handles dispatch to/from multiple ports
static bool any_serial_data_available() {
for (uint8_t p = 0; p < NUM_SERIAL; ++p)
if (serial_data_available(p))
return true;
return false;
}
#endif
inline int read_serial(const serial_index_t index) { return SERIAL_IMPL.read(index); }
#if (defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32)) && defined(USBCON)
/**
* arduinoststm32's USB receive buffer is not well behaved when the buffer overflows
*
* This can happen when the host programs (such as Pronterface) automatically
* send M105 temperature requests.
*/
void GCodeQueue::flush_rx() {
// Flush receive buffer
for (uint8_t p = 0; p < NUM_SERIAL; ++p) {
if (!serial_data_available(p)) continue; // No data for this port? Skip.
while (SERIAL_IMPL.available(p)) (void)read_serial(p);
}
}
#endif // (ARDUINO_ARCH_STM32F4 || ARDUINO_ARCH_STM32) && USBCON
void GCodeQueue::gcode_line_error(FSTR_P const ferr, const serial_index_t serial_ind) {
PORT_REDIRECT(SERIAL_PORTMASK(serial_ind)); // Reply to the serial port that sent the command
SERIAL_ERROR_START();
SERIAL_ECHOLN(ferr, serial_state[serial_ind.index].last_N);
while (read_serial(serial_ind) != -1) { /* nada */ } // Clear out the RX buffer. Why don't use flush here ?
flush_and_request_resend(serial_ind);
serial_state[serial_ind.index].count = 0;
}
FORCE_INLINE bool is_M29(const char * const cmd) { // matches "M29" & "M29 ", but not "M290", etc
const char * const m29 = strstr_P(cmd, PSTR("M29"));
return m29 && !NUMERIC(m29[3]);
}
#define PS_NORMAL 0
#define PS_EOL 1
#define PS_QUOTED 2
#define PS_PAREN 3
#define PS_ESC 4
inline void process_stream_char(const char c, uint8_t &sis, char (&buff)[MAX_CMD_SIZE], int &ind) {
if (sis == PS_EOL) return; // EOL comment or overflow
#if ENABLED(PAREN_COMMENTS)
else if (sis == PS_PAREN) { // Inline comment
if (c == ')') sis = PS_NORMAL;
return;
}
#endif
else if (sis >= PS_ESC) // End escaped char
sis -= PS_ESC;
else if (c == '\\') { // Start escaped char
sis += PS_ESC;
if (sis == PS_ESC) return; // Keep if quoting
}
#if ENABLED(GCODE_QUOTED_STRINGS)
else if (sis == PS_QUOTED) {
if (c == '"') sis = PS_NORMAL; // End quoted string
}
else if (c == '"') // Start quoted string
sis = PS_QUOTED;
#endif
else if (c == ';') { // Start end-of-line comment
sis = PS_EOL;
return;
}
#if ENABLED(PAREN_COMMENTS)
else if (c == '(') { // Start inline comment
sis = PS_PAREN;
return;
}
#endif
// Backspace erases previous characters
if (c == 0x08) {
if (ind) buff[--ind] = '\0';
}
else {
buff[ind++] = c;
if (ind >= MAX_CMD_SIZE - 1)
sis = PS_EOL; // Skip the rest on overflow
}
}
/**
* Handle a line being completed. For an empty line
* keep sensor readings going and watchdog alive.
*/
inline bool process_line_done(uint8_t &sis, char (&buff)[MAX_CMD_SIZE], int &ind) {
sis = PS_NORMAL; // "Normal" Serial Input State
buff[ind] = '\0'; // Of course, I'm a Terminator.
const bool is_empty = (ind == 0); // An empty line?
if (is_empty)
thermalManager.task(); // Keep sensors satisfied
else
ind = 0; // Start a new line
return is_empty; // Inform the caller
}
/**
* Get all commands waiting on the serial port and queue them.
* Exit when the buffer is full or when no more characters are
* left on the serial port.
*/
void GCodeQueue::get_serial_commands() {
#if ENABLED(BINARY_FILE_TRANSFER)
if (card.flag.binary_mode) {
/**
* For binary stream file transfer, use serial_line_buffer as the working
* receive buffer (which limits the packet size to MAX_CMD_SIZE).
* The receive buffer also limits the packet size for reliable transmission.
*/
binaryStream[card.transfer_port_index.index].receive(serial_state[card.transfer_port_index.index].line_buffer);
return;
}
#endif
// If the command buffer is empty for too long,
// send "wait" to indicate Marlin is still waiting.
#if NO_TIMEOUTS > 0
const millis_t ms = millis();
if (ring_buffer.empty() && !any_serial_data_available() && ELAPSED(ms, last_command_time + NO_TIMEOUTS)) {
SERIAL_ECHOLNPGM(STR_WAIT);
last_command_time = ms;
}
#endif
// Loop while serial characters are incoming and the queue is not full
for (bool hadData = true; hadData;) {
// Unless a serial port has data, this will exit on next iteration
hadData = false;
for (uint8_t p = 0; p < NUM_SERIAL; ++p) {
// Check if the queue is full and exit if it is.
if (ring_buffer.full()) return;
// No data for this port ? Skip it
if (!serial_data_available(p)) continue;
// Ok, we have some data to process, let's make progress here
hadData = true;
const int c = read_serial(p);
if (c < 0) {
// This should never happen, let's log it
PORT_REDIRECT(SERIAL_PORTMASK(p)); // Reply to the serial port that sent the command
// Crash here to get more information why it failed
BUG_ON("SP available but read -1");
SERIAL_ERROR_MSG(STR_ERR_SERIAL_MISMATCH);
SERIAL_FLUSH();
continue;
}
const char serial_char = (char)c;
SerialState &serial = serial_state[p];
if (ISEOL(serial_char)) {
// Reset our state, continue if the line was empty
if (process_line_done(serial.input_state, serial.line_buffer, serial.count))
continue;
char* command = serial.line_buffer;
while (*command == ' ') command++; // Skip leading spaces
char *npos = (*command == 'N') ? command : nullptr; // Require the N parameter to start the line
if (npos) {
const bool M110 = !!strstr_P(command, PSTR("M110"));
if (M110) {
char* n2pos = strchr(command + 4, 'N');
if (n2pos) npos = n2pos;
}
const long gcode_N = strtol(npos + 1, nullptr, 10);
// The line number must be in the correct sequence.
if (gcode_N != serial.last_N + 1 && !M110) {
// A request-for-resend line was already in transit so we got two - oops!
if (WITHIN(gcode_N, serial.last_N - 1, serial.last_N)) continue;
// A corrupted line or too high, indicating a lost line
gcode_line_error(F(STR_ERR_LINE_NO), p);
break;
}
char *apos = strrchr(command, '*');
if (apos) {
uint8_t checksum = 0, count = uint8_t(apos - command);
while (count) checksum ^= command[--count];
if (strtol(apos + 1, nullptr, 10) != checksum) {
gcode_line_error(F(STR_ERR_CHECKSUM_MISMATCH), p);
break;
}
}
else {
gcode_line_error(F(STR_ERR_NO_CHECKSUM), p);
break;
}
serial.last_N = gcode_N;
}
#if HAS_MEDIA
// Pronterface "M29" and "M29 " has no line number
else if (card.flag.saving && !is_M29(command)) {
gcode_line_error(F(STR_ERR_NO_CHECKSUM), p);
break;
}
#endif
//
// Movement commands give an alert when the machine is stopped
//
if (IsStopped()) {
char* gpos = strchr(command, 'G');
if (gpos) {
switch (strtol(gpos + 1, nullptr, 10)) {
case 0 ... 1:
TERN_(ARC_SUPPORT, case 2 ... 3:)
TERN_(BEZIER_CURVE_SUPPORT, case 5:)
PORT_REDIRECT(SERIAL_PORTMASK(p)); // Reply to the serial port that sent the command
SERIAL_ECHOLNPGM(STR_ERR_STOPPED);
LCD_MESSAGE(MSG_STOPPED);
break;
}
}
}
#if DISABLED(EMERGENCY_PARSER)
// Process critical commands early
if (command[0] == 'M') switch (command[3]) {
case '8': if (command[2] == '0' && command[1] == '1') { wait_for_heatup = false; TERN_(HAS_MARLINUI_MENU, wait_for_user = false); } break;
case '2': if (command[2] == '1' && command[1] == '1') kill(FPSTR(M112_KILL_STR), nullptr, true); break;
case '0': if (command[1] == '4' && command[2] == '1') quickstop_stepper(); break;
}
#endif
#if NO_TIMEOUTS > 0
last_command_time = ms;
#endif
// Add the command to the queue
ring_buffer.enqueue(serial.line_buffer, false OPTARG(HAS_MULTI_SERIAL, p));
}
else
process_stream_char(serial_char, serial.input_state, serial.line_buffer, serial.count);
} // NUM_SERIAL loop
} // queue has space, serial has data
}
#if HAS_MEDIA
/**
* Get lines from the SD Card until the command buffer is full
* or until the end of the file is reached. Because this method
* always receives complete command-lines, they can go directly
* into the main command queue.
*/
inline void GCodeQueue::get_sdcard_commands() {
static uint8_t sd_input_state = PS_NORMAL;
// Get commands if there are more in the file
if (!IS_SD_FETCHING()) return;
int sd_count = 0;
while (!ring_buffer.full() && !card.eof()) {
const int16_t n = card.get();
const bool card_eof = card.eof();
if (n < 0 && !card_eof) { SERIAL_ERROR_MSG(STR_SD_ERR_READ); continue; }
CommandLine &command = ring_buffer.commands[ring_buffer.index_w];
const char sd_char = (char)n;
const bool is_eol = ISEOL(sd_char);
if (is_eol || card_eof) {
// Reset stream state, terminate the buffer, and commit a non-empty command
if (!is_eol && sd_count) ++sd_count; // End of file with no newline
if (!process_line_done(sd_input_state, command.buffer, sd_count)) {
// M808 L saves the sdpos of the next line. M808 loops to a new sdpos.
TERN_(GCODE_REPEAT_MARKERS, repeat.early_parse_M808(command.buffer));
#if DISABLED(PARK_HEAD_ON_PAUSE)
// When M25 is non-blocking it can still suspend SD commands
// Otherwise the M125 handler needs to know SD printing is active
if (command.buffer[0] == 'M' && command.buffer[1] == '2' && command.buffer[2] == '5' && !NUMERIC(command.buffer[3]))
card.pauseSDPrint();
#endif
// Put the new command into the buffer (no "ok" sent)
ring_buffer.commit_command(true);
// Prime Power-Loss Recovery for the NEXT commit_command
TERN_(POWER_LOSS_RECOVERY, recovery.cmd_sdpos = card.getIndex());
}
if (card.eof()) card.fileHasFinished(); // Handle end of file reached
}
else
process_stream_char(sd_char, sd_input_state, command.buffer, sd_count);
}
}
#endif // HAS_MEDIA
/**
* Add to the circular command queue the next command from:
* - The command-injection queues (injected_commands_P, injected_commands)
* - The active serial input (usually USB)
* - The SD card file being actively printed
*/
void GCodeQueue::get_available_commands() {
if (ring_buffer.full()) return;
get_serial_commands();
TERN_(HAS_MEDIA, get_sdcard_commands());
}
/**
* Run the entire queue in-place. Blocks SD completion/abort until complete.
*/
void GCodeQueue::exhaust() {
while (ring_buffer.occupied()) advance();
planner.synchronize();
}
/**
* Get the next command in the queue, optionally log it to SD, then dispatch it
*/
void GCodeQueue::advance() {
// Process immediate commands
if (process_injected_command_P() || process_injected_command()) return;
// Return if the G-code buffer is empty
if (ring_buffer.empty()) {
#if ENABLED(BUFFER_MONITORING)
if (!command_buffer_empty) {
command_buffer_empty = true;
command_buffer_underruns++;
command_buffer_empty_at = millis();
}
#endif
return;
}
#if ENABLED(BUFFER_MONITORING)
if (command_buffer_empty) {
command_buffer_empty = false;
const millis_t command_buffer_empty_duration = millis() - command_buffer_empty_at;
NOLESS(max_command_buffer_empty_duration, command_buffer_empty_duration);
}
#endif
#if HAS_MEDIA
if (card.flag.saving) {
char * const cmd = ring_buffer.peek_next_command_string();
if (is_M29(cmd)) {
// M29 closes the file
card.closefile();
SERIAL_ECHOLNPGM(STR_FILE_SAVED);
#if !defined(__AVR__) || !defined(USBCON)
#if ENABLED(SERIAL_STATS_DROPPED_RX)
SERIAL_ECHOLNPGM("Dropped bytes: ", MYSERIAL1.dropped());
#endif
#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
SERIAL_ECHOLNPGM("Max RX Queue Size: ", MYSERIAL1.rxMaxEnqueued());
#endif
#endif
ok_to_send();
}
else {
// Write the string from the read buffer to SD
card.write_command(cmd);
if (card.flag.logging)
gcode.process_next_command(); // The card is saving because it's logging
else
ok_to_send();
}
}
else
gcode.process_next_command();
#else
gcode.process_next_command();
#endif // HAS_MEDIA
// The queue may be reset by a command handler or by code invoked by idle() within a handler
ring_buffer.advance_pos(ring_buffer.index_r, -1);
}
#if ENABLED(BUFFER_MONITORING)
void GCodeQueue::report_buffer_statistics() {
SERIAL_ECHOLNPGM("D576"
" P:", planner.moves_free(), " ", planner_buffer_underruns, " (", max_planner_buffer_empty_duration, ")"
" B:", BUFSIZE - ring_buffer.length, " ", command_buffer_underruns, " (", max_command_buffer_empty_duration, ")"
);
command_buffer_underruns = planner_buffer_underruns = 0;
max_command_buffer_empty_duration = max_planner_buffer_empty_duration = 0;
}
void GCodeQueue::auto_report_buffer_statistics() {
// Bit of a hack to try to catch planner buffer underruns without having logic
// running inside Stepper::block_phase_isr
const millis_t ms = millis();
if (planner.movesplanned() == 0) {
if (!planner_buffer_empty) { // the planner buffer wasn't empty, but now it is
planner_buffer_empty = true;
planner_buffer_underruns++;
planner_buffer_empty_at = ms;
}
}
else if (planner_buffer_empty) { // the planner buffer was empty, but now it's not
planner_buffer_empty = false;
const millis_t planner_buffer_empty_duration = ms - planner_buffer_empty_at;
NOLESS(max_planner_buffer_empty_duration, planner_buffer_empty_duration); // if it's longer than the currently tracked max duration, replace it
}
if (auto_buffer_report_interval && ELAPSED(ms, next_buffer_report_ms)) {
next_buffer_report_ms = ms + 1000UL * auto_buffer_report_interval;
PORT_REDIRECT(SerialMask::All);
report_buffer_statistics();
PORT_RESTORE();
}
}
#endif // BUFFER_MONITORING
|
2301_81045437/Marlin
|
Marlin/src/gcode/queue.cpp
|
C++
|
agpl-3.0
| 23,587
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#pragma once
/**
* queue.h - The G-code command queue, which holds commands before they
* go to the parser and dispatcher.
*/
#include "../inc/MarlinConfig.h"
class GCodeQueue {
public:
/**
* The buffers per serial port.
*/
struct SerialState {
/**
* G-Code line number handling. Hosts may include line numbers when sending
* commands to Marlin, and lines will be checked for sequentiality.
* M110 N<int> sets the current line number.
*/
long last_N;
int count; //!< Number of characters read in the current line of serial input
char line_buffer[MAX_CMD_SIZE]; //!< The current line accumulator
uint8_t input_state; //!< The input state
};
static SerialState serial_state[NUM_SERIAL]; //!< Serial states for each serial port
/**
* G-Code Command Queue
* A simple (circular) ring buffer of BUFSIZE command strings.
*
* Commands are copied into this buffer by the command injectors
* (immediate, serial, sd card) and they are processed sequentially by
* the main loop. The gcode.process_next_command method parses the next
* command and hands off execution to individual handler functions.
*/
struct CommandLine {
char buffer[MAX_CMD_SIZE]; //!< The command buffer
bool skip_ok; //!< Skip sending ok when command is processed?
#if HAS_MULTI_SERIAL
serial_index_t port; //!< Serial port the command was received on
#endif
};
/**
* A handy ring buffer type
*/
struct RingBuffer {
uint8_t length, //!< Number of commands in the queue
index_r, //!< Ring buffer's read position
index_w; //!< Ring buffer's write position
CommandLine commands[BUFSIZE]; //!< The ring buffer of commands
inline serial_index_t command_port() const { return TERN0(HAS_MULTI_SERIAL, commands[index_r].port); }
inline void clear() { length = index_r = index_w = 0; }
void advance_pos(uint8_t &p, const int inc) { if (++p >= BUFSIZE) p = 0; length += inc; }
void commit_command(const bool skip_ok
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind=serial_index_t())
);
bool enqueue(const char *cmd, const bool skip_ok=true
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind=serial_index_t())
);
void ok_to_send();
inline bool full(uint8_t cmdCount=1) const { return length > (BUFSIZE - cmdCount); }
inline bool occupied() const { return length != 0; }
inline bool empty() const { return !occupied(); }
inline CommandLine& peek_next_command() { return commands[index_r]; }
inline char* peek_next_command_string() { return peek_next_command().buffer; }
};
/**
* The ring buffer of commands
*/
static RingBuffer ring_buffer;
/**
* Clear the Marlin command queue
*/
static void clear() { ring_buffer.clear(); }
/**
* Next Injected Command (PROGMEM) pointer. (nullptr == empty)
* Internal commands are enqueued ahead of serial / SD commands.
*/
static PGM_P injected_commands_P;
/**
* Injected Commands (SRAM)
*/
static char injected_commands[64];
/**
* Enqueue command(s) to run from PROGMEM. Drained by process_injected_command_P().
* Don't inject comments or use leading spaces!
* Aborts the current PROGMEM queue so only use for one or two commands.
*/
static void inject_P(PGM_P const pgcode) { injected_commands_P = pgcode; }
static void inject(FSTR_P const fgcode) { inject_P(FTOP(fgcode)); }
/**
* Enqueue command(s) to run from SRAM. Drained by process_injected_command().
* Aborts the current SRAM queue so only use for one or two commands.
*/
static void inject(const char * const gcode) {
strlcpy(injected_commands, gcode, sizeof(injected_commands));
}
/**
* Enqueue and return only when commands are actually enqueued
*/
static void enqueue_one_now(const char * const cmd);
static void enqueue_one_now(FSTR_P const fcmd);
/**
* Attempt to enqueue a single G-code command
* and return 'true' if successful.
*/
static bool enqueue_one(FSTR_P const fcmd);
/**
* Enqueue with Serial Echo
* Return true on success
*/
static bool enqueue_one(const char *cmd);
/**
* Enqueue from program memory and return only when commands are actually enqueued
*/
static void enqueue_now_P(PGM_P const pcmd);
static void enqueue_now(FSTR_P const fcmd) { enqueue_now_P(FTOP(fcmd)); }
/**
* Check whether there are any commands yet to be executed
*/
static bool has_commands_queued() { return ring_buffer.length || injected_commands_P || injected_commands[0]; }
/**
* Get the next command in the queue, optionally log it to SD, then dispatch it
*/
static void advance();
/**
* Run the entire queue in-place
*/
static void exhaust();
/**
* Add to the circular command queue the next command from:
* - The command-injection queue (injected_commands_P)
* - The active serial input (usually USB)
* - The SD card file being actively printed
*/
static void get_available_commands();
/**
* Send an "ok" message to the host, indicating
* that a command was successfully processed.
*
* If ADVANCED_OK is enabled also include:
* N<int> Line number of the command, if any
* P<int> Planner space remaining
* B<int> Block queue space remaining
*/
static void ok_to_send() { ring_buffer.ok_to_send(); }
/**
* Clear the serial line and request a resend of
* the next expected line number.
*/
static void flush_and_request_resend(const serial_index_t serial_ind);
#if (defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32)) && defined(USBCON)
static void flush_rx();
#else
static void flush_rx() {}
#endif
/**
* (Re)Set the current line number for the last received command
*/
static void set_current_line_number(long n) { serial_state[ring_buffer.command_port().index].last_N = n; }
#if ENABLED(BUFFER_MONITORING)
private:
/**
* Track buffer underruns
*/
static uint32_t command_buffer_underruns, planner_buffer_underruns;
static bool command_buffer_empty, planner_buffer_empty;
static millis_t max_command_buffer_empty_duration, max_planner_buffer_empty_duration,
command_buffer_empty_at, planner_buffer_empty_at;
/**
* Report buffer statistics to the host to be able to detect buffer underruns
*
* Returns "D576 " followed by:
* P<uint> Planner space remaining
* B<uint> Command buffer space remaining
* PU<uint> Number of planner buffer underruns since last report
* PD<uint> Max time in ms the planner buffer was empty since last report
* BU<uint> Number of command buffer underruns since last report
* BD<uint> Max time in ms the command buffer was empty since last report
*/
static void report_buffer_statistics();
static uint8_t auto_buffer_report_interval;
static millis_t next_buffer_report_ms;
public:
static void auto_report_buffer_statistics();
static void set_auto_report_interval(uint8_t v) {
NOMORE(v, 60);
auto_buffer_report_interval = v;
next_buffer_report_ms = millis() + 1000UL * v;
}
#endif // BUFFER_MONITORING
private:
static void get_serial_commands();
#if HAS_MEDIA
static void get_sdcard_commands();
#endif
// Process the next "immediate" command (PROGMEM)
static bool process_injected_command_P();
// Process the next "immediate" command (SRAM)
static bool process_injected_command();
static void gcode_line_error(FSTR_P const ferr, const serial_index_t serial_ind);
friend class GcodeSuite;
};
extern GCodeQueue queue;
extern const char G28_STR[];
|
2301_81045437/Marlin
|
Marlin/src/gcode/queue.h
|
C++
|
agpl-3.0
| 8,720
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(MORGAN_SCARA)
#include "../gcode.h"
#include "../../module/scara.h"
#include "../../module/motion.h"
#include "../../MarlinCore.h" // for IsRunning()
inline bool SCARA_move_to_cal(const uint8_t delta_a, const uint8_t delta_b) {
if (IsRunning()) {
forward_kinematics(delta_a, delta_b);
do_blocking_move_to_xy(cartes);
return true;
}
return false;
}
/**
* M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
*/
bool GcodeSuite::M360() {
SERIAL_ECHOLNPGM(" Cal: Theta 0");
return SCARA_move_to_cal(0, 120);
}
/**
* M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
*/
bool GcodeSuite::M361() {
SERIAL_ECHOLNPGM(" Cal: Theta 90");
return SCARA_move_to_cal(90, 130);
}
/**
* M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration)
*/
bool GcodeSuite::M362() {
SERIAL_ECHOLNPGM(" Cal: Psi 0");
return SCARA_move_to_cal(60, 180);
}
/**
* M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
*/
bool GcodeSuite::M363() {
SERIAL_ECHOLNPGM(" Cal: Psi 90");
return SCARA_move_to_cal(50, 90);
}
/**
* M364: SCARA calibration: Move to cal-position PsiC (90 deg to Theta calibration position)
*/
bool GcodeSuite::M364() {
SERIAL_ECHOLNPGM(" Cal: Theta-Psi 90");
return SCARA_move_to_cal(45, 135);
}
#endif // MORGAN_SCARA
|
2301_81045437/Marlin
|
Marlin/src/gcode/scara/M360-M364.cpp
|
C++
|
agpl-3.0
| 2,293
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_MEDIA
#include "../gcode.h"
#include "../../module/planner.h"
#include "../../module/printcounter.h"
#include "../../module/temperature.h"
#include "../../sd/cardreader.h"
#ifdef SD_FINISHED_RELEASECOMMAND
#include "../queue.h"
#endif
#if ANY(SET_PROGRESS_MANUALLY, SD_REPRINT_LAST_SELECTED_FILE)
#include "../../lcd/marlinui.h"
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
#include "../../feature/powerloss.h"
#endif
#if HAS_LEDS_OFF_FLAG
#include "../../MarlinCore.h" // for wait_for_user_response()
#include "../../feature/leds/printer_event_leds.h"
#endif
#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#endif
#if ENABLED(HOST_ACTION_COMMANDS)
#include "../../feature/host_actions.h"
#endif
#ifndef PE_LEDS_COMPLETED_TIME
#define PE_LEDS_COMPLETED_TIME (30*60)
#endif
/**
* M1001: Execute actions for SD print completion
*/
void GcodeSuite::M1001() {
planner.synchronize();
// SD Printing is finished when the queue reaches M1001
card.flag.sdprinting = card.flag.sdprintdone = false;
// If there's another auto#.g file to run...
if (TERN(NO_SD_AUTOSTART, false, card.autofile_check())) return;
// Purge the recovery file...
TERN_(POWER_LOSS_RECOVERY, recovery.purge());
// Report total print time
const bool long_print = print_job_timer.duration() > 60;
if (long_print) process_subcommands_now(F("M31"));
// Stop the print job timer
process_subcommands_now(F("M77"));
// Set the progress bar "done" state
TERN_(SET_PROGRESS_PERCENT, ui.set_progress_done());
// Announce SD file completion
{
PORT_REDIRECT(SerialMask::All);
SERIAL_ECHOLNPGM(STR_FILE_PRINTED);
}
// Update the status LED color
#if HAS_LEDS_OFF_FLAG
if (long_print) {
printerEventLEDs.onPrintCompleted();
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_PRINT_DONE)));
TERN_(HOST_PROMPT_SUPPORT, hostui.continue_prompt(GET_TEXT_F(MSG_PRINT_DONE)));
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(SEC_TO_MS(TERN(HAS_MARLINUI_MENU, PE_LEDS_COMPLETED_TIME, 30))));
printerEventLEDs.onResumeAfterWait();
}
#endif
// Inject SD_FINISHED_RELEASECOMMAND, if any
#ifdef SD_FINISHED_RELEASECOMMAND
process_subcommands_now(F(SD_FINISHED_RELEASECOMMAND));
#endif
TERN_(EXTENSIBLE_UI, ExtUI::onPrintDone());
// Re-select the last printed file in the UI
TERN_(SD_REPRINT_LAST_SELECTED_FILE, ui.reselect_last_file());
}
#endif // HAS_MEDIA
|
2301_81045437/Marlin
|
Marlin/src/gcode/sd/M1001.cpp
|
C++
|
agpl-3.0
| 3,372
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_MEDIA
#include "../gcode.h"
#include "../../sd/cardreader.h"
/**
* M20: List SD card to serial output in [name] [size] format.
*
* With CUSTOM_FIRMWARE_UPLOAD:
* F<bool> - List BIN files only, for use with firmware upload
*
* With LONG_FILENAME_HOST_SUPPORT:
* L<bool> - List long filenames (instead of DOS8.3 names)
*
* With M20_TIMESTAMP_SUPPORT:
* T<bool> - Include timestamps
*/
void GcodeSuite::M20() {
if (card.flag.mounted) {
SERIAL_ECHOLNPGM(STR_BEGIN_FILE_LIST);
card.ls(TERN0(CUSTOM_FIRMWARE_UPLOAD, parser.boolval('F') << LS_ONLY_BIN)
| TERN0(LONG_FILENAME_HOST_SUPPORT, parser.boolval('L') << LS_LONG_FILENAME)
| TERN0(M20_TIMESTAMP_SUPPORT, parser.boolval('T') << LS_TIMESTAMP));
SERIAL_ECHOLNPGM(STR_END_FILE_LIST);
}
else
SERIAL_ECHO_MSG(STR_NO_MEDIA);
}
#endif // HAS_MEDIA
|
2301_81045437/Marlin
|
Marlin/src/gcode/sd/M20.cpp
|
C++
|
agpl-3.0
| 1,769
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_MEDIA
#include "../gcode.h"
#include "../../sd/cardreader.h"
/**
* M21: Init SD Card
*
* With MULTI_VOLUME:
* P0 or S - Change to the SD Card and mount it
* P1 or U - Change to the USB Drive and mount it
*/
void GcodeSuite::M21() {
#if ENABLED(MULTI_VOLUME)
const int8_t vol = parser.intval('P', -1);
if (vol == 0 || parser.seen_test('S')) // "S" for SD Card
card.changeMedia(&card.media_driver_sdcard);
else if (vol == 1 || parser.seen_test('U')) // "U" for USB
card.changeMedia(&card.media_driver_usbFlash);
#endif
card.mount();
}
/**
* M22: Release SD Card
*/
void GcodeSuite::M22() {
if (!IS_SD_PRINTING()) card.release();
}
#endif // HAS_MEDIA
|
2301_81045437/Marlin
|
Marlin/src/gcode/sd/M21_M22.cpp
|
C++
|
agpl-3.0
| 1,610
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_MEDIA
#include "../gcode.h"
#include "../../sd/cardreader.h"
#include "../../lcd/marlinui.h"
/**
* M23: Open a file
*
* The path is relative to the root directory
*/
void GcodeSuite::M23() {
// Simplify3D includes the size, so zero out all spaces (#7227)
for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0';
card.openFileRead(parser.string_arg);
TERN_(SET_PROGRESS_PERCENT, ui.set_progress(0));
}
#endif // HAS_MEDIA
|
2301_81045437/Marlin
|
Marlin/src/gcode/sd/M23.cpp
|
C++
|
agpl-3.0
| 1,362
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_MEDIA
#include "../gcode.h"
#include "../../sd/cardreader.h"
#include "../../module/printcounter.h"
#include "../../lcd/marlinui.h"
#if ENABLED(PARK_HEAD_ON_PAUSE)
#include "../../feature/pause.h"
#endif
#if ENABLED(HOST_ACTION_COMMANDS)
#include "../../feature/host_actions.h"
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
#include "../../feature/powerloss.h"
#endif
#if DGUS_LCD_UI_MKS
#include "../../lcd/extui/dgus/DGUSDisplayDef.h"
#endif
#include "../../MarlinCore.h" // for startOrResumeJob
/**
* M24: Start or Resume SD Print
*/
void GcodeSuite::M24() {
#if DGUS_LCD_UI_MKS
if ((print_job_timer.isPaused() || print_job_timer.isRunning()) && !parser.seen("ST"))
MKS_resume_print_move();
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
if (parser.seenval('S')) card.setIndex(parser.value_long());
if (parser.seenval('T')) print_job_timer.resume(parser.value_long());
#endif
#if ENABLED(PARK_HEAD_ON_PAUSE)
if (did_pause_print) {
resume_print(); // will call print_job_timer.start()
return;
}
#endif
if (card.isFileOpen()) {
card.startOrResumeFilePrinting(); // SD card will now be read for commands
startOrResumeJob(); // Start (or resume) the print job timer
TERN_(POWER_LOSS_RECOVERY, recovery.prepare());
}
#if ENABLED(HOST_ACTION_COMMANDS)
#ifdef ACTION_ON_RESUME
hostui.resume();
#endif
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("Resuming SD"), FPSTR(DISMISS_STR)));
#endif
ui.reset_status();
}
/**
* M25: Pause SD Print
*
* With PARK_HEAD_ON_PAUSE:
* Invoke M125 to store the current position and move to the park
* position. M24 will move the head back before resuming the print.
*/
void GcodeSuite::M25() {
#if ENABLED(PARK_HEAD_ON_PAUSE)
M125();
#else
// Set initial pause flag to prevent more commands from landing in the queue while we try to pause
if (IS_SD_PRINTING()) card.pauseSDPrint();
#if ENABLED(POWER_LOSS_RECOVERY) && DISABLED(DGUS_LCD_UI_MKS)
if (recovery.enabled) recovery.save(true);
#endif
print_job_timer.pause();
TERN_(DGUS_LCD_UI_MKS, MKS_pause_print_move());
IF_DISABLED(DWIN_CREALITY_LCD, ui.reset_status());
#if ENABLED(HOST_ACTION_COMMANDS)
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_PAUSE_RESUME, F("Pause SD"), F("Resume")));
#ifdef ACTION_ON_PAUSE
hostui.pause();
#endif
#endif
#endif
}
#endif // HAS_MEDIA
|
2301_81045437/Marlin
|
Marlin/src/gcode/sd/M24_M25.cpp
|
C++
|
agpl-3.0
| 3,398
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_MEDIA
#include "../gcode.h"
#include "../../sd/cardreader.h"
/**
* M26: Set SD Card file index
*/
void GcodeSuite::M26() {
if (card.isMounted() && parser.seenval('S'))
card.setIndex(parser.value_long());
}
#endif // HAS_MEDIA
|
2301_81045437/Marlin
|
Marlin/src/gcode/sd/M26.cpp
|
C++
|
agpl-3.0
| 1,145
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_MEDIA
#include "../gcode.h"
#include "../../sd/cardreader.h"
/**
* M27: Get SD Card status
* OR, with 'S<seconds>' set the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS)
* OR, with 'C' get the current filename.
*/
void GcodeSuite::M27() {
if (parser.seen_test('C')) {
SERIAL_ECHOPGM("Current file: ");
card.printSelectedFilename();
return;
}
#if ENABLED(AUTO_REPORT_SD_STATUS)
if (parser.seenval('S')) {
card.auto_reporter.set_interval(parser.value_byte());
return;
}
#endif
card.report_status();
}
#endif // HAS_MEDIA
|
2301_81045437/Marlin
|
Marlin/src/gcode/sd/M27.cpp
|
C++
|
agpl-3.0
| 1,506
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_MEDIA
#include "../gcode.h"
#include "../../sd/cardreader.h"
#if HAS_MULTI_SERIAL
#include "../queue.h"
#endif
/**
* M28: Start SD Write
*/
void GcodeSuite::M28() {
#if ENABLED(BINARY_FILE_TRANSFER)
bool binary_mode = false;
char *p = parser.string_arg;
if (p[0] == 'B' && NUMERIC(p[1])) {
binary_mode = p[1] > '0';
p += 2;
while (*p == ' ') ++p;
}
// Binary transfer mode
if ((card.flag.binary_mode = binary_mode)) {
SERIAL_ECHO_MSG("Switching to Binary Protocol");
TERN_(HAS_MULTI_SERIAL, card.transfer_port_index = queue.ring_buffer.command_port().index);
}
else
card.openFileWrite(p);
#else
card.openFileWrite(parser.string_arg);
#endif
}
/**
* M29: Stop SD Write
* (Processed in write-to-file routine)
*/
void GcodeSuite::M29() {
card.flag.saving = false;
}
#endif // HAS_MEDIA
|
2301_81045437/Marlin
|
Marlin/src/gcode/sd/M28_M29.cpp
|
C++
|
agpl-3.0
| 1,789
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_MEDIA
#include "../gcode.h"
#include "../../sd/cardreader.h"
/**
* M30 <filename>: Delete SD Card file
*/
void GcodeSuite::M30() {
if (card.isMounted()) {
card.closefile();
card.removeFile(parser.string_arg);
}
}
#endif // HAS_MEDIA
|
2301_81045437/Marlin
|
Marlin/src/gcode/sd/M30.cpp
|
C++
|
agpl-3.0
| 1,158
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_MEDIA_SUBCALLS
#include "../gcode.h"
#include "../../sd/cardreader.h"
#include "../../module/planner.h" // for synchronize()
#include "../../MarlinCore.h" // for startOrResumeJob
/**
* M32: Select file and start SD Print
*
* Examples:
*
* M32 !PATH/TO/FILE.GCO# ; Start FILE.GCO
* M32 P !PATH/TO/FILE.GCO# ; Start FILE.GCO as a procedure
* M32 S60 !PATH/TO/FILE.GCO# ; Start FILE.GCO at byte 60
*/
void GcodeSuite::M32() {
if (IS_SD_PRINTING()) planner.synchronize();
if (card.isMounted()) {
const uint8_t call_procedure = parser.boolval('P');
card.openFileRead(parser.string_arg, call_procedure);
if (parser.seenval('S')) card.setIndex(parser.value_long());
card.startOrResumeFilePrinting();
// Procedure calls count as normal print time.
if (!call_procedure) startOrResumeJob();
}
}
#endif // HAS_MEDIA_SUBCALLS
|
2301_81045437/Marlin
|
Marlin/src/gcode/sd/M32.cpp
|
C++
|
agpl-3.0
| 1,787
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(LONG_FILENAME_HOST_SUPPORT)
#include "../gcode.h"
#include "../../sd/cardreader.h"
/**
* M33: Get the long full path of a file or folder
*
* Parameters:
* <dospath> Case-insensitive DOS-style path to a file or folder
*
* Example:
* M33 miscel~1/armchair/armcha~1.gco
*
* Output:
* /Miscellaneous/Armchair/Armchair.gcode
*/
void GcodeSuite::M33() {
card.printLongPath(parser.string_arg);
}
#endif // LONG_FILENAME_HOST_SUPPORT
|
2301_81045437/Marlin
|
Marlin/src/gcode/sd/M33.cpp
|
C++
|
agpl-3.0
| 1,362
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ALL(SDCARD_SORT_ALPHA, SDSORT_GCODE)
#include "../gcode.h"
#include "../../sd/cardreader.h"
/**
* M34: Set SD Card Sorting Options
*
* S - Default sorting (i.e., SDSORT_REVERSE)
* S-1 - Reverse alpha sorting
* S0 - FID Order (not always newest)
* S1 - Forward alpha sorting
* S2 - Alias for S-1 [deprecated]
*
* F-1 - Folders above files
* F0 - Sort According to 'S'
* F1 - Folders after files
*/
void GcodeSuite::M34() {
if (parser.seen('S')) card.setSortOn(SortFlag(parser.ushortval('S', TERN(SDSORT_REVERSE, AS_REV, AS_FWD))));
if (parser.seenval('F')) {
const int v = parser.value_long();
card.setSortFolders(v < 0 ? -1 : v > 0 ? 1 : 0);
}
//if (parser.seen('R')) card.setSortReverse(parser.value_bool());
}
#endif // SDCARD_SORT_ALPHA && SDSORT_GCODE
|
2301_81045437/Marlin
|
Marlin/src/gcode/sd/M34.cpp
|
C++
|
agpl-3.0
| 1,698
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_MEDIA
#include "../gcode.h"
#include "../../sd/cardreader.h"
#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#endif
/**
* M524: Abort the current SD print job (started with M24)
*/
void GcodeSuite::M524() {
#if ENABLED(EXTENSIBLE_UI)
ExtUI::stopPrint(); // Calls ui.abort_print() which does the same as below
#else
if (IS_SD_PRINTING())
card.abortFilePrintSoon();
else if (card.isMounted())
card.closefile();
#endif
}
#endif // HAS_MEDIA
|
2301_81045437/Marlin
|
Marlin/src/gcode/sd/M524.cpp
|
C++
|
agpl-3.0
| 1,405
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(GCODE_REPEAT_MARKERS)
#include "../gcode.h"
#include "../../feature/repeat.h"
/**
* M808: Set / Goto a repeat marker
*
* L<count> - Set a repeat marker with 'count' repetitions. If omitted, infinity.
*
* Examples:
*
* M808 L ; Set a loop marker with a count of infinity
* M808 L2 ; Set a loop marker with a count of 2
* M808 ; Decrement and loop if not zero.
*/
void GcodeSuite::M808() {
// Handled early and ignored here in the queue.
// Allowed to go into the queue for logging purposes.
// M808 K sent from the host to cancel all loops
if (parser.seen_test('K')) repeat.cancel();
}
#endif // GCODE_REPEAT_MARKERS
|
2301_81045437/Marlin
|
Marlin/src/gcode/sd/M808.cpp
|
C++
|
agpl-3.0
| 1,569
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_MEDIA
#include "../gcode.h"
#include "../../sd/cardreader.h"
/**
* M928: Start SD Logging
*/
void GcodeSuite::M928() {
card.openLogFile(parser.string_arg);
}
#endif // HAS_MEDIA
|
2301_81045437/Marlin
|
Marlin/src/gcode/sd/M928.cpp
|
C++
|
agpl-3.0
| 1,095
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../gcode.h"
#include "../../core/serial.h"
#include "../../module/printcounter.h"
#include "../../libs/duration_t.h"
#include "../../lcd/marlinui.h"
/**
* M31: Get the time since the start of SD Print (or last M109)
*/
void GcodeSuite::M31() {
char buffer[22];
duration_t(print_job_timer.duration()).toString(buffer);
ui.set_status_no_expire(buffer);
SERIAL_ECHO_MSG("Print time: ", buffer);
}
|
2301_81045437/Marlin
|
Marlin/src/gcode/stats/M31.cpp
|
C++
|
agpl-3.0
| 1,280
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../gcode.h"
#include "../../module/printcounter.h"
#include "../../lcd/marlinui.h"
#if ENABLED(HOST_PAUSE_M76)
#include "../../feature/host_actions.h"
#endif
#include "../../MarlinCore.h" // for startOrResumeJob
#if ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/e3v2/proui/dwin.h"
#endif
/**
* M75: Start print timer
*
* ProUI: If the print fails to start and any text is
* included in the command, print it in the header.
*/
void GcodeSuite::M75() {
startOrResumeJob(); // ... ExtUI::onPrintTimerStarted()
#if ENABLED(DWIN_LCD_PROUI)
// TODO: Remove if M75 <string> is never used
if (!IS_SD_PRINTING()) dwinPrintHeader(parser.string_arg && parser.string_arg[0] ? parser.string_arg : GET_TEXT(MSG_HOST_START_PRINT));
#endif
}
/**
* M76: Pause print timer
*/
void GcodeSuite::M76() {
print_job_timer.pause(); // ... ExtUI::onPrintTimerPaused()
TERN_(HOST_PAUSE_M76, hostui.pause());
}
/**
* M77: Stop print timer
*/
void GcodeSuite::M77() {
print_job_timer.stop();
}
#if ENABLED(PRINTCOUNTER)
/**
* M78: Show print statistics
*/
void GcodeSuite::M78() {
if (parser.intval('S') == 78) { // "M78 S78" will reset the statistics
print_job_timer.initStats();
ui.reset_status();
return;
}
#if HAS_SERVICE_INTERVALS
if (parser.seenval('R')) {
print_job_timer.resetServiceInterval(parser.value_int());
ui.reset_status();
return;
}
#endif
print_job_timer.showStats();
}
#endif // PRINTCOUNTER
|
2301_81045437/Marlin
|
Marlin/src/gcode/stats/M75-M78.cpp
|
C++
|
agpl-3.0
| 2,391
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/M104_M109.cpp
*
* Hotend target temperature control
*/
#include "../../inc/MarlinConfigPre.h"
#if HAS_HOTEND
#include "../gcode.h"
#include "../../module/temperature.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#include "../../lcd/marlinui.h"
#include "../../MarlinCore.h" // for startOrResumeJob, etc.
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
#include "../../module/printcounter.h"
#if ENABLED(CANCEL_OBJECTS)
#include "../../feature/cancel_object.h"
#endif
#endif
/**
* M104: Set Hotend Temperature target and return immediately
* M109: Set Hotend Temperature target and wait
*
* Parameters
* I<preset> : Material Preset index (if material presets are defined)
* T<index> : Tool index. If omitted, applies to the active tool
* S<target> : The target temperature in current units. For M109, only wait when heating up.
*
* With AUTOTEMP...
* F<factor> : Autotemp Scaling Factor. Set non-zero to enable Auto-temp.
* S<min> : Minimum temperature, in current units.
* B<max> : Maximum temperature, in current units.
*
* M109 Parameters
* R<target> : The target temperature in current units. Wait for heating and cooling.
*
* Examples
* M104 S100 : Set target to 100° and return.
* M109 R150 : Set target to 150°. Wait until the hotend gets close to 150°.
*
* With PRINTJOB_TIMER_AUTOSTART turning on heaters will start the print job timer
* (used by printingIsActive, etc.) and turning off heaters will stop the timer.
*/
void GcodeSuite::M104_M109(const bool isM109) {
if (DEBUGGING(DRYRUN)) return;
#if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1
constexpr int8_t target_extruder = 0;
#else
const int8_t target_extruder = get_target_extruder_from_command();
if (target_extruder < 0) return;
#endif
bool got_temp = false;
celsius_t temp = 0;
// Accept 'I' if temperature presets are defined
#if HAS_PREHEAT
got_temp = parser.seenval('I');
if (got_temp) {
const uint8_t index = parser.value_byte();
temp = ui.material_preset[_MIN(index, PREHEAT_COUNT - 1)].hotend_temp;
}
#endif
// Get the temperature from 'S' or 'R'
bool no_wait_for_cooling = false;
if (!got_temp) {
no_wait_for_cooling = parser.seenval('S');
got_temp = no_wait_for_cooling || (isM109 && parser.seenval('R'));
if (got_temp) temp = parser.value_celsius();
}
if (got_temp) {
#if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
thermalManager.singlenozzle_temp[target_extruder] = temp;
if (target_extruder != active_extruder) return;
#endif
thermalManager.setTargetHotend(temp, target_extruder);
#if ENABLED(DUAL_X_CARRIAGE)
if (idex_is_duplicating() && target_extruder == 0)
thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1);
#endif
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
/**
* Use half EXTRUDE_MINTEMP to allow nozzles to be put into hot
* standby mode, (e.g., in a dual extruder setup) without affecting
* the running print timer.
*/
thermalManager.auto_job_check_timer(isM109, true);
#endif
if (thermalManager.isHeatingHotend(target_extruder) || !no_wait_for_cooling)
thermalManager.set_heating_message(target_extruder, !isM109 && got_temp);
}
TERN_(AUTOTEMP, planner.autotemp_M104_M109());
if (isM109 && got_temp)
(void)thermalManager.wait_for_hotend(target_extruder, no_wait_for_cooling);
}
#endif // HAS_HOTEND
|
2301_81045437/Marlin
|
Marlin/src/gcode/temp/M104_M109.cpp
|
C++
|
agpl-3.0
| 4,377
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../gcode.h"
#include "../../module/temperature.h"
/**
* M105: Read hot end and bed temperature
*/
void GcodeSuite::M105() {
const int8_t target_extruder = get_target_extruder_from_command();
if (target_extruder < 0) return;
SERIAL_ECHOPGM(STR_OK);
#if HAS_TEMP_SENSOR
thermalManager.print_heater_states(target_extruder OPTARG(HAS_TEMP_REDUNDANT, parser.boolval('R')));
SERIAL_EOL();
#else
SERIAL_ECHOLNPGM(" T:0"); // Some hosts send M105 to test the serial connection
#endif
}
|
2301_81045437/Marlin
|
Marlin/src/gcode/temp/M105.cpp
|
C++
|
agpl-3.0
| 1,386
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_FAN
#include "../gcode.h"
#include "../../module/motion.h"
#include "../../module/temperature.h"
#if ENABLED(LASER_SYNCHRONOUS_M106_M107)
#include "../../module/planner.h"
#endif
#if HAS_PREHEAT
#include "../../lcd/marlinui.h"
#endif
#if ENABLED(SINGLENOZZLE)
#define _ALT_P active_extruder
#define _CNT_P EXTRUDERS
#else
#define _ALT_P _MIN(active_extruder, FAN_COUNT - 1)
#define _CNT_P FAN_COUNT
#endif
/**
* M106: Set Fan Speed
*
* I<index> Material Preset index (if material presets are defined)
* S<int> Speed between 0-255
* P<index> Fan index, if more than one fan
*
* With EXTRA_FAN_SPEED enabled:
*
* T<int> Restore/Use/Set Temporary Speed:
* 1 = Restore previous speed after T2
* 2 = Use temporary speed set with T3-255
* 3-255 = Set the speed for use with T2
*/
void GcodeSuite::M106() {
const uint8_t pfan = parser.byteval('P', _ALT_P);
if (pfan >= _CNT_P) return;
if (FAN_IS_REDUNDANT(pfan)) return;
#if ENABLED(EXTRA_FAN_SPEED)
const uint16_t t = parser.intval('T');
if (t > 0) return thermalManager.set_temp_fan_speed(pfan, t);
#endif
const uint16_t dspeed = parser.seen_test('A') ? thermalManager.fan_speed[active_extruder] : 255;
uint16_t speed = dspeed;
// Accept 'I' if temperature presets are defined
#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
constexpr bool got_preset = false;
#endif
if (!got_preset && parser.seenval('S'))
speed = parser.value_ushort();
TERN_(FOAMCUTTER_XYUV, speed *= 2.55f); // Get command in % of max heat
// Set speed, with constraint
thermalManager.set_fan_speed(pfan, speed);
TERN_(LASER_SYNCHRONOUS_M106_M107, planner.buffer_sync_block(BLOCK_BIT_SYNC_FANS));
if (TERN0(DUAL_X_CARRIAGE, idex_is_duplicating())) // pfan == 0 when duplicating
thermalManager.set_fan_speed(1 - pfan, speed);
}
/**
* M107: Fan Off
*/
void GcodeSuite::M107() {
const uint8_t pfan = parser.byteval('P', _ALT_P);
if (pfan >= _CNT_P) return;
if (FAN_IS_REDUNDANT(pfan)) return;
thermalManager.set_fan_speed(pfan, 0);
if (TERN0(DUAL_X_CARRIAGE, idex_is_duplicating())) // pfan == 0 when duplicating
thermalManager.set_fan_speed(1 - pfan, 0);
TERN_(LASER_SYNCHRONOUS_M106_M107, planner.buffer_sync_block(BLOCK_BIT_SYNC_FANS));
}
#endif // HAS_FAN
|
2301_81045437/Marlin
|
Marlin/src/gcode/temp/M106_M107.cpp
|
C++
|
agpl-3.0
| 3,371
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_FANCHECK
#include "../gcode.h"
#include "../../feature/fancheck.h"
/**
* M123: Report fan states -or- set interval for auto-report
*
* S<seconds> : Set auto-report interval
*/
void GcodeSuite::M123() {
#if ENABLED(AUTO_REPORT_FANS)
if (parser.seenval('S')) {
fan_check.auto_reporter.set_interval(parser.value_byte());
return;
}
#endif
fan_check.print_fan_states();
}
#endif // HAS_FANCHECK
|
2301_81045437/Marlin
|
Marlin/src/gcode/temp/M123.cpp
|
C++
|
agpl-3.0
| 1,336
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/M140_M190.cpp
*
* Bed target temperature control
*/
#include "../../inc/MarlinConfig.h"
#if HAS_HEATED_BED
#include "../gcode.h"
#include "../../module/temperature.h"
#include "../../lcd/marlinui.h"
/**
* M140 - Set Bed Temperature target and return immediately
* M190 - Set Bed Temperature target and wait
*
* I<index> : Preset index (if material presets are defined)
* S<target> : The target temperature in current units
*
* Parameters
* I<index> : Preset index (if material presets are defined)
* S<target> : The target temperature in current units. Wait for heating only.
*
* M190 Parameters
* R<target> : The target temperature in current units. Wait for heating and cooling.
*
* Examples
* M140 S60 : Set target to 60° and return right away.
* M190 R40 : Set target to 40°. Wait until the bed gets close to 40°.
*
* With PRINTJOB_TIMER_AUTOSTART turning on heaters will start the print job timer
* (used by printingIsActive, etc.) and turning off heaters will stop the timer.
*
* With BED_ANNEALING_GCODE:
*
* M190 Parameters
* T<seconds>: Cooldown time, for more gradual cooling. Use with R parameter.
* M190 R T - Cool the bed down over a given period of time.
*
* Examples
* M190 R70 T600: Cool down to 70°C over a period of ten minutes.
*
*/
void GcodeSuite::M140_M190(const bool isM190) {
if (DEBUGGING(DRYRUN)) return;
bool got_temp = false;
celsius_t temp = 0;
// Accept 'I' if temperature presets are defined
#if HAS_PREHEAT
got_temp = parser.seenval('I');
if (got_temp) {
const uint8_t index = parser.value_byte();
temp = ui.material_preset[_MIN(index, PREHEAT_COUNT - 1)].bed_temp;
}
#endif
// Get the temperature from 'S' or 'R'
bool no_wait_for_cooling = false;
if (!got_temp) {
no_wait_for_cooling = parser.seenval('S');
got_temp = no_wait_for_cooling || (isM190 && parser.seenval('R'));
if (got_temp) temp = parser.value_celsius();
}
if (!got_temp) return;
#if ENABLED(BED_ANNEALING_GCODE)
const bool anneal = isM190 && !no_wait_for_cooling && parser.seenval('T');
const millis_t anneal_ms = anneal ? millis() + parser.value_millis_from_seconds() : 0UL;
#else
constexpr bool anneal = false;
#endif
if (!anneal) {
thermalManager.setTargetBed(temp);
thermalManager.isHeatingBed() ? LCD_MESSAGE(MSG_BED_HEATING) : LCD_MESSAGE(MSG_BED_COOLING);
}
// With PRINTJOB_TIMER_AUTOSTART, M190 can start the timer, and M140 can stop it
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(isM190, !isM190));
if (isM190) {
#if ENABLED(BED_ANNEALING_GCODE)
if (anneal) {
LCD_MESSAGE(MSG_BED_ANNEALING);
// Loop from current temp down to the target
for (celsius_t cool_temp = thermalManager.degBed(); --cool_temp >= temp; ) {
thermalManager.setTargetBed(cool_temp); // Cool by one degree
thermalManager.wait_for_bed(false); // Could this wait forever?
const millis_t ms = millis();
if (PENDING(ms, anneal_ms) && cool_temp > temp) { // Still warmer and waiting?
const millis_t remain = anneal_ms - ms;
dwell(remain / (cool_temp - temp)); // Wait for a fraction of remaining time
}
}
return;
}
#endif
thermalManager.wait_for_bed(no_wait_for_cooling);
}
else {
ui.set_status_reset_fn([]{
const celsius_t c = thermalManager.degTargetBed();
return c < 30 || thermalManager.degBedNear(c);
});
}
}
#endif // HAS_HEATED_BED
|
2301_81045437/Marlin
|
Marlin/src/gcode/temp/M140_M190.cpp
|
C++
|
agpl-3.0
| 4,494
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/M141_M191.cpp
*
* Chamber target temperature control
*/
#include "../../inc/MarlinConfig.h"
#if HAS_HEATED_CHAMBER
#include "../gcode.h"
#include "../../module/temperature.h"
#include "../../lcd/marlinui.h"
/**
* M141: Set chamber temperature
*/
void GcodeSuite::M141() {
if (DEBUGGING(DRYRUN)) return;
if (parser.seenval('S')) {
thermalManager.setTargetChamber(parser.value_celsius());
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
/**
* Stop the timer at the end of print. Hotend, bed target, and chamber
* temperatures need to be set below mintemp. Order of M140, M104, and M141
* at the end of the print does not matter.
*/
thermalManager.auto_job_check_timer(false, true);
#endif
}
}
/**
* M191: Sxxx Wait for chamber current temp to reach target temp. Waits only when heating
* Rxxx Wait for chamber current temp to reach target temp. Waits when heating and cooling
*/
void GcodeSuite::M191() {
if (DEBUGGING(DRYRUN)) return;
const bool no_wait_for_cooling = parser.seenval('S');
if (no_wait_for_cooling || parser.seenval('R')) {
thermalManager.setTargetChamber(parser.value_celsius());
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(true, false));
}
else return;
const bool is_heating = thermalManager.isHeatingChamber();
if (is_heating || !no_wait_for_cooling) {
ui.set_status(is_heating ? GET_TEXT_F(MSG_CHAMBER_HEATING) : GET_TEXT_F(MSG_CHAMBER_COOLING));
thermalManager.wait_for_chamber(false);
}
}
#endif // HAS_HEATED_CHAMBER
|
2301_81045437/Marlin
|
Marlin/src/gcode/temp/M141_M191.cpp
|
C++
|
agpl-3.0
| 2,446
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 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/M143_M193.cpp
*
* Laser Cooler target temperature control
*/
#include "../../inc/MarlinConfig.h"
#if HAS_COOLER
#include "../../feature/cooler.h"
extern Cooler cooler;
#include "../gcode.h"
#include "../../module/temperature.h"
#include "../../lcd/marlinui.h"
/**
* M143: Set cooler temperature
*/
void GcodeSuite::M143() {
if (DEBUGGING(DRYRUN)) return;
if (parser.seenval('S')) {
thermalManager.setTargetCooler(parser.value_celsius());
parser.value_celsius() ? cooler.enable() : cooler.disable();
}
}
/**
* M193: Sxxx Wait for laser current temp to reach target temp. Waits only when cooling.
*/
void GcodeSuite::M193() {
if (DEBUGGING(DRYRUN)) return;
if (parser.seenval('S')) {
cooler.enable();
thermalManager.setTargetCooler(parser.value_celsius());
if (thermalManager.isLaserCooling()) {
LCD_MESSAGE(MSG_LASER_COOLING);
thermalManager.wait_for_cooler(true);
}
}
}
#endif // HAS_COOLER
|
2301_81045437/Marlin
|
Marlin/src/gcode/temp/M143_M193.cpp
|
C++
|
agpl-3.0
| 1,835
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(AUTO_REPORT_TEMPERATURES)
#include "../gcode.h"
#include "../../module/temperature.h"
/**
* M155: Set temperature auto-report interval. M155 S<seconds>
*/
void GcodeSuite::M155() {
if (parser.seenval('S'))
thermalManager.auto_reporter.set_interval(parser.value_byte());
}
#endif // AUTO_REPORT_TEMPERATURES
|
2301_81045437/Marlin
|
Marlin/src/gcode/temp/M155.cpp
|
C++
|
agpl-3.0
| 1,232
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 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/>.
*
*/
/**
* M192.cpp - Wait for probe to reach temperature
*/
#include "../../inc/MarlinConfig.h"
#if HAS_TEMP_PROBE
#include "../gcode.h"
#include "../../module/temperature.h"
#include "../../lcd/marlinui.h"
/**
* M192: Wait for probe temperature sensor to reach a target
*
* Select only one of these flags:
* R - Wait for heating or cooling
* S - Wait only for heating
*/
void GcodeSuite::M192() {
if (DEBUGGING(DRYRUN)) return;
const bool no_wait_for_cooling = parser.seenval('S');
if (!no_wait_for_cooling && !parser.seenval('R')) {
SERIAL_ERROR_MSG("No target temperature set.");
return;
}
const celsius_t target_temp = parser.value_celsius();
thermalManager.isProbeBelowTemp(target_temp) ? LCD_MESSAGE(MSG_PROBE_HEATING) : LCD_MESSAGE(MSG_PROBE_COOLING);
thermalManager.wait_for_probe(target_temp, no_wait_for_cooling);
}
#endif // HAS_TEMP_PROBE
|
2301_81045437/Marlin
|
Marlin/src/gcode/temp/M192.cpp
|
C++
|
agpl-3.0
| 1,753
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_PID_HEATING
#include "../gcode.h"
#include "../queue.h" // for flush_tx
#include "../../lcd/marlinui.h"
#include "../../module/temperature.h"
#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#endif
/**
* M303: PID relay autotune
*
* S<temperature> Set the target temperature. (Default: 150C / 70C)
* E<extruder> Extruder number to tune, or -1 for the bed. (Default: E0)
* C<cycles> Number of times to repeat the procedure. (Minimum: 3, Default: 5)
* U<bool> Flag to apply the result to the current PID values
*
* With PID_DEBUG, PID_BED_DEBUG, or PID_CHAMBER_DEBUG:
* D Toggle PID debugging and EXIT without further action.
*/
void GcodeSuite::M303() {
#if HAS_PID_DEBUG
if (parser.seen_test('D')) {
thermalManager.pid_debug_flag ^= true;
SERIAL_ECHO_START();
SERIAL_ECHOPGM("PID Debug ");
serialprintln_onoff(thermalManager.pid_debug_flag);
return;
}
#endif
const heater_id_t hid = (heater_id_t)parser.intval('E');
celsius_t default_temp;
switch (hid) {
OPTCODE(PIDTEMP, case 0 ... HOTENDS - 1: default_temp = PREHEAT_1_TEMP_HOTEND; break)
OPTCODE(PIDTEMPBED, case H_BED: default_temp = PREHEAT_1_TEMP_BED; break)
OPTCODE(PIDTEMPCHAMBER, case H_CHAMBER: default_temp = PREHEAT_1_TEMP_CHAMBER; break)
default:
SERIAL_ECHOPGM(STR_PID_AUTOTUNE);
SERIAL_ECHOLNPGM(STR_PID_BAD_HEATER_ID);
TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::pidresult_t::PID_BAD_HEATER_ID));
return;
}
const bool seenC = parser.seenval('C');
const int c = seenC ? parser.value_int() : 5;
const bool seenS = parser.seenval('S');
const celsius_t temp = seenS ? parser.value_celsius() : default_temp;
const bool u = parser.boolval('U');
TERN_(EXTENSIBLE_UI, ExtUI::onStartM303(c, hid, temp));
IF_DISABLED(BUSY_WHILE_HEATING, KEEPALIVE_STATE(NOT_BUSY));
LCD_MESSAGE(MSG_PID_AUTOTUNE);
thermalManager.PID_autotune(temp, hid, c, u);
ui.reset_status();
queue.flush_rx();
}
#endif // HAS_PID_HEATING
|
2301_81045437/Marlin
|
Marlin/src/gcode/temp/M303.cpp
|
C++
|
agpl-3.0
| 2,998
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2022 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(MPCTEMP)
#include "../gcode.h"
#include "../../lcd/marlinui.h"
#include "../../module/temperature.h"
/**
* M306: MPC settings and autotune
*
* E<extruder> Extruder index. (Default: Active Extruder)
*
* Set MPC values manually for the specified or active extruder:
* A<watts/kelvin> Ambient heat transfer coefficient (no fan).
* C<joules/kelvin> Block heat capacity.
* F<watts/kelvin> Ambient heat transfer coefficient (fan on full).
* H<joules/kelvin/mm> Filament heat capacity per mm.
* P<watts> Heater power.
* R<kelvin/second/kelvin> Sensor responsiveness (= transfer coefficient / heat capcity).
*
* With MPC_AUTOTUNE:
* T Autotune the extruder specified with 'E' or the active extruder.
* S0 : Autotuning method AUTO (default)
* S1 : Autotuning method DIFFERENTIAL
* S2 : Autotuning method ASYMPTOTIC
*/
void GcodeSuite::M306() {
const uint8_t e = TERN(HAS_MULTI_EXTRUDER, parser.intval('E', active_extruder), 0);
if (e >= (EXTRUDERS)) {
SERIAL_ECHOLNPGM("?(E)xtruder index out of range (0-", (EXTRUDERS) - 1, ").");
return;
}
#if ENABLED(MPC_AUTOTUNE)
if (parser.seen_test('T')) {
Temperature::MPCTuningType tuning_type;
const uint8_t type = parser.byteval('S', 0);
switch (type) {
case 1: tuning_type = Temperature::MPCTuningType::FORCE_DIFFERENTIAL; break;
case 2: tuning_type = Temperature::MPCTuningType::FORCE_ASYMPTOTIC; break;
default: tuning_type = Temperature::MPCTuningType::AUTO; break;
}
LCD_MESSAGE(MSG_MPC_AUTOTUNE);
thermalManager.MPC_autotune(e, tuning_type);
ui.reset_status();
return;
}
#endif
if (parser.seen("ACFPRH")) {
MPC_t &mpc = thermalManager.temp_hotend[e].mpc;
if (parser.seenval('P')) mpc.heater_power = parser.value_float();
if (parser.seenval('C')) mpc.block_heat_capacity = parser.value_float();
if (parser.seenval('R')) mpc.sensor_responsiveness = parser.value_float();
if (parser.seenval('A')) mpc.ambient_xfer_coeff_fan0 = parser.value_float();
#if ENABLED(MPC_INCLUDE_FAN)
if (parser.seenval('F')) mpc.applyFanAdjustment(parser.value_float());
#endif
if (parser.seenval('H')) mpc.filament_heat_capacity_permm = parser.value_float();
return;
}
M306_report(true);
}
void GcodeSuite::M306_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F("Model predictive control"));
HOTEND_LOOP() {
report_echo_start(forReplay);
MPC_t &mpc = thermalManager.temp_hotend[e].mpc;
SERIAL_ECHOPGM(" M306 E", e,
" P", p_float_t(mpc.heater_power, 2),
" C", p_float_t(mpc.block_heat_capacity, 2),
" R", p_float_t(mpc.sensor_responsiveness, 4),
" A", p_float_t(mpc.ambient_xfer_coeff_fan0, 4)
);
#if ENABLED(MPC_INCLUDE_FAN)
SERIAL_ECHOPGM(" F", p_float_t(mpc.fanCoefficient(), 4));
#endif
SERIAL_ECHOLNPGM(" H", p_float_t(mpc.filament_heat_capacity_permm, 4));
}
}
#endif // MPCTEMP
|
2301_81045437/Marlin
|
Marlin/src/gcode/temp/M306.cpp
|
C++
|
agpl-3.0
| 4,163
|
/**
* 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*/) {
TERN_(MARLIN_SMALL_BUILD, return);
hotend_idle_settings_t &c = hotend_idle.cfg;
report_heading(forReplay, F("Hotend Idle Timeout"));
SERIAL_ECHOLNPGM(" M86"
#if HAS_HEATED_BED
" B", c.bed_target,
#endif
" E", c.nozzle_target,
" S", c.timeout,
" T", c.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();
hotend_idle_settings_t &c = hotend_idle.cfg;
if (parser.seenval('S')) c.timeout = parser.value_ushort();
if (parser.seenval('T')) c.trigger = parser.value_celsius();
if (parser.seenval('E')) c.nozzle_target = parser.value_celsius();
#if HAS_HEATED_BED
if (parser.seenval('B')) c.bed_target = parser.value_celsius();
#endif
const celsius_t min_trigger = c.nozzle_target + TEMP_HYSTERESIS;
if (c.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.cfg.timeout = 0;
}
#endif // HOTEND_IDLE_TIMEOUT
|
2301_81045437/Marlin
|
Marlin/src/gcode/temp/M86_M87.cpp
|
C++
|
agpl-3.0
| 2,534
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(INCH_MODE_SUPPORT)
#include "../gcode.h"
/**
* G20: Set input mode to inches
*/
void GcodeSuite::G20() { parser.set_input_linear_units(LINEARUNIT_INCH); }
/**
* G21: Set input mode to millimeters
*/
void GcodeSuite::G21() { parser.set_input_linear_units(LINEARUNIT_MM); }
#endif // INCH_MODE_SUPPORT
|
2301_81045437/Marlin
|
Marlin/src/gcode/units/G20_G21.cpp
|
C++
|
agpl-3.0
| 1,220
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(TEMPERATURE_UNITS_SUPPORT)
#include "../gcode.h"
/**
* M149: Set temperature units
*/
void GcodeSuite::M149() {
if (parser.seen('C')) parser.set_input_temp_units(TEMPUNIT_C);
else if (parser.seen('K')) parser.set_input_temp_units(TEMPUNIT_K);
else if (parser.seen('F')) parser.set_input_temp_units(TEMPUNIT_F);
else M149_report();
}
void GcodeSuite::M149_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_TEMPERATURE_UNITS));
SERIAL_ECHOLN(F(" M149 "), C(parser.temp_units_code()), F(" ; Units in "), parser.temp_units_name());
}
#endif // TEMPERATURE_UNITS_SUPPORT
|
2301_81045437/Marlin
|
Marlin/src/gcode/units/M149.cpp
|
C++
|
agpl-3.0
| 1,566
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfigPre.h"
#if HAS_EXTRUDERS
#include "../gcode.h"
/**
* M82: Set E codes absolute (default)
*/
void GcodeSuite::M82() { set_e_absolute(); }
/**
* M83: Set E codes relative while in Absolute Coordinates (G90) mode
*/
void GcodeSuite::M83() { set_e_relative(); }
#endif // HAS_EXTRUDERS
|
2301_81045437/Marlin
|
Marlin/src/gcode/units/M82_M83.cpp
|
C++
|
agpl-3.0
| 1,186
|
/**
* 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/>.
*
*/
#pragma once
/**
* Changes.h
*
* Alert about Configuration changes at compile-time.
*/
/**
* Warnings for old configurations
*/
#ifdef GITHUB_ACTION
// Skip change alerts during CI Test
#elif WATCH_TEMP_PERIOD > 500
#error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds."
#elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
#error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS."
#elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
#error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED."
#elif defined(NO_FAN_SLOWING_IN_PID_TUNING)
#error "NO_FAN_SLOWING_IN_PID_TUNING is now TEMP_TUNING_MAINTAIN_FAN."
#elif (CORE_IS_XZ || CORE_IS_YZ) && ENABLED(Z_LATE_ENABLE)
#error "Z_LATE_ENABLE can't be used with COREXZ, COREZX, COREYZ, or COREZY."
#elif defined(X_HOME_RETRACT_MM)
#error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM."
#elif defined(SDCARDDETECTINVERTED)
#error "SDCARDDETECTINVERTED is now SD_DETECT_STATE (HIGH)."
#elif defined(SD_DETECT_INVERTED)
#error "SD_DETECT_INVERTED is now SD_DETECT_STATE (HIGH)."
#elif defined(BTENABLED)
#error "BTENABLED is now BLUETOOTH."
#elif defined(CUSTOM_MENDEL_NAME)
#error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME."
#elif defined(HAS_AUTOMATIC_VERSIONING)
#error "HAS_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE."
#elif defined(USE_AUTOMATIC_VERSIONING)
#error "USE_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE."
#elif defined(SDSLOW)
#error "SDSLOW deprecated. Set SD_SPI_SPEED to SPI_HALF_SPEED instead."
#elif defined(SDEXTRASLOW)
#error "SDEXTRASLOW deprecated. Set SD_SPI_SPEED to SPI_QUARTER_SPEED instead."
#elif defined(FILAMENT_SENSOR)
#error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR."
#elif defined(ENDSTOPPULLUP_FIL_RUNOUT)
#error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP."
#elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS)
#error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Endstops are automatically determined."
#elif defined(LANGUAGE_INCLUDE)
#error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE."
#elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y)
#error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead."
#elif defined(PID_PARAMS_PER_EXTRUDER)
#error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead."
#elif defined(EXTRUDER_WATTS) || defined(BED_WATTS)
#error "EXTRUDER_WATTS and BED_WATTS are deprecated and should be removed."
#elif defined(SERVO_ENDSTOP_ANGLES)
#error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead."
#elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR)
#error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed."
#elif defined(Z_ENDSTOP_SERVO_NR)
#error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR."
#elif defined(DEFAULT_XYJERK)
#error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead."
#elif defined(ALLOW_LOW_EJERK)
#error "ALLOW_LOW_EJERK is deprecated and should be removed."
#elif defined(XY_TRAVEL_SPEED)
#error "XY_TRAVEL_SPEED is now XY_PROBE_FEEDRATE."
#elif defined(XY_PROBE_SPEED)
#error "XY_PROBE_SPEED is now XY_PROBE_FEEDRATE."
#elif defined(Z_PROBE_SPEED_FAST)
#error "Z_PROBE_SPEED_FAST is now Z_PROBE_FEEDRATE_FAST."
#elif defined(Z_PROBE_SPEED_SLOW)
#error "Z_PROBE_SPEED_SLOW is now Z_PROBE_FEEDRATE_SLOW."
#elif defined(PROBE_SERVO_DEACTIVATION_DELAY)
#error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead."
#elif defined(SERVO_DEACTIVATION_DELAY)
#error "SERVO_DEACTIVATION_DELAY is now SERVO_DELAY."
#elif ENABLED(FILAMENTCHANGEENABLE)
#error "FILAMENTCHANGEENABLE is now ADVANCED_PAUSE_FEATURE."
#elif ENABLED(FILAMENT_CHANGE_FEATURE)
#error "FILAMENT_CHANGE_FEATURE is now ADVANCED_PAUSE_FEATURE."
#elif defined(FILAMENT_CHANGE_X_POS) || defined(FILAMENT_CHANGE_Y_POS)
#error "FILAMENT_CHANGE_[XY]_POS is now set with NOZZLE_PARK_POINT."
#elif defined(FILAMENT_CHANGE_Z_ADD)
#error "FILAMENT_CHANGE_Z_ADD is now set with NOZZLE_PARK_POINT."
#elif defined(FILAMENT_CHANGE_XY_FEEDRATE)
#error "FILAMENT_CHANGE_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE."
#elif defined(FILAMENT_CHANGE_Z_FEEDRATE)
#error "FILAMENT_CHANGE_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE."
#elif defined(PAUSE_PARK_X_POS) || defined(PAUSE_PARK_Y_POS)
#error "PAUSE_PARK_[XY]_POS is now set with NOZZLE_PARK_POINT."
#elif defined(PAUSE_PARK_Z_ADD)
#error "PAUSE_PARK_Z_ADD is now set with NOZZLE_PARK_POINT."
#elif defined(PAUSE_PARK_XY_FEEDRATE)
#error "PAUSE_PARK_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE."
#elif defined(PAUSE_PARK_Z_FEEDRATE)
#error "PAUSE_PARK_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE."
#elif defined(FILAMENT_CHANGE_RETRACT_FEEDRATE)
#error "FILAMENT_CHANGE_RETRACT_FEEDRATE is now PAUSE_PARK_RETRACT_FEEDRATE."
#elif defined(FILAMENT_CHANGE_RETRACT_LENGTH)
#error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH."
#elif defined(FILAMENT_CHANGE_EXTRUDE_FEEDRATE)
#error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE."
#elif defined(ADVANCED_PAUSE_EXTRUDE_FEEDRATE)
#error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE."
#elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH)
#error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH."
#elif defined(ADVANCED_PAUSE_EXTRUDE_LENGTH)
#error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH."
#elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT)
#error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT."
#elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS)
#error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS."
#elif defined(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT)
#error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT."
#elif defined(PLA_PREHEAT_HOTEND_TEMP)
#error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND."
#elif defined(PLA_PREHEAT_HPB_TEMP)
#error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED."
#elif defined(PLA_PREHEAT_FAN_SPEED)
#error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED."
#elif defined(ABS_PREHEAT_HOTEND_TEMP)
#error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND."
#elif defined(ABS_PREHEAT_HPB_TEMP)
#error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED."
#elif defined(ABS_PREHEAT_FAN_SPEED)
#error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED."
#elif defined(ENDSTOPS_ONLY_FOR_HOMING)
#error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead."
#elif defined(HOMING_FEEDRATE)
#error "HOMING_FEEDRATE is now set using the HOMING_FEEDRATE_MM_M array instead."
#elif (defined(HOMING_FEEDRATE_XY) || defined(HOMING_FEEDRATE_Z)) && !defined(HOMING_FEEDRATE_MM_M)
#error "HOMING_FEEDRATE_XY and HOMING_FEEDRATE_Z are now set using the HOMING_FEEDRATE_MM_M array instead."
#elif defined(MANUAL_HOME_POSITIONS)
#error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead."
#elif defined(PID_ADD_EXTRUSION_RATE)
#error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default."
#elif defined(Z_RAISE_BEFORE_HOMING)
#error "Z_RAISE_BEFORE_HOMING is now Z_CLEARANCE_FOR_HOMING."
#elif defined(MIN_Z_HEIGHT_FOR_HOMING)
#error "MIN_Z_HEIGHT_FOR_HOMING is now Z_CLEARANCE_FOR_HOMING."
#elif defined(Z_HOMING_HEIGHT)
#error "Z_HOMING_HEIGHT is now Z_CLEARANCE_FOR_HOMING."
#elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING)
#error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead."
#elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS)
#error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES."
#elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT)
#error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES."
#elif defined(MANUAL_BED_LEVELING)
#error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING."
#elif defined(MESH_HOME_SEARCH_Z)
#error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE."
#elif defined(MANUAL_PROBE_Z_RANGE)
#error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE."
#elif !defined(MIN_STEPS_PER_SEGMENT)
#error "Please replace 'const int dropsegments' with '#define MIN_STEPS_PER_SEGMENT' (and increase by 1)."
#elif MIN_STEPS_PER_SEGMENT <= 0
#error "MIN_STEPS_PER_SEGMENT must be at least 1."
#elif defined(PREVENT_DANGEROUS_EXTRUDE)
#error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION."
#elif defined(SCARA)
#error "SCARA is now MORGAN_SCARA."
#elif defined(ENABLE_AUTO_BED_LEVELING)
#error "ENABLE_AUTO_BED_LEVELING is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
#elif defined(AUTO_BED_LEVELING_FEATURE)
#error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
#elif defined(ABL_GRID_POINTS)
#error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y."
#elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y)
#error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]."
#elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y)
#error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]."
#elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS)
#error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]."
#elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS)
#error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]."
#elif defined(UBL_G26_MESH_VALIDATION)
#error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION."
#elif defined(UBL_MESH_EDIT_ENABLED)
#error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION."
#elif defined(UBL_MESH_EDITING)
#error "UBL_MESH_EDITING is now G26_MESH_VALIDATION."
#elif defined(BLTOUCH_HEATERS_OFF)
#error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF."
#elif defined(BLTOUCH_V3)
#error "BLTOUCH_V3 is obsolete."
#elif defined(BLTOUCH_FORCE_OPEN_DRAIN_MODE)
#error "BLTOUCH_FORCE_OPEN_DRAIN_MODE is obsolete."
#elif defined(BEEPER)
#error "BEEPER is now BEEPER_PIN."
#elif defined(SDCARDDETECT)
#error "SDCARDDETECT is now SD_DETECT_PIN."
#elif defined(STAT_LED_RED) || defined(STAT_LED_BLUE)
#error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN."
#elif defined(LCD_PIN_BL)
#error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN."
#elif defined(LCD_PIN_RESET)
#error "LCD_PIN_RESET is now LCD_RESET_PIN."
#elif defined(EXTRUDER_0_AUTO_FAN_PIN) || defined(EXTRUDER_1_AUTO_FAN_PIN) || defined(EXTRUDER_2_AUTO_FAN_PIN) || defined(EXTRUDER_3_AUTO_FAN_PIN)
#error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN."
#elif defined(min_software_endstops) || defined(max_software_endstops)
#error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS."
#elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN)
#error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)."
#elif defined(CONTROLLERFAN_PIN)
#error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN."
#elif defined(CONTROLLERFAN_SPEED)
#error "CONTROLLERFAN_SPEED is now CONTROLLERFAN_SPEED_ACTIVE."
#elif defined(CONTROLLERFAN_SECS)
#error "CONTROLLERFAN_SECS is now CONTROLLERFAN_IDLE_TIME."
#elif defined(MIN_RETRACT)
#error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT."
#elif defined(ADVANCE)
#error "ADVANCE is now LIN_ADVANCE."
#elif defined(LIN_ADVANCE_E_D_RATIO)
#error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO."
#elif defined(NEOPIXEL_RGBW_LED)
#error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED."
#elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS)
#error "Remove DELTA_PROBEABLE_RADIUS and use PROBING_MARGIN to inset the probe area instead."
#elif ENABLED(DELTA) && defined(DELTA_CALIBRATION_RADIUS)
#error "Remove DELTA_CALIBRATION_RADIUS and use PROBING_MARGIN to inset the probe area instead."
#elif defined(UBL_MESH_INSET)
#error "UBL_MESH_INSET is now just MESH_INSET."
#elif defined(UBL_MESH_MIN_X) || defined(UBL_MESH_MIN_Y) || defined(UBL_MESH_MAX_X) || defined(UBL_MESH_MAX_Y)
#error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]."
#elif defined(ABL_PROBE_PT_1_X) || defined(ABL_PROBE_PT_1_Y) || defined(ABL_PROBE_PT_2_X) || defined(ABL_PROBE_PT_2_Y) || defined(ABL_PROBE_PT_3_X) || defined(ABL_PROBE_PT_3_Y)
#error "ABL_PROBE_PT_[123]_[XY] is no longer required. Please remove it."
#elif defined(UBL_PROBE_PT_1_X) || defined(UBL_PROBE_PT_1_Y) || defined(UBL_PROBE_PT_2_X) || defined(UBL_PROBE_PT_2_Y) || defined(UBL_PROBE_PT_3_X) || defined(UBL_PROBE_PT_3_Y)
#error "UBL_PROBE_PT_[123]_[XY] is no longer required. Please remove it."
#elif defined(MIN_PROBE_EDGE)
#error "MIN_PROBE_EDGE is now called PROBING_MARGIN."
#elif defined(MIN_PROBE_EDGE_LEFT)
#error "MIN_PROBE_EDGE_LEFT is now called PROBING_MARGIN_LEFT."
#elif defined(MIN_PROBE_EDGE_RIGHT)
#error "MIN_PROBE_EDGE_RIGHT is now called PROBING_MARGIN_RIGHT."
#elif defined(MIN_PROBE_EDGE_FRONT)
#error "MIN_PROBE_EDGE_FRONT is now called PROBING_MARGIN_FRONT."
#elif defined(MIN_PROBE_EDGE_BACK)
#error "MIN_PROBE_EDGE_BACK is now called PROBING_MARGIN_BACK."
#elif defined(LEFT_PROBE_BED_POSITION)
#error "LEFT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_LEFT instead."
#elif defined(RIGHT_PROBE_BED_POSITION)
#error "RIGHT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_RIGHT instead."
#elif defined(FRONT_PROBE_BED_POSITION)
#error "FRONT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_FRONT instead."
#elif defined(BACK_PROBE_BED_POSITION)
#error "BACK_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_BACK instead."
#elif defined(ENABLE_MESH_EDIT_GFX_OVERLAY)
#error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY."
#elif defined(BABYSTEP_ZPROBE_GFX_REVERSE)
#error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE."
#elif defined(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN)
#error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES."
#elif HAS_PID_HEATING && (defined(K1) || !defined(PID_K1))
#error "K1 is now PID_K1."
#elif defined(PROBE_DOUBLE_TOUCH)
#error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING."
#elif defined(ANET_KEYPAD_LCD)
#error "ANET_KEYPAD_LCD is now ZONESTAR_LCD."
#elif defined(LCD_I2C_SAINSMART_YWROBOT)
#error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004)."
#elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT)
#error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN."
#elif defined(HAVE_TMCDRIVER)
#error "HAVE_TMCDRIVER is obsolete."
#elif defined(STEALTHCHOP)
#error "STEALTHCHOP is now STEALTHCHOP_(XY|Z|E)."
#elif defined(HAVE_TMC26X)
#error "HAVE_TMC26X is now obsolete."
#elif defined(HAVE_TMC2130)
#error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130."
#elif defined(HAVE_TMC2208)
#error "HAVE_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208."
#elif defined(HAVE_L6470DRIVER)
#error "HAVE_L6470DRIVER is obsolete. L64xx stepper drivers are no longer supported in Marlin."
#elif defined(X_IS_TMC) || defined(X2_IS_TMC) || defined(Y_IS_TMC) || defined(Y2_IS_TMC) || defined(Z_IS_TMC) || defined(Z2_IS_TMC) || defined(Z3_IS_TMC) \
|| defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) || defined(E5_IS_TMC) || defined(E6_IS_TMC) || defined(E7_IS_TMC)
#error "[AXIS]_IS_TMC is now obsolete."
#elif defined(X_IS_TMC26X) || defined(X2_IS_TMC26X) || defined(Y_IS_TMC26X) || defined(Y2_IS_TMC26X) || defined(Z_IS_TMC26X) || defined(Z2_IS_TMC26X) || defined(Z3_IS_TMC26X) \
|| defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) || defined(E5_IS_TMC26X) || defined(E6_IS_TMC26X) || defined(E7_IS_TMC26X)
#error "[AXIS]_IS_TMC26X is now obsolete."
#elif defined(X_IS_TMC2130) || defined(X2_IS_TMC2130) || defined(Y_IS_TMC2130) || defined(Y2_IS_TMC2130) || defined(Z_IS_TMC2130) || defined(Z2_IS_TMC2130) || defined(Z3_IS_TMC2130) \
|| defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) || defined(E5_IS_TMC2130) || defined(E6_IS_TMC2130) || defined(E7_IS_TMC2130)
#error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130."
#elif defined(X_IS_TMC2208) || defined(X2_IS_TMC2208) || defined(Y_IS_TMC2208) || defined(Y2_IS_TMC2208) || defined(Z_IS_TMC2208) || defined(Z2_IS_TMC2208) || defined(Z3_IS_TMC2208) \
|| defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208) || defined(E5_IS_TMC2208) || defined(E6_IS_TMC2208) || defined(E7_IS_TMC2208)
#error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208."
#elif defined(AUTOMATIC_CURRENT_CONTROL)
#error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS."
#elif defined(FILAMENT_CHANGE_LOAD_LENGTH)
#error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH."
#elif defined(LEVEL_CORNERS_INSET)
#error "LEVEL_CORNERS_INSET is now BED_TRAMMING_INSET_LFRB."
#elif defined(BEZIER_JERK_CONTROL)
#error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION."
#elif HAS_JUNCTION_DEVIATION && defined(JUNCTION_DEVIATION_FACTOR)
#error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM."
#elif defined(JUNCTION_ACCELERATION_FACTOR)
#error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h."
#elif defined(JUNCTION_ACCELERATION)
#error "JUNCTION_ACCELERATION is obsolete. Delete it from Configuration_adv.h."
#elif defined(MAX7219_DEBUG_STEPPER_HEAD)
#error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD."
#elif defined(MAX7219_DEBUG_STEPPER_TAIL)
#error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL."
#elif defined(MAX7219_DEBUG_STEPPER_QUEUE)
#error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE."
#elif defined(ENDSTOP_NOISE_FILTER)
#error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]."
#elif defined(RETRACT_ZLIFT)
#error "RETRACT_ZLIFT is now RETRACT_ZRAISE."
#elif defined(TOOLCHANGE_FS_INIT_BEFORE_SWAP)
#error "TOOLCHANGE_FS_INIT_BEFORE_SWAP is now TOOLCHANGE_FS_SLOW_FIRST_PRIME."
#elif defined(TOOLCHANGE_PARK_ZLIFT) || defined(TOOLCHANGE_UNPARK_ZLIFT)
#error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE."
#elif defined(SINGLENOZZLE_TOOLCHANGE_ZRAISE)
#error "SINGLENOZZLE_TOOLCHANGE_ZRAISE is now TOOLCHANGE_ZRAISE."
#elif defined(SINGLENOZZLE_SWAP_LENGTH)
#error "SINGLENOZZLE_SWAP_LENGTH is now TOOLCHANGE_FIL_SWAP_LENGTH."
#elif defined(SINGLENOZZLE_SWAP_RETRACT_SPEED)
#error "SINGLENOZZLE_SWAP_RETRACT_SPEED is now TOOLCHANGE_FIL_SWAP_RETRACT_SPEED."
#elif defined(SINGLENOZZLE_SWAP_PRIME_SPEED)
#error "SINGLENOZZLE_SWAP_PRIME_SPEED is now TOOLCHANGE_FIL_SWAP_PRIME_SPEED."
#elif defined(SINGLENOZZLE_SWAP_PARK)
#error "SINGLENOZZLE_SWAP_PARK is now TOOLCHANGE_PARK."
#elif defined(SINGLENOZZLE_TOOLCHANGE_XY)
#error "SINGLENOZZLE_TOOLCHANGE_XY is now TOOLCHANGE_PARK_XY."
#elif defined(SINGLENOZZLE_PARK_XY_FEEDRATE)
#error "SINGLENOZZLE_PARK_XY_FEEDRATE is now TOOLCHANGE_PARK_XY_FEEDRATE."
#elif defined(PARKING_EXTRUDER_SECURITY_RAISE)
#error "PARKING_EXTRUDER_SECURITY_RAISE is now TOOLCHANGE_ZRAISE."
#elif defined(SWITCHING_TOOLHEAD_SECURITY_RAISE)
#error "SWITCHING_TOOLHEAD_SECURITY_RAISE is now TOOLCHANGE_ZRAISE."
#elif defined(G0_FEEDRATE) && G0_FEEDRATE == 0
#error "G0_FEEDRATE is now used to set the G0 feedrate."
#elif defined(MBL_Z_STEP)
#error "MBL_Z_STEP is now MESH_EDIT_Z_STEP."
#elif defined(CHDK)
#error "CHDK is now CHDK_PIN."
#elif ANY_PIN( \
MAX6675_SS, MAX6675_SS2, MAX6675_SS3, MAX6675_CS, MAX6675_CS2, MAX6675_CS3,\
MAX31855_SS, MAX31855_SS2, MAX31855_SS3, MAX31855_CS, MAX31855_CS2, MAX31855_CS3, \
MAX31865_SS, MAX31865_SS2, MAX31865_SS3, MAX31865_CS, MAX31865_CS2, MAX31865_CS3)
#warning "MAX*_SS_PIN, MAX*_SS2_PIN, MAX*_SS3_PIN, MAX*_CS_PIN, MAX*_CS2_PIN, and MAX*_CS3_PIN, are obsolete. Please use TEMP_0_CS_PIN/TEMP_1_CS_PIN/TEMP_2_CS_PIN instead."
#elif ANY_PIN(MAX6675_SCK, MAX31855_SCK, MAX31865_SCK)
#warning "MAX*_SCK_PIN is obsolete. Please use TEMP_0_SCK_PIN/TEMP_1_SCK_PIN/TEMP_2_SCK_PIN instead."
#elif ANY_PIN(MAX6675_MISO, MAX6675_DO, MAX31855_MISO, MAX31855_DO, MAX31865_MISO, MAX31865_DO)
#warning "MAX*_MISO_PIN and MAX*_DO_PIN are obsolete. Please use TEMP_0_MISO_PIN/TEMP_1_MISO_PIN/TEMP_2_MISO_PIN instead."
#elif PIN_EXISTS(MAX31865_MOSI)
#warning "MAX31865_MOSI_PIN is obsolete. Please use TEMP_0_MOSI_PIN/TEMP_1_MOSI_PIN/TEMP_2_MOSI_PIN instead."
#elif ANY_PIN(THERMO_CS1_PIN, THERMO_CS2_PIN, THERMO_CS3_PIN, THERMO_DO_PIN, THERMO_SCK_PIN)
#error "THERMO_*_PIN is now TEMP_n_CS_PIN, TEMP_n_SCK_PIN, TEMP_n_MOSI_PIN, TEMP_n_MISO_PIN."
#elif defined(MAX31865_SENSOR_OHMS)
#error "MAX31865_SENSOR_OHMS is now MAX31865_SENSOR_OHMS_0."
#elif defined(MAX31865_CALIBRATION_OHMS)
#error "MAX31865_CALIBRATION_OHMS is now MAX31865_CALIBRATION_OHMS_0."
#elif defined(SPINDLE_LASER_ENABLE)
#error "SPINDLE_LASER_ENABLE is now SPINDLE_FEATURE or LASER_FEATURE."
#elif defined(SPINDLE_LASER_ENABLE_PIN)
#error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN."
#elif defined(SPINDLE_DIR_CHANGE)
#error "SPINDLE_DIR_CHANGE is now SPINDLE_CHANGE_DIR."
#elif defined(SPINDLE_STOP_ON_DIR_CHANGE)
#error "SPINDLE_STOP_ON_DIR_CHANGE is now SPINDLE_CHANGE_DIR_STOP."
#elif defined(SPINDLE_LASER_ACTIVE_HIGH)
#error "SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE."
#elif defined(SPINDLE_LASER_ENABLE_INVERT)
#error "SPINDLE_LASER_ENABLE_INVERT is now SPINDLE_LASER_ACTIVE_STATE."
#elif defined(LASER_POWER_INLINE)
#error "LASER_POWER_INLINE is not required, inline mode is enabled with 'M3 I' and disabled with 'M5 I'."
#elif defined(LASER_POWER_INLINE_TRAPEZOID)
#error "LASER_POWER_INLINE_TRAPEZOID is now LASER_POWER_TRAP."
#elif defined(LASER_POWER_INLINE_TRAPEZOID_CONT)
#error "LASER_POWER_INLINE_TRAPEZOID_CONT is replaced with LASER_POWER_TRAP."
#elif defined(LASER_POWER_INLINE_TRAPEZOID_PER)
#error "LASER_POWER_INLINE_TRAPEZOID_CONT_PER replaced with LASER_POWER_TRAP."
#elif defined(LASER_POWER_INLINE_CONTINUOUS)
#error "LASER_POWER_INLINE_CONTINUOUS is not required, inline mode is enabled with 'M3 I' and disabled with 'M5 I'."
#elif defined(CUTTER_POWER_DISPLAY)
#error "CUTTER_POWER_DISPLAY is now CUTTER_POWER_UNIT."
#elif defined(CHAMBER_HEATER_PIN)
#error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN."
#elif defined(TMC_Z_CALIBRATION)
#error "TMC_Z_CALIBRATION has been deprecated in favor of MECHANICAL_GANTRY_CALIBRATION."
#elif defined(Z_MIN_PROBE_ENDSTOP)
#error "Z_MIN_PROBE_ENDSTOP is no longer required. Please remove it."
#elif defined(DUAL_NOZZLE_DUPLICATION_MODE)
#error "DUAL_NOZZLE_DUPLICATION_MODE is now MULTI_NOZZLE_DUPLICATION."
#elif defined(MENU_ITEM_CASE_LIGHT)
#error "MENU_ITEM_CASE_LIGHT is now CASE_LIGHT_MENU."
#elif defined(CASE_LIGHT_NEOPIXEL_COLOR)
#error "CASE_LIGHT_NEOPIXEL_COLOR is now CASE_LIGHT_DEFAULT_COLOR."
#elif defined(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
#error "ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED is now SD_ABORT_ON_ENDSTOP_HIT."
#elif defined(LPC_SD_LCD) || defined(LPC_SD_ONBOARD) || defined(LPC_SD_CUSTOM_CABLE)
#error "LPC_SD_(LCD|ONBOARD|CUSTOM_CABLE) are now SDCARD_CONNECTION."
#elif defined(USB_SD_DISABLED)
#error "USB_SD_DISABLED is now NO_SD_HOST_DRIVE."
#elif defined(USB_SD_ONBOARD)
#error "USB_SD_ONBOARD is obsolete. Disable NO_SD_HOST_DRIVE instead."
#elif defined(PSU_ACTIVE_HIGH)
#error "PSU_ACTIVE_HIGH is now PSU_ACTIVE_STATE."
#elif POWER_SUPPLY == 1
#error "Replace POWER_SUPPLY 1 by enabling PSU_CONTROL and setting PSU_ACTIVE_STATE to 'LOW'."
#elif POWER_SUPPLY == 2
#error "Replace POWER_SUPPLY 2 by enabling PSU_CONTROL and setting PSU_ACTIVE_STATE to 'HIGH'."
#elif defined(POWER_SUPPLY)
#error "POWER_SUPPLY is now obsolete. Please remove it."
#elif defined(MKS_ROBIN_TFT)
#error "MKS_ROBIN_TFT is now FSMC_GRAPHICAL_TFT."
#elif defined(SDPOWER)
#error "SDPOWER is now SDPOWER_PIN."
#elif defined(STRING_SPLASH_LINE1) || defined(STRING_SPLASH_LINE2)
#error "STRING_SPLASH_LINE[12] are now obsolete. Please remove them."
#elif defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_X)
#error "Z_PROBE_ALLEN_KEY_(DEPLOY|STOW) coordinates are now a single setting."
#elif defined(X_PROBE_OFFSET_FROM_EXTRUDER) || defined(Y_PROBE_OFFSET_FROM_EXTRUDER) || defined(Z_PROBE_OFFSET_FROM_EXTRUDER)
#error "[XYZ]_PROBE_OFFSET_FROM_EXTRUDER is now NOZZLE_TO_PROBE_OFFSET."
#elif defined(MIN_PROBE_X) || defined(MIN_PROBE_Y) || defined(MAX_PROBE_X) || defined(MAX_PROBE_Y)
#error "(MIN|MAX)_PROBE_[XY] are now calculated at runtime. Please remove them."
#elif defined(Z_STEPPER_ALIGN_X) || defined(Z_STEPPER_ALIGN_X)
#error "Z_STEPPER_ALIGN_X and Z_STEPPER_ALIGN_Y are now combined as Z_STEPPER_ALIGN_XY."
#elif defined(JUNCTION_DEVIATION)
#error "JUNCTION_DEVIATION is no longer required. (See CLASSIC_JERK). Please remove it."
#elif defined(BABYSTEP_MULTIPLICATOR)
#error "BABYSTEP_MULTIPLICATOR is now BABYSTEP_MULTIPLICATOR_[XY|Z]."
#elif defined(LULZBOT_TOUCH_UI)
#error "LULZBOT_TOUCH_UI is now TOUCH_UI_FTDI_EVE."
#elif defined(PS_DEFAULT_OFF)
#error "PS_DEFAULT_OFF is now PSU_DEFAULT_OFF."
#elif defined(FILAMENT_UNLOAD_RETRACT_LENGTH)
#error "FILAMENT_UNLOAD_RETRACT_LENGTH is now FILAMENT_UNLOAD_PURGE_RETRACT."
#elif defined(FILAMENT_UNLOAD_DELAY)
#error "FILAMENT_UNLOAD_DELAY is now FILAMENT_UNLOAD_PURGE_DELAY."
#elif defined(HOME_USING_SPREADCYCLE)
#error "HOME_USING_SPREADCYCLE is now obsolete. Please remove it."
#elif defined(DGUS_LCD)
#error "DGUS_LCD is now DGUS_LCD_UI ORIGIN|FYSETC|HIPRECY)."
#elif defined(DGUS_SERIAL_PORT)
#error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT."
#elif defined(DGUS_BAUDRATE)
#error "DGUS_BAUDRATE is now LCD_BAUDRATE."
#elif defined(DGUS_STATS_RX_BUFFER_OVERRUNS)
#error "DGUS_STATS_RX_BUFFER_OVERRUNS is now STATS_RX_BUFFER_OVERRUNS."
#elif defined(ANYCUBIC_LCD_SERIAL_PORT)
#error "ANYCUBIC_LCD_SERIAL_PORT is now LCD_SERIAL_PORT."
#elif defined(INTERNAL_SERIAL_PORT)
#error "INTERNAL_SERIAL_PORT is now MMU2_SERIAL_PORT."
#elif defined(X_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Y_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Z_DUAL_ENDSTOPS_ADJUSTMENT)
#error "[XYZ]_DUAL_ENDSTOPS_ADJUSTMENT is now [XYZ]2_ENDSTOP_ADJUSTMENT."
#elif defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT2) || defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT3)
#error "Z_TRIPLE_ENDSTOPS_ADJUSTMENT[23] is now Z[23]_ENDSTOP_ADJUSTMENT."
#elif defined(Z_QUAD_ENDSTOPS_ADJUSTMENT2) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT3) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT4)
#error "Z_QUAD_ENDSTOPS_ADJUSTMENT[234] is now Z[234]_ENDSTOP_ADJUSTMENT."
#elif defined(Z_DUAL_STEPPER_DRIVERS)
#error "Z_DUAL_STEPPER_DRIVERS is no longer needed and should be removed."
#elif defined(Z_TRIPLE_STEPPER_DRIVERS)
#error "Z_TRIPLE_STEPPER_DRIVERS is no longer needed and should be removed."
#elif defined(Z_QUAD_STEPPER_DRIVERS)
#error "Z_QUAD_STEPPER_DRIVERS is no longer needed and should be removed."
#elif defined(Z_DUAL_ENDSTOPS) || defined(Z_TRIPLE_ENDSTOPS) || defined(Z_QUAD_ENDSTOPS)
#error "Z_(DUAL|TRIPLE|QUAD)_ENDSTOPS is now Z_MULTI_ENDSTOPS."
#elif defined(DUGS_UI_MOVE_DIS_OPTION)
#error "DUGS_UI_MOVE_DIS_OPTION is spelled DGUS_UI_MOVE_DIS_OPTION."
#elif defined(ORIG_E0_AUTO_FAN_PIN) || defined(ORIG_E1_AUTO_FAN_PIN) || defined(ORIG_E2_AUTO_FAN_PIN) || defined(ORIG_E3_AUTO_FAN_PIN) || defined(ORIG_E4_AUTO_FAN_PIN) || defined(ORIG_E5_AUTO_FAN_PIN) || defined(ORIG_E6_AUTO_FAN_PIN) || defined(ORIG_E7_AUTO_FAN_PIN)
#error "ORIG_Ex_AUTO_FAN_PIN is now just Ex_AUTO_FAN_PIN."
#elif defined(ORIG_CHAMBER_AUTO_FAN_PIN)
#error "ORIG_CHAMBER_AUTO_FAN_PIN is now just CHAMBER_AUTO_FAN_PIN."
#elif defined(HOMING_BACKOFF_MM)
#error "HOMING_BACKOFF_MM is now HOMING_BACKOFF_POST_MM."
#elif defined(X_HOME_BUMP_MM) || defined(Y_HOME_BUMP_MM) || defined(Z_HOME_BUMP_MM)
#error "[XYZ]_HOME_BUMP_MM is now HOMING_BUMP_MM."
#elif defined(DIGIPOT_I2C)
#error "DIGIPOT_I2C is now DIGIPOT_MCP4451 (or DIGIPOT_MCP4018)."
#elif defined(TOUCH_BUTTONS)
#error "TOUCH_BUTTONS is now TOUCH_SCREEN."
#elif defined(LCD_FULL_PIXEL_HEIGHT) || defined(LCD_FULL_PIXEL_WIDTH)
#error "LCD_FULL_PIXEL_(WIDTH|HEIGHT) is deprecated and should be removed."
#elif defined(FSMC_UPSCALE)
#error "FSMC_UPSCALE is now GRAPHICAL_TFT_UPSCALE."
#elif defined(ANYCUBIC_TFT_MODEL)
#error "ANYCUBIC_TFT_MODEL is now ANYCUBIC_LCD_I3MEGA."
#elif defined(EVENT_GCODE_SD_STOP)
#error "EVENT_GCODE_SD_STOP is now EVENT_GCODE_SD_ABORT."
#elif defined(GRAPHICAL_TFT_ROTATE_180)
#error "GRAPHICAL_TFT_ROTATE_180 is now TFT_ROTATION set to TFT_ROTATE_180."
#elif defined(PROBE_OFFSET_START)
#error "PROBE_OFFSET_START is now PROBE_OFFSET_WIZARD_START_Z."
#elif defined(POWER_LOSS_PULL)
#error "POWER_LOSS_PULL is now specifically POWER_LOSS_PULL(UP|DOWN)."
#elif defined(SHORT_MANUAL_Z_MOVE)
#error "SHORT_MANUAL_Z_MOVE is now FINE_MANUAL_MOVE, applying to Z on most printers."
#elif defined(FIL_RUNOUT_INVERTING)
#if FIL_RUNOUT_INVERTING
#error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_STATE HIGH."
#else
#error "FIL_RUNOUT_INVERTING false is now FIL_RUNOUT_STATE LOW."
#endif
#elif defined(ASSISTED_TRAMMING_MENU_ITEM)
#error "ASSISTED_TRAMMING_MENU_ITEM is deprecated and should be removed."
#elif defined(UNKNOWN_Z_NO_RAISE)
#error "UNKNOWN_Z_NO_RAISE is replaced by setting Z_IDLE_HEIGHT to Z_MAX_POS."
#elif defined(Z_AFTER_DEACTIVATE)
#error "Z_AFTER_DEACTIVATE is replaced by Z_IDLE_HEIGHT."
#elif defined(MEATPACK)
#error "MEATPACK is now enabled with MEATPACK_ON_SERIAL_PORT_1, MEATPACK_ON_SERIAL_PORT_2, etc."
#elif defined(CUSTOM_USER_MENUS)
#error "CUSTOM_USER_MENUS has been replaced by CUSTOM_MENU_MAIN and CUSTOM_MENU_CONFIG."
#elif defined(MKS_LCD12864)
#error "MKS_LCD12864 is now MKS_LCD12864A or MKS_LCD12864B."
#elif defined(DOGM_SD_PERCENT)
#error "DOGM_SD_PERCENT is now SHOW_PROGRESS_PERCENT."
#elif defined(NEOPIXEL_BKGD_LED_INDEX)
#error "NEOPIXEL_BKGD_LED_INDEX is now NEOPIXEL_BKGD_INDEX_FIRST."
#elif defined(TEMP_SENSOR_1_AS_REDUNDANT)
#error "TEMP_SENSOR_1_AS_REDUNDANT is now TEMP_SENSOR_REDUNDANT, with associated TEMP_SENSOR_REDUNDANT_* config."
#elif defined(MAX_REDUNDANT_TEMP_SENSOR_DIFF)
#error "MAX_REDUNDANT_TEMP_SENSOR_DIFF is now TEMP_SENSOR_REDUNDANT_MAX_DIFF"
#elif defined(LCD_ALEPHOBJECTS_CLCD_UI)
#error "LCD_ALEPHOBJECTS_CLCD_UI is now LCD_LULZBOT_CLCD_UI."
#elif defined(MIN_ARC_SEGMENTS)
#error "MIN_ARC_SEGMENTS is now MIN_CIRCLE_SEGMENTS."
#elif defined(ARC_SEGMENTS_PER_R)
#error "ARC_SUPPORT no longer uses ARC_SEGMENTS_PER_R."
#elif ENABLED(ARC_SUPPORT) && (!defined(MIN_ARC_SEGMENT_MM) || !defined(MAX_ARC_SEGMENT_MM))
#error "ARC_SUPPORT now requires MIN_ARC_SEGMENT_MM and MAX_ARC_SEGMENT_MM."
#elif defined(LASER_POWER_INLINE)
#error "LASER_POWER_INLINE is obsolete."
#elif defined(SPINDLE_LASER_PWM)
#error "SPINDLE_LASER_PWM (true) is now set with SPINDLE_LASER_USE_PWM (enabled)."
#elif ANY(IS_RAMPS_EEB, IS_RAMPS_EEF, IS_RAMPS_EFB, IS_RAMPS_EFF, IS_RAMPS_SF)
#error "The IS_RAMPS_* conditionals (for heater/fan/bed pins) are now called FET_ORDER_*."
#elif defined(PROBE_TEMP_COMPENSATION)
#error "PROBE_TEMP_COMPENSATION is now set using the PTC_PROBE, PTC_BED, PTC_HOTEND options."
#elif defined(BTC_PROBE_TEMP)
#error "BTC_PROBE_TEMP is now PTC_PROBE_TEMP."
#elif defined(LCD_SCREEN_ROT_90)
#error "LCD_SCREEN_ROT_90 is now LCD_SCREEN_ROTATE with a value of 90."
#elif defined(LCD_SCREEN_ROT_180)
#error "LCD_SCREEN_ROT_180 is now LCD_SCREEN_ROTATE with a value of 180."
#elif defined(LCD_SCREEN_ROT_270)
#error "LCD_SCREEN_ROT_270 is now LCD_SCREEN_ROTATE with a value of 270."
#elif defined(DEFAULT_LCD_BRIGHTNESS)
#error "DEFAULT_LCD_BRIGHTNESS is now LCD_BRIGHTNESS_DEFAULT."
#elif defined(NOZZLE_PARK_X_ONLY)
#error "NOZZLE_PARK_X_ONLY is now NOZZLE_PARK_MOVE 1."
#elif defined(NOZZLE_PARK_Y_ONLY)
#error "NOZZLE_PARK_Y_ONLY is now NOZZLE_PARK_MOVE 2."
#elif defined(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
#error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS is now just Z_STEPPER_ALIGN_STEPPER_XY."
#elif defined(DWIN_CREALITY_LCD_ENHANCED)
#error "DWIN_CREALITY_LCD_ENHANCED is now DWIN_LCD_PROUI."
#elif defined(LINEAR_AXES)
#error "LINEAR_AXES is now NUM_AXES (to account for rotational axes)."
#elif defined(X_DUAL_STEPPER_DRIVERS)
#error "X_DUAL_STEPPER_DRIVERS is no longer needed and should be removed."
#elif defined(Y_DUAL_STEPPER_DRIVERS)
#error "Y_DUAL_STEPPER_DRIVERS is no longer needed and should be removed."
#elif defined(NUM_Z_STEPPER_DRIVERS)
#error "NUM_Z_STEPPER_DRIVERS is no longer needed and should be removed."
#elif defined(SNMM)
#error "SNMM is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
#elif defined(MK2_MULTIPLEXER)
#error "MK2_MULTIPLEXER is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
#elif defined(PRUSA_MMU2)
#error "PRUSA_MMU2 is obsolete. Define MMU_MODEL as PRUSA_MMU2 instead."
#elif defined(PRUSA_MMU2_S_MODE)
#error "PRUSA_MMU2_S_MODE is obsolete. Define MMU_MODEL as PRUSA_MMU2S instead."
#elif defined(SMUFF_EMU_MMU2)
#error "SMUFF_EMU_MMU2 is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2 instead."
#elif defined(SMUFF_EMU_MMU2S)
#error "SMUFF_EMU_MMU2S is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2S instead."
#elif defined(LEVEL_BED_CORNERS)
#error "LEVEL_BED_CORNERS is now LCD_BED_TRAMMING."
#elif defined(LEVEL_CORNERS_INSET_LFRB) || defined(LEVEL_CORNERS_HEIGHT) || defined(LEVEL_CORNERS_Z_HOP) || defined(LEVEL_CORNERS_USE_PROBE) || defined(LEVEL_CORNERS_PROBE_TOLERANCE) || defined(LEVEL_CORNERS_VERIFY_RAISED) || defined(LEVEL_CORNERS_AUDIO_FEEDBACK)
#error "LEVEL_CORNERS_* settings have been renamed BED_TRAMMING_*."
#elif defined(LEVEL_CENTER_TOO)
#error "LEVEL_CENTER_TOO is now BED_TRAMMING_INCLUDE_CENTER."
#elif defined(TOUCH_IDLE_SLEEP)
#error "TOUCH_IDLE_SLEEP (seconds) is now DISPLAY_SLEEP_MINUTES (minutes)."
#elif defined(TOUCH_IDLE_SLEEP_MINS)
#error "TOUCH_IDLE_SLEEP_MINS is now DISPLAY_SLEEP_MINUTES."
#elif defined(LCD_BACKLIGHT_TIMEOUT)
#error "LCD_BACKLIGHT_TIMEOUT (seconds) is now LCD_BACKLIGHT_TIMEOUT_MINS (minutes)."
#elif defined(LCD_SET_PROGRESS_MANUALLY)
#error "LCD_SET_PROGRESS_MANUALLY is now SET_PROGRESS_MANUALLY."
#elif defined(USE_M73_REMAINING_TIME)
#error "USE_M73_REMAINING_TIME is now SET_REMAINING_TIME."
#elif defined(SHOW_SD_PERCENT)
#error "SHOW_SD_PERCENT is now SHOW_PROGRESS_PERCENT."
#elif defined(LIN_ADVANCE_K)
#error "LIN_ADVANCE_K is now ADVANCE_K."
#elif defined(EXTRA_LIN_ADVANCE_K)
#error "EXTRA_LIN_ADVANCE_K is now ADVANCE_K_EXTRA."
#elif defined(POLAR_SEGMENTS_PER_SECOND) || defined(DELTA_SEGMENTS_PER_SECOND) || defined(SCARA_SEGMENTS_PER_SECOND) || defined(TPARA_SEGMENTS_PER_SECOND)
#error "(POLAR|DELTA|SCARA|TPARA)_SEGMENTS_PER_SECOND is now DEFAULT_SEGMENTS_PER_SECOND."
#elif defined(TMC_SW_MOSI) || defined(TMC_SW_MISO) || defined(TMC_SW_SCK)
#error "TMC_SW_(MOSI|MISO|SCK) is now TMC_SPI_(MOSI|MISO|SCK)."
#elif ANY(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY, DGUS_LCD_UI_MKS, DGUS_LCD_UI_RELOADED) && !defined(DGUS_LCD_UI)
#error "DGUS_LCD_UI_[TYPE] is now set using DGUS_LCD_UI TYPE."
#elif defined(DELTA_PRINTABLE_RADIUS)
#error "DELTA_PRINTABLE_RADIUS is now PRINTABLE_RADIUS."
#elif defined(SCARA_PRINTABLE_RADIUS)
#error "SCARA_PRINTABLE_RADIUS is now PRINTABLE_RADIUS."
#elif defined(SCARA_FEEDRATE_SCALING)
#error "SCARA_FEEDRATE_SCALING is now FEEDRATE_SCALING."
#elif defined(MILLISECONDS_PREHEAT_TIME)
#error "MILLISECONDS_PREHEAT_TIME is now PREHEAT_TIME_HOTEND_MS."
#elif defined(EXPERIMENTAL_SCURVE)
#error "EXPERIMENTAL_SCURVE is no longer needed and should be removed."
#elif defined(BABYSTEP_ZPROBE_GFX_OVERLAY)
#error "BABYSTEP_ZPROBE_GFX_OVERLAY is now BABYSTEP_GFX_OVERLAY."
#elif defined(DISABLE_INACTIVE_EXTRUDER)
#error "DISABLE_INACTIVE_EXTRUDER is now DISABLE_OTHER_EXTRUDERS."
#elif defined(INVERT_X_STEP_PIN) || defined(INVERT_Y_STEP_PIN) || defined(INVERT_Z_STEP_PIN) || defined(INVERT_I_STEP_PIN) || defined(INVERT_J_STEP_PIN) || defined(INVERT_K_STEP_PIN) || defined(INVERT_U_STEP_PIN) || defined(INVERT_V_STEP_PIN) || defined(INVERT_W_STEP_PIN) || defined(INVERT_E_STEP_PIN)
#error "INVERT_*_STEP_PIN true is now STEP_STATE_* LOW, and INVERT_*_STEP_PIN false is now STEP_STATE_* HIGH."
#elif defined(PROBE_PT_1_X) || defined(PROBE_PT_1_Y) || defined(PROBE_PT_2_X) || defined(PROBE_PT_2_Y) || defined(PROBE_PT_3_X) || defined(PROBE_PT_3_Y)
#error "PROBE_PT_[123]_[XY] is now defined using PROBE_PT_[123] with an array { x, y }."
#elif defined(SQUARE_WAVE_STEPPING)
#error "SQUARE_WAVE_STEPPING is now EDGE_STEPPING."
#elif defined(FAN_PIN)
#error "FAN_PIN is now FAN0_PIN."
#elif defined(X_MIN_ENDSTOP_INVERTING) || defined(Y_MIN_ENDSTOP_INVERTING) || defined(Z_MIN_ENDSTOP_INVERTING) \
|| defined(I_MIN_ENDSTOP_INVERTING) || defined(J_MIN_ENDSTOP_INVERTING) || defined(K_MIN_ENDSTOP_INVERTING) \
|| defined(U_MIN_ENDSTOP_INVERTING) || defined(V_MIN_ENDSTOP_INVERTING) || defined(W_MIN_ENDSTOP_INVERTING) \
|| defined(X_MAX_ENDSTOP_INVERTING) || defined(Y_MAX_ENDSTOP_INVERTING) || defined(Z_MAX_ENDSTOP_INVERTING) \
|| defined(I_MAX_ENDSTOP_INVERTING) || defined(J_MAX_ENDSTOP_INVERTING) || defined(K_MAX_ENDSTOP_INVERTING) \
|| defined(U_MAX_ENDSTOP_INVERTING) || defined(V_MAX_ENDSTOP_INVERTING) || defined(W_MAX_ENDSTOP_INVERTING) \
|| defined(Z_MIN_PROBE_ENDSTOP_INVERTING)
#error "*_ENDSTOP_INVERTING false/true is now set with *_ENDSTOP_HIT_STATE HIGH/LOW."
#elif defined(DISABLE_INACTIVE_X) || defined(DISABLE_INACTIVE_Y) || defined(DISABLE_INACTIVE_Z) \
|| defined(DISABLE_INACTIVE_I) || defined(DISABLE_INACTIVE_J) || defined(DISABLE_INACTIVE_K) \
|| defined(DISABLE_INACTIVE_U) || defined(DISABLE_INACTIVE_V) || defined(DISABLE_INACTIVE_W) || defined(DISABLE_INACTIVE_E)
#error "DISABLE_INACTIVE_[XYZIJKUVWE] is now DISABLE_IDLE_[XYZIJKUVWE]."
#elif defined(DEFAULT_STEPPER_DEACTIVE_TIME)
#error "DEFAULT_STEPPER_DEACTIVE_TIME is now DEFAULT_STEPPER_TIMEOUT_SEC."
#elif defined(TFT_SHARED_SPI)
#error "TFT_SHARED_SPI is now TFT_SHARED_IO."
#elif defined(LCD_PINS_ENABLE)
#error "LCD_PINS_ENABLE is now LCD_PINS_EN."
#elif ANY(USE_XMIN_PLUG, USE_XMAX_PLUG, USE_YMIN_PLUG, USE_YMAX_PLUG, USE_ZMIN_PLUG, USE_ZMAX_PLUG, \
USE_IMIN_PLUG, USE_IMAX_PLUG, USE_JMIN_PLUG, USE_JMAX_PLUG, USE_KMIN_PLUG, USE_KMAX_PLUG, \
USE_UMIN_PLUG, USE_UMAX_PLUG, USE_VMIN_PLUG, USE_VMAX_PLUG, USE_WMIN_PLUG, USE_WMAX_PLUG)
#error "USE_*_PLUG settings are no longer needed and should be removed."
#elif defined(X2_USE_ENDSTOP)
#error "X2_USE_ENDSTOP is obsolete. Instead set X2_STOP_PIN directly. (e.g., 'X2_USE_ENDSTOP _XMAX_' becomes 'X2_STOP_PIN X_MAX_PIN')"
#elif defined(Y2_USE_ENDSTOP)
#error "Y2_USE_ENDSTOP is obsolete. Instead set Y2_STOP_PIN directly. (e.g., 'Y2_USE_ENDSTOP _YMAX_' becomes 'Y2_STOP_PIN Y_MAX_PIN')"
#elif defined(Z2_USE_ENDSTOP)
#error "Z2_USE_ENDSTOP is obsolete. Instead set Z2_STOP_PIN directly. (e.g., 'Z2_USE_ENDSTOP _ZMAX_' becomes 'Z2_STOP_PIN Z_MAX_PIN')"
#elif defined(Z3_USE_ENDSTOP)
#error "Z3_USE_ENDSTOP is obsolete. Instead set Z2_STOP_PIN directly. (e.g., 'Z3_USE_ENDSTOP _ZMAX_' becomes 'Z3_STOP_PIN Z_MAX_PIN')"
#elif defined(Z4_USE_ENDSTOP)
#error "Z4_USE_ENDSTOP is obsolete. Instead set Z4_STOP_PIN directly. (e.g., 'Z4_USE_ENDSTOP _ZMAX_' becomes 'Z4_STOP_PIN Z_MAX_PIN')"
#elif defined(INTEGRATED_BABYSTEPPING)
#error "INTEGRATED_BABYSTEPPING is no longer needed and should be removed."
#elif defined(FOLDER_SORTING)
#error "FOLDER_SORTING is now SDSORT_FOLDERS."
#elif defined(BTT_MINI_12864_V1)
#error "BTT_MINI_12864_V1 is now BTT_MINI_12864."
#elif defined(Z_PROBE_OFFSET_RANGE_MIN) || defined(Z_PROBE_OFFSET_RANGE_MAX)
#error "Z_PROBE_OFFSET_RANGE_(MIN|MAX) is now PROBE_OFFSET_Z(MIN|MAX)."
#elif defined(LARGE_MOVE_ITEMS)
#error "LARGE_MOVE_ITEMS is obsolete. Instead define MANUAL_MOVE_DISTANCE_MM and MANUAL_MOVE_DISTANCE_IN."
#elif defined(SDIO_SUPPORT)
#error "SDIO_SUPPORT is now ONBOARD_SDIO."
#elif defined(ANET_FULL_GRAPHICS_LCD_ALT_WIRING)
#error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING is now CTC_A10S_A13."
#elif defined(Z_PROBE_END_SCRIPT)
#error "Z_PROBE_END_SCRIPT is now EVENT_GCODE_AFTER_G29."
#elif defined(WIFI_SERIAL)
#error "WIFI_SERIAL is now WIFI_SERIAL_PORT."
#endif
// Changes to Probe Temp Compensation (#17392)
#if HAS_PTC && TEMP_SENSOR_PROBE && TEMP_SENSOR_BED
#if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z)
#error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)."
#elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y)
#error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)."
#endif
#endif
// Consolidate TMC26X, validate migration (#24373)
#define _ISMAX_1(A) defined(A##_MAX_CURRENT)
#define _ISSNS_1(A) defined(A##_SENSE_RESISTOR)
#if DO(ISMAX,||,ALL_AXIS_NAMES)
#error "*_MAX_CURRENT is now set with *_CURRENT."
#elif DO(ISSNS,||,ALL_AXIS_NAMES)
#error "*_SENSE_RESISTOR (in Milli-Ohms) is now set with *_RSENSE (in Ohms), so you must divide values by 1000."
#endif
#undef _ISMAX_1
#undef _ISSNS_1
// L64xx stepper drivers have been removed
#define _L6470 0x6470
#define _L6474 0x6474
#define _L6480 0x6480
#define _POWERSTEP01 0xF00D
#define _TMC26X 0x2600
#define _TMC26X_STANDALONE 0x2601
#if HAS_DRIVER(L6470)
#error "L6470 stepper drivers are no longer supported in Marlin."
#elif HAS_DRIVER(L6474)
#error "L6474 stepper drivers are no longer supported in Marlin."
#elif HAS_DRIVER(L6480)
#error "L6480 stepper drivers are no longer supported in Marlin."
#elif HAS_DRIVER(POWERSTEP01)
#error "POWERSTEP01 stepper drivers are no longer supported in Marlin."
#elif HAS_DRIVER(TMC26X) || HAS_DRIVER(TMC26X_STANDALONE)
#error "TMC26X stepper drivers are no longer supported in Marlin."
#endif
#undef _L6470
#undef _L6474
#undef _L6480
#undef _POWERSTEP01
#undef _TMC26X
#undef _TMC26X_STANDALONE
|
2301_81045437/Marlin
|
Marlin/src/inc/Changes.h
|
C
|
agpl-3.0
| 43,752
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#pragma once
/**
* Conditionals_LCD.h
* Conditionals that need to be set before Configuration_adv.h or pins.h
*/
/**
* Extruders have some combination of stepper motors and hotends
* so we separate these concepts into the defines:
*
* EXTRUDERS - Number of Selectable Tools
* HOTENDS - Number of hotends, whether connected or separate
* E_STEPPERS - Number of actual E stepper motors
* E_MANUAL - Number of E steppers for LCD move options
*
* These defines must be simple constants for use in REPEAT, etc.
*/
#if EXTRUDERS
#define HAS_EXTRUDERS 1
#if EXTRUDERS > 1
#define HAS_MULTI_EXTRUDER 1
#endif
#define E_AXIS_N(E) AxisEnum(E_AXIS + E_INDEX_N(E))
#else
#undef EXTRUDERS
#define EXTRUDERS 0
#undef TEMP_SENSOR_0
#undef TEMP_SENSOR_1
#undef TEMP_SENSOR_2
#undef TEMP_SENSOR_3
#undef TEMP_SENSOR_4
#undef TEMP_SENSOR_5
#undef TEMP_SENSOR_6
#undef TEMP_SENSOR_7
#undef SINGLENOZZLE
#undef SWITCHING_EXTRUDER
#undef MECHANICAL_SWITCHING_EXTRUDER
#undef SWITCHING_NOZZLE
#undef MECHANICAL_SWITCHING_NOZZLE
#undef MIXING_EXTRUDER
#undef HOTEND_IDLE_TIMEOUT
#undef DISABLE_E
#undef PREVENT_LENGTHY_EXTRUDE
#undef FILAMENT_RUNOUT_SENSOR
#undef FILAMENT_RUNOUT_DISTANCE_MM
#undef DISABLE_OTHER_EXTRUDERS
#endif
#define E_OPTARG(N) OPTARG(HAS_MULTI_EXTRUDER, N)
#define E_TERN_(N) TERN_(HAS_MULTI_EXTRUDER, N)
#define E_TERN0(N) TERN0(HAS_MULTI_EXTRUDER, N)
#if ANY(SWITCHING_EXTRUDER, MECHANICAL_SWITCHING_EXTRUDER)
#define HAS_SWITCHING_EXTRUDER 1
#endif
#if ANY(SWITCHING_NOZZLE, MECHANICAL_SWITCHING_NOZZLE)
#define HAS_SWITCHING_NOZZLE 1
#endif
/**
* Multi-Material-Unit supported models
*/
#ifdef MMU_MODEL
#define HAS_MMU 1
#define SINGLENOZZLE
#define _PRUSA_MMU1 1
#define _PRUSA_MMU2 2
#define _PRUSA_MMU2S 3
#define _EXTENDABLE_EMU_MMU2 12
#define _EXTENDABLE_EMU_MMU2S 13
#define _MMU CAT(_,MMU_MODEL)
#if _MMU == _PRUSA_MMU1
#define HAS_PRUSA_MMU1 1
#elif _MMU % 10 == _PRUSA_MMU2
#define HAS_PRUSA_MMU2 1
#elif _MMU % 10 == _PRUSA_MMU2S
#define HAS_PRUSA_MMU2 1
#define HAS_PRUSA_MMU2S 1
#endif
#if _MMU == _EXTENDABLE_EMU_MMU2 || _MMU == _EXTENDABLE_EMU_MMU2S
#define HAS_EXTENDABLE_MMU 1
#endif
#undef _MMU
#undef _PRUSA_MMU1
#undef _PRUSA_MMU2
#undef _PRUSA_MMU2S
#undef _EXTENDABLE_EMU_MMU2
#undef _EXTENDABLE_EMU_MMU2S
#endif
#if ENABLED(E_DUAL_STEPPER_DRIVERS) // E0/E1 steppers act in tandem as E0
#define E_STEPPERS 2
#define E_MANUAL 1
#elif HAS_SWITCHING_EXTRUDER // One stepper for every two EXTRUDERS
#if EXTRUDERS > 4
#define E_STEPPERS 3
#elif EXTRUDERS > 2
#define E_STEPPERS 2
#else
#define E_STEPPERS 1
#endif
#elif ENABLED(MIXING_EXTRUDER) // Multiple feeds are mixed proportionally
#define E_STEPPERS MIXING_STEPPERS
#define E_MANUAL 1
#if MIXING_STEPPERS == 2
#define HAS_DUAL_MIXING 1
#endif
#ifndef MIXING_VIRTUAL_TOOLS
#define MIXING_VIRTUAL_TOOLS 1
#endif
#elif ENABLED(SWITCHING_TOOLHEAD) // Toolchanger
#define E_STEPPERS EXTRUDERS
#define E_MANUAL EXTRUDERS
#elif HAS_PRUSA_MMU2 // Průša Multi-Material Unit v2
#define E_STEPPERS 1
#define E_MANUAL 1
#endif
// Default E steppers / manual motion is one per extruder
#ifndef E_STEPPERS
#define E_STEPPERS EXTRUDERS
#endif
#ifndef E_MANUAL
#define E_MANUAL EXTRUDERS
#endif
// Number of hotends...
#if ANY(SINGLENOZZLE, MIXING_EXTRUDER) // Only one for singlenozzle or mixing extruder
#define HOTENDS 1
#elif HAS_SWITCHING_EXTRUDER && !HAS_SWITCHING_NOZZLE // One for each pair of abstract "extruders"
#define HOTENDS E_STEPPERS
#elif TEMP_SENSOR_0
#define HOTENDS EXTRUDERS // One per extruder if at least one heater exists
#else
#define HOTENDS 0 // A machine with no hotends at all can still extrude
#endif
// At least one hotend...
#if HOTENDS
#define HAS_HOTEND 1
#ifndef HOTEND_OVERSHOOT
#define HOTEND_OVERSHOOT 15
#endif
#endif
// More than one hotend...
#if HOTENDS > 1
#define HAS_MULTI_HOTEND 1
#define HAS_HOTEND_OFFSET 1
#ifndef HOTEND_OFFSET_X
#define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
#endif
#ifndef HOTEND_OFFSET_Y
#define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder
#endif
#ifndef HOTEND_OFFSET_Z
#define HOTEND_OFFSET_Z { 0 } // Z offsets for each extruder
#endif
#else
#undef HOTEND_OFFSET_X
#undef HOTEND_OFFSET_Y
#undef HOTEND_OFFSET_Z
#endif
// Clean up E-stepper-based settings...
#if E_STEPPERS <= 7
#undef INVERT_E7_DIR
#undef E7_DRIVER_TYPE
#if E_STEPPERS <= 6
#undef INVERT_E6_DIR
#undef E6_DRIVER_TYPE
#if E_STEPPERS <= 5
#undef INVERT_E5_DIR
#undef E5_DRIVER_TYPE
#if E_STEPPERS <= 4
#undef INVERT_E4_DIR
#undef E4_DRIVER_TYPE
#if E_STEPPERS <= 3
#undef INVERT_E3_DIR
#undef E3_DRIVER_TYPE
#if E_STEPPERS <= 2
#undef INVERT_E2_DIR
#undef E2_DRIVER_TYPE
#if E_STEPPERS <= 1
#undef INVERT_E1_DIR
#undef E1_DRIVER_TYPE
#if E_STEPPERS == 0
#undef INVERT_E0_DIR
#undef E0_DRIVER_TYPE
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
/**
* Number of Linear Axes (e.g., XYZIJKUVW)
* All the logical axes except for the tool (E) axis
*/
#ifdef NUM_AXES
#undef NUM_AXES
#define NUM_AXES_WARNING 1
#endif
#ifdef W_DRIVER_TYPE
#define NUM_AXES 9
#elif defined(V_DRIVER_TYPE)
#define NUM_AXES 8
#elif defined(U_DRIVER_TYPE)
#define NUM_AXES 7
#elif defined(K_DRIVER_TYPE)
#define NUM_AXES 6
#elif defined(J_DRIVER_TYPE)
#define NUM_AXES 5
#elif defined(I_DRIVER_TYPE)
#define NUM_AXES 4
#elif defined(Z_DRIVER_TYPE)
#define NUM_AXES 3
#elif defined(Y_DRIVER_TYPE)
#define NUM_AXES 2
#elif defined(X_DRIVER_TYPE)
#define NUM_AXES 1
#else
#define NUM_AXES 0
#endif
#if NUM_AXES >= 1
#define HAS_X_AXIS 1
#define HAS_A_AXIS 1
#if NUM_AXES >= XY
#define HAS_Y_AXIS 1
#define HAS_B_AXIS 1
#if NUM_AXES >= XYZ
#define HAS_Z_AXIS 1
#define HAS_C_AXIS 1
#if NUM_AXES >= 4
#define HAS_I_AXIS 1
#if NUM_AXES >= 5
#define HAS_J_AXIS 1
#if NUM_AXES >= 6
#define HAS_K_AXIS 1
#if NUM_AXES >= 7
#define HAS_U_AXIS 1
#if NUM_AXES >= 8
#define HAS_V_AXIS 1
#if NUM_AXES >= 9
#define HAS_W_AXIS 1
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#if !HAS_X_AXIS
#undef AVOID_OBSTACLES
#undef ENDSTOPPULLUP_XMIN
#undef ENDSTOPPULLUP_XMAX
#undef X_MIN_ENDSTOP_HIT_STATE
#undef X_MAX_ENDSTOP_HIT_STATE
#undef X2_DRIVER_TYPE
#undef X_ENABLE_ON
#undef DISABLE_X
#undef INVERT_X_DIR
#undef X_HOME_DIR
#undef X_MIN_POS
#undef X_MAX_POS
#undef MANUAL_X_HOME_POS
#undef MIN_SOFTWARE_ENDSTOPS
#undef MAX_SOFTWARE_ENDSTOPS
#endif
#if !HAS_Y_AXIS
#undef AVOID_OBSTACLES
#undef ENDSTOPPULLUP_YMIN
#undef ENDSTOPPULLUP_YMAX
#undef Y_MIN_ENDSTOP_HIT_STATE
#undef Y_MAX_ENDSTOP_HIT_STATE
#undef Y2_DRIVER_TYPE
#undef Y_ENABLE_ON
#undef DISABLE_Y
#undef INVERT_Y_DIR
#undef Y_HOME_DIR
#undef Y_MIN_POS
#undef Y_MAX_POS
#undef MANUAL_Y_HOME_POS
#undef MIN_SOFTWARE_ENDSTOP_Y
#undef MAX_SOFTWARE_ENDSTOP_Y
#endif
#if HAS_Z_AXIS
#ifdef Z4_DRIVER_TYPE
#define NUM_Z_STEPPERS 4
#elif defined(Z3_DRIVER_TYPE)
#define NUM_Z_STEPPERS 3
#elif defined(Z2_DRIVER_TYPE)
#define NUM_Z_STEPPERS 2
#else
#define NUM_Z_STEPPERS 1
#endif
#else
#undef ENDSTOPPULLUP_ZMIN
#undef ENDSTOPPULLUP_ZMAX
#undef Z_MIN_ENDSTOP_HIT_STATE
#undef Z_MAX_ENDSTOP_HIT_STATE
#undef Z2_DRIVER_TYPE
#undef Z3_DRIVER_TYPE
#undef Z4_DRIVER_TYPE
#undef Z_ENABLE_ON
#undef DISABLE_Z
#undef INVERT_Z_DIR
#undef Z_HOME_DIR
#undef Z_MIN_POS
#undef Z_MAX_POS
#undef MANUAL_Z_HOME_POS
#undef Z_SAFE_HOMING
#undef MIN_SOFTWARE_ENDSTOP_Z
#undef MAX_SOFTWARE_ENDSTOP_Z
#endif
#if !HAS_I_AXIS
#undef ENDSTOPPULLUP_IMIN
#undef ENDSTOPPULLUP_IMAX
#undef I_MIN_ENDSTOP_HIT_STATE
#undef I_MAX_ENDSTOP_HIT_STATE
#undef I_ENABLE_ON
#undef DISABLE_I
#undef INVERT_I_DIR
#undef I_HOME_DIR
#undef I_MIN_POS
#undef I_MAX_POS
#undef MANUAL_I_HOME_POS
#undef MIN_SOFTWARE_ENDSTOP_I
#undef MAX_SOFTWARE_ENDSTOP_I
#endif
#if !HAS_J_AXIS
#undef ENDSTOPPULLUP_JMIN
#undef ENDSTOPPULLUP_JMAX
#undef J_MIN_ENDSTOP_HIT_STATE
#undef J_MAX_ENDSTOP_HIT_STATE
#undef J_ENABLE_ON
#undef DISABLE_J
#undef INVERT_J_DIR
#undef J_HOME_DIR
#undef J_MIN_POS
#undef J_MAX_POS
#undef MANUAL_J_HOME_POS
#undef MIN_SOFTWARE_ENDSTOP_J
#undef MAX_SOFTWARE_ENDSTOP_J
#endif
#if !HAS_K_AXIS
#undef ENDSTOPPULLUP_KMIN
#undef ENDSTOPPULLUP_KMAX
#undef K_MIN_ENDSTOP_HIT_STATE
#undef K_MAX_ENDSTOP_HIT_STATE
#undef K_ENABLE_ON
#undef DISABLE_K
#undef INVERT_K_DIR
#undef K_HOME_DIR
#undef K_MIN_POS
#undef K_MAX_POS
#undef MANUAL_K_HOME_POS
#undef MIN_SOFTWARE_ENDSTOP_K
#undef MAX_SOFTWARE_ENDSTOP_K
#endif
#if !HAS_U_AXIS
#undef ENDSTOPPULLUP_UMIN
#undef ENDSTOPPULLUP_UMAX
#undef U_MIN_ENDSTOP_HIT_STATE
#undef U_MAX_ENDSTOP_HIT_STATE
#undef U_ENABLE_ON
#undef DISABLE_U
#undef INVERT_U_DIR
#undef U_HOME_DIR
#undef U_MIN_POS
#undef U_MAX_POS
#undef MANUAL_U_HOME_POS
#undef MIN_SOFTWARE_ENDSTOP_U
#undef MAX_SOFTWARE_ENDSTOP_U
#endif
#if !HAS_V_AXIS
#undef ENDSTOPPULLUP_VMIN
#undef ENDSTOPPULLUP_VMAX
#undef V_MIN_ENDSTOP_HIT_STATE
#undef V_MAX_ENDSTOP_HIT_STATE
#undef V_ENABLE_ON
#undef DISABLE_V
#undef INVERT_V_DIR
#undef V_HOME_DIR
#undef V_MIN_POS
#undef V_MAX_POS
#undef MANUAL_V_HOME_POS
#undef MIN_SOFTWARE_ENDSTOP_V
#undef MAX_SOFTWARE_ENDSTOP_V
#endif
#if !HAS_W_AXIS
#undef ENDSTOPPULLUP_WMIN
#undef ENDSTOPPULLUP_WMAX
#undef W_MIN_ENDSTOP_HIT_STATE
#undef W_MAX_ENDSTOP_HIT_STATE
#undef W_ENABLE_ON
#undef DISABLE_W
#undef INVERT_W_DIR
#undef W_HOME_DIR
#undef W_MIN_POS
#undef W_MAX_POS
#undef MANUAL_W_HOME_POS
#undef MIN_SOFTWARE_ENDSTOP_W
#undef MAX_SOFTWARE_ENDSTOP_W
#endif
#define _OR_HAS_DA(A) ENABLED(DISABLE_##A) ||
#if MAP(_OR_HAS_DA, X, Y, Z, I, J, K, U, V, W) 0
#define HAS_DISABLE_MAIN_AXES 1
#endif
#if HAS_DISABLE_MAIN_AXES || ENABLED(DISABLE_E)
#define HAS_DISABLE_AXES 1
#endif
#undef _OR_HAS_DA
#ifdef X2_DRIVER_TYPE
#define HAS_X2_STEPPER 1
#endif
#ifdef Y2_DRIVER_TYPE
#define HAS_Y2_STEPPER 1
#endif
/**
* Number of Primary Linear Axes (e.g., XYZ)
* X, XY, or XYZ axes. Excluding duplicate axes (X2, Y2, Z2, Z3, Z4)
*/
#if NUM_AXES >= 3
#define PRIMARY_LINEAR_AXES 3
#else
#define PRIMARY_LINEAR_AXES NUM_AXES
#endif
/**
* Number of Secondary Axes (e.g., IJKUVW)
* All linear/rotational axes between XYZ and E.
*/
#define SECONDARY_AXES SUB3(NUM_AXES)
/**
* Number of Rotational Axes (e.g., IJK)
* All axes for which AXIS*_ROTATES is defined.
* For these axes, positions are specified in angular degrees.
*/
#if ENABLED(AXIS9_ROTATES)
#define ROTATIONAL_AXES 6
#elif ENABLED(AXIS8_ROTATES)
#define ROTATIONAL_AXES 5
#elif ENABLED(AXIS7_ROTATES)
#define ROTATIONAL_AXES 4
#elif ENABLED(AXIS6_ROTATES)
#define ROTATIONAL_AXES 3
#elif ENABLED(AXIS5_ROTATES)
#define ROTATIONAL_AXES 2
#elif ENABLED(AXIS4_ROTATES)
#define ROTATIONAL_AXES 1
#else
#define ROTATIONAL_AXES 0
#endif
#if ROTATIONAL_AXES
#define HAS_ROTATIONAL_AXES 1
#endif
/**
* Number of Secondary Linear Axes (e.g., UVW)
* All secondary axes for which AXIS*_ROTATES is not defined.
* Excluding primary axes and excluding duplicate axes (X2, Y2, Z2, Z3, Z4)
*/
#define SECONDARY_LINEAR_AXES (NUM_AXES - PRIMARY_LINEAR_AXES - ROTATIONAL_AXES)
/**
* Number of Logical Axes (e.g., XYZIJKUVWE)
* All logical axes that can be commanded directly by G-code.
* Delta maps stepper-specific values to ABC steppers.
*/
#if HAS_EXTRUDERS
#define LOGICAL_AXES INCREMENT(NUM_AXES)
#else
#define LOGICAL_AXES NUM_AXES
#endif
/**
* DISTINCT_E_FACTORS is set to give extruders (some) individual settings.
*
* DISTINCT_AXES is the number of distinct addressable axes (not steppers).
* Includes all linear axes plus all distinguished extruders.
* The default behavior is to treat all extruders as a single E axis
* with shared motion and temperature settings.
*
* DISTINCT_E is the number of distinguished extruders. By default this
* will be 1 which indicates all extruders share the same settings.
*
* E_INDEX_N(E) should be used to get the E index of any item that might be
* distinguished.
*/
#if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1
#define DISTINCT_AXES (NUM_AXES + E_STEPPERS)
#define DISTINCT_E E_STEPPERS
#define E_INDEX_N(E) (E)
#else
#undef DISTINCT_E_FACTORS
#define DISTINCT_AXES LOGICAL_AXES
#define DISTINCT_E 1
#define E_INDEX_N(E) 0
#endif
// Helper macros for extruder and hotend arrays
#define _EXTRUDER_LOOP(E) for (int8_t E = 0; E < EXTRUDERS; E++)
#define EXTRUDER_LOOP() _EXTRUDER_LOOP(e)
#define _HOTEND_LOOP(H) for (int8_t H = 0; H < HOTENDS; H++)
#define HOTEND_LOOP() _HOTEND_LOOP(e)
#define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V)
#define ARRAY_BY_EXTRUDERS1(v1) ARRAY_N_1(EXTRUDERS, v1)
#define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V)
#define ARRAY_BY_HOTENDS1(v1) ARRAY_N_1(HOTENDS, v1)
// Support for SD Card and other file storage
#if ENABLED(SDSUPPORT)
#define HAS_MEDIA 1
#endif
/**
* Conditionals for the configured LCD / Controller
*/
// MKS_LCD12864A/B is a variant of MKS_MINI_12864
#if ANY(MKS_LCD12864A, MKS_LCD12864B)
#define MKS_MINI_12864
#endif
// MKS_MINI_12864_V3 , BTT_MINI_12864 and BEEZ_MINI_12864 are nearly identical to FYSETC_MINI_12864_2_1
#if ANY(MKS_MINI_12864_V3, BTT_MINI_12864, BEEZ_MINI_12864)
#define FYSETC_MINI_12864_2_1
#endif
// Old settings are now conditional on DGUS_LCD_UI
#if DGUS_UI_IS(ORIGIN)
#define DGUS_LCD_UI_ORIGIN 1
#elif DGUS_UI_IS(FYSETC)
#define DGUS_LCD_UI_FYSETC 1
#elif DGUS_UI_IS(HIPRECY)
#define DGUS_LCD_UI_HIPRECY 1
#elif DGUS_UI_IS(MKS)
#define DGUS_LCD_UI_MKS 1
#elif DGUS_UI_IS(RELOADED)
#define DGUS_LCD_UI_RELOADED 1
#elif DGUS_UI_IS(IA_CREALITY)
#define DGUS_LCD_UI_IA_CREALITY 1
#elif DGUS_UI_IS(E3S1PRO)
#define DGUS_LCD_UI_E3S1PRO 1
#endif
/**
* General Flags that may be set below by specific LCDs
*
* DOGLCD : Run a Graphical LCD through U8GLib (with MarlinUI)
* IS_ULTIPANEL : Define LCD_PINS_D5/6/7 for direct-connected "Ultipanel" LCDs
* HAS_WIRED_LCD : Ultra LCD, not necessarily Ultipanel.
* IS_RRD_SC : Common RRD Smart Controller digital interface pins
* IS_RRD_FG_SC : Common RRD Full Graphical Smart Controller digital interface pins
* IS_U8GLIB_ST7920 : Most common DOGM display SPI interface, supporting a "lightweight" display mode.
* U8GLIB_SH1106 : SH1106 OLED with I2C interface via U8GLib
* IS_U8GLIB_SSD1306 : SSD1306 OLED with I2C interface via U8GLib (U8GLIB_SSD1306)
* U8GLIB_SSD1309 : SSD1309 OLED with I2C interface via U8GLib (HAS_U8GLIB_I2C_OLED, HAS_WIRED_LCD, DOGLCD)
* IS_U8GLIB_ST7565_64128N : ST7565 128x64 LCD with SPI interface via U8GLib
* IS_U8GLIB_LM6059_AF : LM6059 with Hardware SPI via U8GLib
*/
#if ANY(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
#define MINIPANEL
#elif ENABLED(YHCB2004)
#define IS_ULTIPANEL 1
#elif ENABLED(CARTESIO_UI)
#define DOGLCD
#define IS_ULTIPANEL 1
#elif ANY(DWIN_MARLINUI_PORTRAIT, DWIN_MARLINUI_LANDSCAPE)
#define IS_DWIN_MARLINUI 1
#define IS_ULTIPANEL 1
#elif ENABLED(ZONESTAR_LCD)
#define HAS_ADC_BUTTONS 1
#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
#define ADC_KEY_NUM 8
#define IS_ULTIPANEL 1
// This helps to implement HAS_ADC_BUTTONS menus
#define REVERSE_MENU_DIRECTION
#define STD_ENCODER_PULSES_PER_STEP 1
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
#define ENCODER_FEEDRATE_DEADZONE 2
#elif ENABLED(ZONESTAR_12864LCD)
#define DOGLCD
#define IS_RRD_SC 1
#define IS_U8GLIB_ST7920 1
#elif ENABLED(ZONESTAR_12864OLED)
#define IS_RRD_SC 1
#define U8GLIB_SH1106
#elif ENABLED(ZONESTAR_12864OLED_SSD1306)
#define IS_RRD_SC 1
#define IS_U8GLIB_SSD1306
#elif ENABLED(RADDS_DISPLAY)
#define IS_ULTIPANEL 1
#define STD_ENCODER_PULSES_PER_STEP 2
#elif ANY(miniVIKI, VIKI2, WYH_L12864, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864, EMOTION_TECH_LCD)
#define DOGLCD
#define IS_DOGM_12864 1
#define IS_ULTIPANEL 1
#if ENABLED(miniVIKI)
#define IS_U8GLIB_ST7565_64128N 1
#elif ENABLED(VIKI2)
#define IS_U8GLIB_ST7565_64128N 1
#elif ENABLED(WYH_L12864)
#define IS_U8GLIB_ST7565_64128N 1
#define ST7565_XOFFSET 0x04
#elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
#define IS_U8GLIB_LM6059_AF 1
#elif ENABLED(AZSMZ_12864)
#define IS_U8GLIB_ST7565_64128N 1
#elif ENABLED(EMOTION_TECH_LCD)
#define IS_U8GLIB_ST7565_64128N 1
#define ST7565_VOLTAGE_DIVIDER_VALUE 0x07
#endif
#elif ENABLED(OLED_PANEL_TINYBOY2)
#define IS_U8GLIB_SSD1306
#define IS_ULTIPANEL 1
#elif ENABLED(RA_CONTROL_PANEL)
#define LCD_I2C_TYPE_PCA8574
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
#define IS_ULTIPANEL 1
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
#define DOGLCD
#define IS_U8GLIB_ST7920 1
#define IS_ULTIPANEL 1
#define ENCODER_PULSES_PER_STEP 2
#elif ENABLED(MKS_12864OLED)
#define IS_RRD_SC 1
#define U8GLIB_SH1106
#elif ENABLED(MKS_12864OLED_SSD1306)
#define IS_RRD_SC 1
#define IS_U8GLIB_SSD1306
#elif ENABLED(SAV_3DGLCD)
#ifdef U8GLIB_SSD1306
#define IS_U8GLIB_SSD1306 // Allow for U8GLIB_SSD1306 + SAV_3DGLCD
#endif
#define IS_NEWPANEL 1
#elif ENABLED(FYSETC_242_OLED_12864)
#define IS_RRD_SC 1
#define U8GLIB_SH1106
#ifndef NEOPIXEL_BRIGHTNESS
#define NEOPIXEL_BRIGHTNESS 127
#endif
#elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1)
#define FYSETC_MINI_12864
#define DOGLCD
#define IS_ULTIPANEL 1
#define LED_COLORS_REDUCE_GREEN
// Require LED backlighting enabled
#if ENABLED(FYSETC_MINI_12864_2_1)
#ifndef NEOPIXEL_BRIGHTNESS
#define NEOPIXEL_BRIGHTNESS 127
#endif
//#define NEOPIXEL_STARTUP_TEST
#endif
#elif ENABLED(ULTI_CONTROLLER)
#define IS_ULTIPANEL 1
#define U8GLIB_SSD1309
#define LCD_RESET_PIN LCD_PINS_D6 // This controller need a reset pin
#define STD_ENCODER_PULSES_PER_STEP 4
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
#ifndef PCA9632
#define PCA9632
#endif
#elif ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602)
#define IS_RRD_SC 1
#define LCD_WIDTH 16
#define LCD_HEIGHT 2
#elif ANY(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C)
#define IS_TFTGLCD_PANEL 1
#define IS_ULTIPANEL 1 // Note that IS_ULTIPANEL leads to HAS_WIRED_LCD
#if HAS_MEDIA && DISABLED(LCD_PROGRESS_BAR)
#define LCD_PROGRESS_BAR
#endif
#if ENABLED(TFTGLCD_PANEL_I2C)
#define LCD_I2C_ADDRESS 0x33 // Must be 0x33 for STM32 main boards and equal to panel's I2C slave address
#endif
#define LCD_USE_I2C_BUZZER // Enable buzzer on LCD, used for both I2C and SPI buses (LiquidTWI2 not required)
#define STD_ENCODER_PULSES_PER_STEP 2
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
#define LCD_WIDTH 20 // 20 or 24 chars in line
#define LCD_HEIGHT 10 // Character lines
#define LCD_CONTRAST_MIN 127
#define LCD_CONTRAST_MAX 255
#define LCD_CONTRAST_DEFAULT 250
#define CONVERT_TO_EXT_ASCII // Use extended 128-255 symbols from ASCII table.
// At this time present conversion only for cyrillic - bg, ru and uk languages.
// First 7 ASCII symbols in panel font must be replaced with Marlin's special symbols.
#elif ENABLED(CR10_STOCKDISPLAY)
#define IS_RRD_FG_SC 1
#define NO_LCD_SDCARD
#define LCD_ST7920_DELAY_1 125
#define LCD_ST7920_DELAY_2 125
#define LCD_ST7920_DELAY_3 125
#elif ANY(ANET_FULL_GRAPHICS_LCD, CTC_A10S_A13)
#define IS_RRD_FG_SC 1
#define LCD_ST7920_DELAY_1 150
#define LCD_ST7920_DELAY_2 150
#define LCD_ST7920_DELAY_3 150
#elif ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, BQ_LCD_SMART_CONTROLLER, K3D_FULL_GRAPHIC_SMART_CONTROLLER)
#define IS_RRD_FG_SC 1
#elif ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
#define IS_RRD_SC 1 // RepRapDiscount LCD or Graphical LCD with rotary click encoder
#elif ENABLED(K3D_242_OLED_CONTROLLER)
#define IS_RRD_SC 1
#define U8GLIB_SSD1309
#endif
// ST7920-based graphical displays
#if ANY(IS_RRD_FG_SC, LCD_FOR_MELZI, SILVER_GATE_GLCD_CONTROLLER)
#define DOGLCD
#define IS_U8GLIB_ST7920 1
#define IS_RRD_SC 1
#endif
// ST7565 / 64128N graphical displays
#if ANY(MAKRPANEL, MINIPANEL)
#define IS_ULTIPANEL 1
#define DOGLCD
#if ENABLED(MAKRPANEL)
#define IS_U8GLIB_ST7565_64128N 1
#endif
#endif
#if ENABLED(IS_U8GLIB_SSD1306)
#define U8GLIB_SSD1306
#endif
#if ENABLED(OVERLORD_OLED)
#define IS_ULTIPANEL 1
#define U8GLIB_SH1106
/**
* PCA9632 for buzzer and LEDs via i2c
* No auto-inc, red and green leds switched, buzzer
*/
#define PCA9632
#define PCA9632_NO_AUTO_INC
#define PCA9632_GRN 0x00
#define PCA9632_RED 0x02
#define PCA9632_BUZZER
#define PCA9632_BUZZER_DATA { 0x09, 0x02 }
#define STD_ENCODER_PULSES_PER_STEP 1 // Overlord uses buttons
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
#endif
// 128x64 I2C OLED LCDs - SSD1306/SSD1309/SH1106
#if ANY(U8GLIB_SSD1306, U8GLIB_SSD1309, U8GLIB_SH1106)
#define HAS_U8GLIB_I2C_OLED 1
#define HAS_WIRED_LCD 1
#define DOGLCD
#endif
/**
* SPI Ultipanels
*/
// Basic Ultipanel-like displays
#if ANY(ULTIMAKERCONTROLLER, IS_RRD_SC, G3D_PANEL, RIGIDBOT_PANEL, PANEL_ONE, U8GLIB_SH1106)
#define IS_ULTIPANEL 1
#endif
// Einstart OLED has Cardinal nav via pins defined in pins_EINSTART-S.h
#if ENABLED(U8GLIB_SH1106_EINSTART)
#define DOGLCD
#define IS_ULTIPANEL 1
#endif
// TFT Legacy options masquerade as TFT_GENERIC
#if ANY(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT, TFT_320x240, TFT_480x320, TFT_320x240_SPI, TFT_480x320_SPI, TFT_LVGL_UI_FSMC, TFT_LVGL_UI_SPI)
#define IS_LEGACY_TFT 1
#define TFT_GENERIC
#if ANY(FSMC_GRAPHICAL_TFT, TFT_320x240, TFT_480x320, TFT_LVGL_UI_FSMC)
#define TFT_INTERFACE_FSMC
#elif ANY(SPI_GRAPHICAL_TFT, TFT_320x240_SPI, TFT_480x320_SPI, TFT_LVGL_UI_SPI)
#define TFT_INTERFACE_SPI
#endif
#if ANY(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT)
#define TFT_CLASSIC_UI
#elif ANY(TFT_320x240, TFT_480x320, TFT_320x240_SPI, TFT_480x320_SPI)
#define TFT_COLOR_UI
#elif ANY(TFT_LVGL_UI_FSMC, TFT_LVGL_UI_SPI)
#define TFT_LVGL_UI
#endif
#endif
// FSMC/SPI TFT Panels (LVGL) with encoder click wheel
#if ENABLED(TFT_LVGL_UI)
#define HAS_TFT_LVGL_UI 1
#define SERIAL_RUNTIME_HOOK 1
#define STD_ENCODER_PULSES_PER_STEP 4
#endif
// FSMC/SPI TFT Panels
#if ENABLED(TFT_CLASSIC_UI)
#define TFT_SCALED_DOGLCD 1
#endif
#if TFT_SCALED_DOGLCD
#define DOGLCD
#define IS_ULTIPANEL 1
#define DELAYED_BACKLIGHT_INIT
#elif HAS_TFT_LVGL_UI
#define DELAYED_BACKLIGHT_INIT
#endif
// Color UI
#if ENABLED(TFT_COLOR_UI)
#define HAS_GRAPHICAL_TFT 1
#define IS_ULTIPANEL 1
#endif
/**
* I2C Panels
*/
#if ANY(IS_RRD_SC, IS_DOGM_12864, OLED_PANEL_TINYBOY2, LCD_I2C_PANELOLU2)
#define STD_ENCODER_PULSES_PER_STEP 4
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
#if ENABLED(LCD_I2C_PANELOLU2) // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
#define LCD_I2C_TYPE_MCP23017 // I2C Character-based 12864 display
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
#define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (optional)
#define IS_ULTIPANEL 1
#endif
#elif ANY(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004)
#define LCD_I2C_TYPE_PCF8575 // I2C Character-based 12864 display
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
#define IS_ULTIPANEL 1
#if ENABLED(LCD_SAINSMART_I2C_2004)
#define LCD_WIDTH 20
#define LCD_HEIGHT 4
#endif
#elif ENABLED(LCD_I2C_VIKI)
/**
* Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
*
* This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
* Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
* Note: The pause/stop/resume LCD button pin should be connected to the Arduino
* BTN_ENC pin (or set BTN_ENC to -1 if not used)
*/
#define LCD_I2C_TYPE_MCP23017
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
#define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
#define IS_ULTIPANEL 1
#define ENCODER_FEEDRATE_DEADZONE 4
#define STD_ENCODER_PULSES_PER_STEP 1
#define STD_ENCODER_STEPS_PER_MENU_ITEM 2
#elif ENABLED(G3D_PANEL)
#define STD_ENCODER_PULSES_PER_STEP 2
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
#endif
#if ANY(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) && DISABLED(NO_LCD_DETECT)
#define DETECT_I2C_LCD_DEVICE 1
#endif
/**
* Ender-3 V2 DWIN with Encoder
*/
#if ANY(DWIN_CREALITY_LCD, DWIN_LCD_PROUI)
#define HAS_DWIN_E3V2_BASIC 1
#endif
#if ANY(HAS_DWIN_E3V2_BASIC, DWIN_CREALITY_LCD_JYERSUI)
#define HAS_DWIN_E3V2 1
#define STD_ENCODER_PULSES_PER_STEP 4
#endif
// Encoder behavior
#ifndef STD_ENCODER_PULSES_PER_STEP
#if ENABLED(TOUCH_SCREEN)
#define STD_ENCODER_PULSES_PER_STEP 2
#else
#define STD_ENCODER_PULSES_PER_STEP 5
#endif
#endif
#ifndef STD_ENCODER_STEPS_PER_MENU_ITEM
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
#endif
#ifndef ENCODER_PULSES_PER_STEP
#define ENCODER_PULSES_PER_STEP STD_ENCODER_PULSES_PER_STEP
#endif
#ifndef ENCODER_STEPS_PER_MENU_ITEM
#define ENCODER_STEPS_PER_MENU_ITEM STD_ENCODER_STEPS_PER_MENU_ITEM
#endif
#ifndef ENCODER_FEEDRATE_DEADZONE
#define ENCODER_FEEDRATE_DEADZONE 6
#endif
/**
* Shift register panels
* ---------------------
* 2 wire Non-latching LCD SR from:
* https://github.com/fmalpartida/New-LiquidCrystal/wiki/schematics#user-content-ShiftRegister_connection
*/
#if ENABLED(FF_INTERFACEBOARD)
#define SR_LCD_3W_NL // Non latching 3 wire shift register
#define IS_ULTIPANEL 1
#elif ENABLED(SAV_3DLCD)
#define SR_LCD_2W_NL // Non latching 2 wire shift register
#define IS_ULTIPANEL 1
#elif ENABLED(ULTIPANEL)
#define IS_ULTIPANEL 1
#endif
#if ANY(IS_ULTIPANEL, ULTRA_LCD)
#define HAS_WIRED_LCD 1
#endif
#if ANY(IS_ULTIPANEL, REPRAPWORLD_KEYPAD)
#define IS_NEWPANEL 1
#endif
#if ANY(ZONESTAR_LCD, REPRAPWORLD_KEYPAD)
#define IS_RRW_KEYPAD 1
#ifndef REPRAPWORLD_KEYPAD_MOVE_STEP
#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
#endif
#endif
// Aliases for LCD features
#if !DGUS_UI_IS(NONE) || ENABLED(ANYCUBIC_LCD_VYPER)
#define HAS_DGUS_LCD 1
#if DGUS_UI_IS(ORIGIN, FYSETC, HIPRECY, MKS)
#define HAS_DGUS_LCD_CLASSIC 1
#endif
#endif
// Extensible UI serial touch screens. (See src/lcd/extui)
#if ANY(HAS_DGUS_LCD, MALYAN_LCD, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT, TOUCH_UI_FTDI_EVE, DWIN_LCD_PROUI)
#define IS_EXTUI 1 // Just for sanity check.
#define EXTENSIBLE_UI
#endif
// E3V2 extras
#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
#define SERIAL_CATCHALL 0
#define HAS_LCD_BRIGHTNESS 1
#define LCD_BRIGHTNESS_MAX 250
#endif
#if ENABLED(DWIN_LCD_PROUI)
#define DO_LIST_BIN_FILES 1
#define LCD_BRIGHTNESS_DEFAULT 127
#define STATUS_DO_CLEAR_EMPTY
#endif
// Serial Controllers require LCD_SERIAL_PORT
#if ANY(IS_DWIN_MARLINUI, HAS_DWIN_E3V2, HAS_DGUS_LCD, MALYAN_LCD, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT)
#define LCD_IS_SERIAL_HOST 1
#endif
#if HAS_WIRED_LCD
#if ENABLED(DOGLCD)
#define HAS_MARLINUI_U8GLIB 1
#elif IS_TFTGLCD_PANEL
// Neither DOGM nor HD44780. Fully customized interface.
#elif IS_DWIN_MARLINUI
// Since HAS_MARLINUI_U8GLIB refers to U8G displays
// the DWIN display can define its own flags
#elif !HAS_GRAPHICAL_TFT
#define HAS_MARLINUI_HD44780 1
#endif
#endif
#if ANY(HAS_WIRED_LCD, EXTENSIBLE_UI, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
/**
* HAS_DISPLAY indicates the display uses these MarlinUI methods...
* - update
* - abort_print
* - pause_print
* - resume_print
* - poweroff (for PSU_CONTROL and HAS_MARLINUI_MENU)
*
* ...and implements these MarlinUI methods:
* - zoffset_overlay (if BABYSTEP_GFX_OVERLAY or MESH_EDIT_GFX_OVERLAY are supported)
* - draw_kill_screen
* - kill_screen
* - draw_status_message
* (calling advance_status_scroll, status_and_len for a scrolling status message)
*/
#define HAS_DISPLAY 1
#endif
#if ANY(HAS_DISPLAY, DWIN_CREALITY_LCD)
#define HAS_UI_UPDATE 1
#endif
#if HAS_WIRED_LCD && !HAS_GRAPHICAL_TFT && !IS_DWIN_MARLINUI
#define HAS_LCDPRINT 1
#endif
#if HAS_DISPLAY || HAS_LCDPRINT
#define HAS_UTF8_UTILS 1
#endif
#if ANY(HAS_DISPLAY, HAS_DWIN_E3V2)
#define HAS_STATUS_MESSAGE 1
#endif
#if IS_ULTIPANEL && DISABLED(NO_LCD_MENUS)
#define HAS_MARLINUI_MENU 1
#endif
#if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, HAS_DWIN_E3V2)
#define HAS_MANUAL_MOVE_MENU 1
#endif
#if HAS_MARLINUI_U8GLIB
#ifndef LCD_PIXEL_WIDTH
#define LCD_PIXEL_WIDTH 128
#endif
#ifndef LCD_PIXEL_HEIGHT
#define LCD_PIXEL_HEIGHT 64
#endif
#endif
/**
* Disable unused SINGLENOZZLE sub-options
*/
#if DISABLED(SINGLENOZZLE)
#undef SINGLENOZZLE_STANDBY_TEMP
#endif
#if !ALL(HAS_FAN, SINGLENOZZLE)
#undef SINGLENOZZLE_STANDBY_FAN
#endif
// No inactive extruders with SWITCHING_NOZZLE or Průša MMU1 or just 1 E stepper exists
#if HAS_SWITCHING_NOZZLE || HAS_PRUSA_MMU1 || E_STEPPERS < 2
#undef DISABLE_OTHER_EXTRUDERS
#endif
// Switching extruder has its own servo?
#if ENABLED(SWITCHING_EXTRUDER) && (!HAS_SWITCHING_NOZZLE || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR)
#define DO_SWITCH_EXTRUDER 1
#endif
/**
* The BLTouch Probe emulates a servo probe
* and uses "special" angles for its state.
*/
#if ENABLED(BLTOUCH) && !defined(Z_PROBE_SERVO_NR)
#define Z_PROBE_SERVO_NR 0
#endif
/**
* Set a flag for a servo probe (or BLTouch)
*/
#ifdef Z_PROBE_SERVO_NR
#define HAS_Z_SERVO_PROBE 1
#endif
#if ANY(HAS_Z_SERVO_PROBE, SWITCHING_EXTRUDER, SWITCHING_NOZZLE)
#define HAS_SERVO_ANGLES 1
#endif
#if !HAS_SERVO_ANGLES
#undef EDITABLE_SERVO_ANGLES
#endif
/**
* Set flags for any form of bed probe
*/
#if ANY(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, HAS_Z_SERVO_PROBE, SOLENOID_PROBE, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4, MAG_MOUNTED_PROBE, BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2)
#define HAS_STOWABLE_PROBE 1
#endif
#if ANY(HAS_STOWABLE_PROBE, FIX_MOUNTED_PROBE, BD_SENSOR, NOZZLE_AS_PROBE)
#define HAS_BED_PROBE 1
#endif
// Probing tool change
#if !HAS_MULTI_EXTRUDER
#undef PROBING_TOOL
#endif
#if HAS_BED_PROBE && defined(PROBING_TOOL)
#define DO_TOOLCHANGE_FOR_PROBING 1
#endif
/**
* Fill in undefined Filament Sensor options
*/
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if NUM_RUNOUT_SENSORS >= 1
#ifndef FIL_RUNOUT1_STATE
#define FIL_RUNOUT1_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT1_PULLUP
#define FIL_RUNOUT1_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_RUNOUT1_PULLDOWN
#define FIL_RUNOUT1_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#if NUM_RUNOUT_SENSORS >= 2
#ifndef FIL_RUNOUT2_STATE
#define FIL_RUNOUT2_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT2_PULLUP
#define FIL_RUNOUT2_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_RUNOUT2_PULLDOWN
#define FIL_RUNOUT2_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#if NUM_RUNOUT_SENSORS >= 3
#ifndef FIL_RUNOUT3_STATE
#define FIL_RUNOUT3_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT3_PULLUP
#define FIL_RUNOUT3_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_RUNOUT3_PULLDOWN
#define FIL_RUNOUT3_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#if NUM_RUNOUT_SENSORS >= 4
#ifndef FIL_RUNOUT4_STATE
#define FIL_RUNOUT4_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT4_PULLUP
#define FIL_RUNOUT4_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_RUNOUT4_PULLDOWN
#define FIL_RUNOUT4_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#if NUM_RUNOUT_SENSORS >= 5
#ifndef FIL_RUNOUT5_STATE
#define FIL_RUNOUT5_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT5_PULLUP
#define FIL_RUNOUT5_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_RUNOUT5_PULLDOWN
#define FIL_RUNOUT5_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#if NUM_RUNOUT_SENSORS >= 6
#ifndef FIL_RUNOUT6_STATE
#define FIL_RUNOUT6_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT6_PULLUP
#define FIL_RUNOUT6_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_RUNOUT6_PULLDOWN
#define FIL_RUNOUT6_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#if NUM_RUNOUT_SENSORS >= 7
#ifndef FIL_RUNOUT7_STATE
#define FIL_RUNOUT7_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT7_PULLUP
#define FIL_RUNOUT7_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_RUNOUT7_PULLDOWN
#define FIL_RUNOUT7_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#if NUM_RUNOUT_SENSORS >= 8
#ifndef FIL_RUNOUT8_STATE
#define FIL_RUNOUT8_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT8_PULLUP
#define FIL_RUNOUT8_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_RUNOUT8_PULLDOWN
#define FIL_RUNOUT8_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#endif // FILAMENT_RUNOUT_SENSOR
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
#if NUM_MOTION_SENSORS >= 1
#ifndef FIL_MOTION1_STATE
#define FIL_MOTION1_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_MOTION1_PULLUP
#define FIL_MOTION1_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_MOTION1_PULLDOWN
#define FIL_MOTION1_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#if NUM_MOTION_SENSORS >= 2
#ifndef FIL_MOTION2_STATE
#define FIL_MOTION2_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_MOTION2_PULLUP
#define FIL_MOTION2_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_MOTION2_PULLDOWN
#define FIL_MOTION2_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#if NUM_MOTION_SENSORS >= 3
#ifndef FIL_MOTION3_STATE
#define FIL_MOTION3_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_MOTION3_PULLUP
#define FIL_MOTION3_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_MOTION3_PULLDOWN
#define FIL_MOTION3_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#if NUM_MOTION_SENSORS >= 4
#ifndef FIL_MOTION4_STATE
#define FIL_MOTION4_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_MOTION4_PULLUP
#define FIL_MOTION4_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_MOTION4_PULLDOWN
#define FIL_MOTION4_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#if NUM_MOTION_SENSORS >= 5
#ifndef FIL_MOTION5_STATE
#define FIL_MOTION5_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_MOTION5_PULLUP
#define FIL_MOTION5_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_MOTION5_PULLDOWN
#define FIL_MOTION5_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#if NUM_MOTION_SENSORS >= 6
#ifndef FIL_MOTION6_STATE
#define FIL_MOTION6_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_MOTION6_PULLUP
#define FIL_MOTION6_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_MOTION6_PULLDOWN
#define FIL_MOTION6_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#if NUM_MOTION_SENSORS >= 7
#ifndef FIL_MOTION7_STATE
#define FIL_MOTION7_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_MOTION7_PULLUP
#define FIL_MOTION7_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_MOTION7_PULLDOWN
#define FIL_MOTION7_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#if NUM_MOTION_SENSORS >= 8
#ifndef FIL_MOTION8_STATE
#define FIL_MOTION8_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_MOTION8_PULLUP
#define FIL_MOTION8_PULLUP FIL_RUNOUT_PULLUP
#endif
#ifndef FIL_MOTION8_PULLDOWN
#define FILMOTION8_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif
#endif // FILAMENT_SWITCH_AND_MOTION
// Homing to Min or Max
#if HAS_X_AXIS
#if X_HOME_DIR > 0
#define X_HOME_TO_MAX 1
#elif X_HOME_DIR < 0
#define X_HOME_TO_MIN 1
#endif
#endif
#if HAS_Y_AXIS
#if Y_HOME_DIR > 0
#define Y_HOME_TO_MAX 1
#elif Y_HOME_DIR < 0
#define Y_HOME_TO_MIN 1
#endif
#endif
#if HAS_Z_AXIS
#if Z_HOME_DIR > 0
#define Z_HOME_TO_MAX 1
#elif Z_HOME_DIR < 0
#define Z_HOME_TO_MIN 1
#endif
#endif
#if HAS_I_AXIS
#if I_HOME_DIR > 0
#define I_HOME_TO_MAX 1
#elif I_HOME_DIR < 0
#define I_HOME_TO_MIN 1
#endif
#endif
#if HAS_J_AXIS
#if J_HOME_DIR > 0
#define J_HOME_TO_MAX 1
#elif J_HOME_DIR < 0
#define J_HOME_TO_MIN 1
#endif
#endif
#if HAS_K_AXIS
#if K_HOME_DIR > 0
#define K_HOME_TO_MAX 1
#elif K_HOME_DIR < 0
#define K_HOME_TO_MIN 1
#endif
#endif
#if HAS_U_AXIS
#if U_HOME_DIR > 0
#define U_HOME_TO_MAX 1
#elif U_HOME_DIR < 0
#define U_HOME_TO_MIN 1
#endif
#endif
#if HAS_V_AXIS
#if V_HOME_DIR > 0
#define V_HOME_TO_MAX 1
#elif V_HOME_DIR < 0
#define V_HOME_TO_MIN 1
#endif
#endif
#if HAS_W_AXIS
#if W_HOME_DIR > 0
#define W_HOME_TO_MAX 1
#elif W_HOME_DIR < 0
#define W_HOME_TO_MIN 1
#endif
#endif
/**
* Conditionals based on the type of Bed Probe
*/
#if HAS_BED_PROBE
#if ALL(DELTA, SENSORLESS_PROBING)
#define HAS_DELTA_SENSORLESS_PROBING 1
#else
#define HAS_REAL_BED_PROBE 1
#endif
#if HAS_REAL_BED_PROBE && NONE(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, Z_SPI_SENSORLESS)
#define NEED_Z_MIN_PROBE_PIN 1
#endif
#if Z_HOME_TO_MIN && (!NEED_Z_MIN_PROBE_PIN || ENABLED(USE_PROBE_FOR_Z_HOMING))
#define HOMING_Z_WITH_PROBE 1
#endif
#if DISABLED(NOZZLE_AS_PROBE)
#define HAS_PROBE_XY_OFFSET 1
#endif
#if ANY(Z_PROBE_ALLEN_KEY, MAG_MOUNTED_PROBE)
#define PROBE_TRIGGERED_WHEN_STOWED_TEST 1 // Extra test for Allen Key Probe
#endif
#ifndef Z_CLEARANCE_BETWEEN_PROBES
#define Z_CLEARANCE_BETWEEN_PROBES 5
#endif
#ifndef Z_CLEARANCE_MULTI_PROBE
#define Z_CLEARANCE_MULTI_PROBE 5
#endif
#ifndef Z_PROBE_ERROR_TOLERANCE
#define Z_PROBE_ERROR_TOLERANCE Z_CLEARANCE_MULTI_PROBE
#endif
#if MULTIPLE_PROBING > 1
#if EXTRA_PROBING > 0
#define TOTAL_PROBING (MULTIPLE_PROBING + EXTRA_PROBING)
#else
#define TOTAL_PROBING MULTIPLE_PROBING
#endif
#endif
#else
// Clear probe pin settings when no probe is selected
#undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
#undef USE_PROBE_FOR_Z_HOMING
#undef Z_MIN_PROBE_REPEATABILITY_TEST
#undef HOMING_Z_WITH_PROBE
#undef Z_CLEARANCE_MULTI_PROBE
#undef Z_PROBE_ERROR_TOLERANCE
#undef MULTIPLE_PROBING
#undef EXTRA_PROBING
#undef PROBE_OFFSET_ZMIN
#undef PROBE_OFFSET_ZMAX
#undef PAUSE_BEFORE_DEPLOY_STOW
#undef PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED
#undef PROBING_HEATERS_OFF
#undef WAIT_FOR_BED_HEATER
#undef WAIT_FOR_HOTEND
#undef PROBING_STEPPERS_OFF
#undef DELAY_BEFORE_PROBING
#undef PREHEAT_BEFORE_PROBING
#undef PROBING_NOZZLE_TEMP
#undef PROBING_BED_TEMP
#undef NOZZLE_TO_PROBE_OFFSET
#endif
#ifndef Z_CLEARANCE_DEPLOY_PROBE
#define Z_CLEARANCE_DEPLOY_PROBE 10
#endif
#ifndef Z_PROBE_LOW_POINT
#define Z_PROBE_LOW_POINT -5
#endif
#if ENABLED(BELTPRINTER) && !defined(HOME_Y_BEFORE_X)
#define HOME_Y_BEFORE_X
#endif
#if Z_HOME_TO_MAX && DISABLED(Z_SAFE_HOMING)
#define HOME_Z_FIRST // If homing away from BED do Z first
#endif
/**
* Conditionals based on the type of Bed Leveling
*/
#if ENABLED(AUTO_BED_LEVELING_UBL)
#undef LCD_BED_LEVELING
#if ANY(DELTA, SEGMENT_LEVELED_MOVES)
#define UBL_SEGMENTED 1
#endif
#endif
#if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT)
#define ABL_PLANAR 1
#endif
#if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)
#define ABL_USES_GRID 1
#endif
#if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_3POINT)
#define HAS_ABL_NOT_UBL 1
#endif
#if ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING)
#define HAS_MESH 1
#endif
#if ANY(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT)
#define NEEDS_THREE_PROBE_POINTS 1
#endif
#if ANY(HAS_ABL_NOT_UBL, AUTO_BED_LEVELING_UBL)
#define HAS_ABL_OR_UBL 1
#if DISABLED(PROBE_MANUALLY)
#define HAS_AUTOLEVEL 1
#endif
#endif
#if ANY(HAS_ABL_OR_UBL, MESH_BED_LEVELING)
#define HAS_LEVELING 1
#if DISABLED(AUTO_BED_LEVELING_UBL)
#define PLANNER_LEVELING 1
#endif
#endif
#if !HAS_LEVELING
#undef RESTORE_LEVELING_AFTER_G28
#undef ENABLE_LEVELING_AFTER_G28
#undef G29_RETRY_AND_RECOVER
#endif
#if !HAS_LEVELING || ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
#undef PROBE_MANUALLY
#endif
#if ANY(HAS_BED_PROBE, PROBE_MANUALLY, MESH_BED_LEVELING)
#define PROBE_SELECTED 1
#endif
#ifdef GRID_MAX_POINTS_X
#define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y))
#define GRID_LOOP(A,B) for (uint8_t A = 0; A < GRID_MAX_POINTS_X; ++A) for (uint8_t B = 0; B < GRID_MAX_POINTS_Y; ++B)
#endif
// Slim menu optimizations
#if ENABLED(SLIM_LCD_MENUS)
#define BOOT_MARLIN_LOGO_SMALL
#endif
// Flow and feedrate editing
#if HAS_EXTRUDERS && ANY(HAS_MARLINUI_MENU, DWIN_CREALITY_LCD, DWIN_LCD_PROUI, MALYAN_LCD, TOUCH_SCREEN)
#define HAS_FLOW_EDIT 1
#endif
#if ANY(HAS_MARLINUI_MENU, ULTIPANEL_FEEDMULTIPLY, DWIN_CREALITY_LCD, DWIN_LCD_PROUI, MALYAN_LCD, TOUCH_SCREEN)
#define HAS_FEEDRATE_EDIT 1
#endif
/**
* CoreXY, CoreXZ, and CoreYZ - and their reverse
*/
#if ANY(COREXY, COREYX)
#define CORE_IS_XY 1
#endif
#if ANY(COREXZ, COREZX)
#define CORE_IS_XZ 1
#endif
#if ANY(COREYZ, COREZY)
#define CORE_IS_YZ 1
#endif
#if CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ
#define IS_CORE 1
#if CORE_IS_XY
#define CORE_AXIS_1 A_AXIS
#define CORE_AXIS_2 B_AXIS
#define NORMAL_AXIS Z_AXIS
#elif CORE_IS_XZ
#define CORE_AXIS_1 A_AXIS
#define NORMAL_AXIS Y_AXIS
#define CORE_AXIS_2 C_AXIS
#elif CORE_IS_YZ
#define NORMAL_AXIS X_AXIS
#define CORE_AXIS_1 B_AXIS
#define CORE_AXIS_2 C_AXIS
#endif
#define CORESIGN(n) (ANY(COREYX, COREZX, COREZY) ? (-(n)) : (n))
#elif ANY(MARKFORGED_XY, MARKFORGED_YX)
// Markforged kinematics
#define CORE_AXIS_1 A_AXIS
#define CORE_AXIS_2 B_AXIS
#define NORMAL_AXIS Z_AXIS
#endif
#if ANY(MORGAN_SCARA, MP_SCARA, AXEL_TPARA)
#define IS_SCARA 1
#define IS_KINEMATIC 1
#elif ANY(DELTA, POLARGRAPH, POLAR)
#define IS_KINEMATIC 1
#else
#define IS_CARTESIAN 1
#if !IS_CORE
#define IS_FULL_CARTESIAN 1
#endif
#endif
#if DISABLED(DELTA)
#undef DELTA_HOME_TO_SAFE_ZONE
#endif
//
// Serial Port Info
//
#ifdef SERIAL_PORT_2
#define HAS_MULTI_SERIAL 1
#ifdef SERIAL_PORT_3
#define NUM_SERIAL 3
#else
#define NUM_SERIAL 2
#endif
#elif defined(SERIAL_PORT)
#define NUM_SERIAL 1
#else
#define NUM_SERIAL 0
#undef BAUD_RATE_GCODE
#endif
#if SERIAL_PORT == -1 || SERIAL_PORT_2 == -1 || SERIAL_PORT_3 == -1
#define HAS_USB_SERIAL 1
#endif
#if SERIAL_PORT_2 == -2
#define HAS_ETHERNET 1
#endif
/**
* This setting is also used by M109 when trying to calculate
* a ballpark safe margin to prevent wait-forever situation.
*/
#ifndef EXTRUDE_MINTEMP
#define EXTRUDE_MINTEMP 170
#endif
#if ANY(PID_DEBUG, PID_BED_DEBUG, PID_CHAMBER_DEBUG)
#define HAS_PID_DEBUG 1
#endif
#if DISABLED(MPC_AUTOTUNE)
#undef MPC_AUTOTUNE_MENU
#endif
/**
* TFT Displays
*
* Configure parameters for TFT displays:
* - TFT_DEFAULT_ORIENTATION
* - TFT_DRIVER
* - TFT_WIDTH
* - TFT_HEIGHT
* - TFT_INTERFACE_(SPI|FSMC)
* - TFT_COLOR
* - GRAPHICAL_TFT_UPSCALE
*/
#if ANY(MKS_TS35_V2_0, BTT_TFT35_SPI_V1_0) // ST7796
#define TFT_DEFAULT_DRIVER ST7796
#define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY
#define TFT_RES_480x320
#define TFT_INTERFACE_SPI
#define NO_LCD_SDCARD
#elif ANY(LERDGE_TFT35, ANET_ET5_TFT35) // ST7796
#define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY
#define TFT_RES_480x320
#define TFT_INTERFACE_FSMC
#elif ANY(ANET_ET4_TFT28, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32) // ST7789
#define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y)
#define TFT_RES_320x240
#define TFT_INTERFACE_FSMC
#elif ANY(MKS_ROBIN_TFT35, TFT_TRONXY_X5SA, ANYCUBIC_TFT35) // ILI9488
#define TFT_DRIVER ILI9488
#define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
#define TFT_RES_480x320
#define TFT_INTERFACE_FSMC
#elif ENABLED(MKS_ROBIN_TFT43)
#define TFT_DRIVER SSD1963
#define TFT_DEFAULT_ORIENTATION 0
#define TFT_RES_480x272
#define TFT_INTERFACE_FSMC
#elif ANY(MKS_ROBIN_TFT_V1_1R, LONGER_LK_TFT28) // ILI9328 or R61505
#define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
#define TFT_RES_320x240
#define TFT_INTERFACE_FSMC
#elif ENABLED(BIQU_BX_TFT70) // RGB
#define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY
#define TFT_RES_1024x600
#define TFT_INTERFACE_LTDC
#if ENABLED(TOUCH_SCREEN)
#define TFT_TOUCH_DEVICE_GT911
#endif
#elif ENABLED(TFT_GENERIC)
#define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
#if NONE(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320, TFT_RES_1024x600)
#define TFT_RES_320x240
#endif
#if NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
#define TFT_INTERFACE_SPI
#endif
#endif
// FSMC/SPI TFT Panels using standard HAL/tft/tft_(fsmc|spi|ltdc).h
#if ENABLED(TFT_INTERFACE_FSMC)
#define HAS_FSMC_TFT 1
#if TFT_SCALED_DOGLCD
#define HAS_FSMC_GRAPHICAL_TFT 1
#elif HAS_TFT_LVGL_UI
#define HAS_TFT_LVGL_UI_FSMC 1
#endif
#elif ENABLED(TFT_INTERFACE_SPI)
#define HAS_SPI_TFT 1
#if TFT_SCALED_DOGLCD
#define HAS_SPI_GRAPHICAL_TFT 1
#elif HAS_TFT_LVGL_UI
#define HAS_TFT_LVGL_UI_SPI 1
#endif
#elif ENABLED(TFT_INTERFACE_LTDC)
#define HAS_LTDC_TFT 1
#if TFT_SCALED_DOGLCD
#define HAS_LTDC_GRAPHICAL_TFT 1
#elif HAS_TFT_LVGL_UI
#define HAS_TFT_LVGL_UI_LTDC 1
#endif
#endif
#if ANY(HAS_SPI_TFT, HAS_FSMC_TFT, HAS_LTDC_TFT)
#include "../lcd/tft_io/tft_orientation.h" // for TFT_COLOR_UI_PORTRAIT
#endif
#if ENABLED(TFT_RES_320x240)
#if ENABLED(TFT_COLOR_UI_PORTRAIT)
#define TFT_WIDTH 240
#define TFT_HEIGHT 320
#else
#define TFT_WIDTH 320
#define TFT_HEIGHT 240
#endif
#define GRAPHICAL_TFT_UPSCALE 2
#elif ENABLED(TFT_RES_480x272)
#define TFT_WIDTH 480
#define TFT_HEIGHT 272
#define GRAPHICAL_TFT_UPSCALE 2
#elif ENABLED(TFT_RES_480x320)
#if ENABLED(TFT_COLOR_UI_PORTRAIT)
#define TFT_WIDTH 320
#define TFT_HEIGHT 480
#else
#define TFT_WIDTH 480
#define TFT_HEIGHT 320
#endif
#define GRAPHICAL_TFT_UPSCALE 3
#elif ENABLED(TFT_RES_1024x600)
#define TFT_WIDTH 1024
#define TFT_HEIGHT 600
#if ENABLED(TOUCH_SCREEN)
#define GRAPHICAL_TFT_UPSCALE 6
#define TFT_PIXEL_OFFSET_X 120
#else
#define GRAPHICAL_TFT_UPSCALE 8
#define TFT_PIXEL_OFFSET_X 0
#endif
#endif
#if ENABLED(TFT_COLOR_UI)
#if (TFT_WIDTH == 320 && TFT_HEIGHT == 240) || (TFT_WIDTH == 240 && TFT_HEIGHT == 320)
#if ENABLED(TFT_INTERFACE_SPI)
#define TFT_320x240_SPI
#elif ENABLED(TFT_INTERFACE_FSMC)
#define TFT_320x240
#endif
#elif TFT_HEIGHT == 320 || (TFT_HEIGHT == 480 && ENABLED(TFT_COLOR_UI_PORTRAIT))
#if ENABLED(TFT_INTERFACE_SPI)
#define TFT_480x320_SPI
#elif ENABLED(TFT_INTERFACE_FSMC)
#define TFT_480x320
#endif
#elif TFT_HEIGHT == 272
#if ENABLED(TFT_INTERFACE_SPI)
#define TFT_480x272_SPI
#elif ENABLED(TFT_INTERFACE_FSMC)
#define TFT_480x272
#endif
#elif TFT_HEIGHT == 600
#if ENABLED(TFT_INTERFACE_LTDC)
#define TFT_1024x600_LTDC
#else
#define TFT_1024x600_SIM // "Simulation" - for testing purposes only
#endif
#endif
#endif
#if ANY(TFT_320x240, TFT_320x240_SPI)
#define HAS_UI_320x240 1
#elif ANY(TFT_480x320, TFT_480x320_SPI)
#define HAS_UI_480x320 1
#elif ANY(TFT_480x272, TFT_480x272_SPI)
#define HAS_UI_480x272 1
#elif ANY(TFT_1024x600_LTDC, TFT_1024x600_SIM)
#define HAS_UI_1024x600 1
#endif
// Number of text lines the screen can display (may depend on font used)
// Touch screens leave space for extra buttons at the bottom
#if ANY(HAS_UI_320x240, HAS_UI_480x272)
#if ENABLED(TFT_COLOR_UI_PORTRAIT)
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 8, 9)
#else
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7)
#endif
#elif HAS_UI_480x320
#if ENABLED(TFT_COLOR_UI_PORTRAIT)
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 9, 10)
#else
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7)
#endif
#elif HAS_UI_1024x600
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 12, 13)
#endif
// This emulated DOGM has 'touch/xpt2046', not 'tft/xpt2046'
#if ENABLED(TOUCH_SCREEN)
#if NONE(TFT_TOUCH_DEVICE_GT911, TFT_TOUCH_DEVICE_XPT2046)
#define TFT_TOUCH_DEVICE_XPT2046 // ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8
#endif
#if !HAS_GRAPHICAL_TFT
#undef TOUCH_SCREEN
#if ENABLED(TFT_CLASSIC_UI)
#define HAS_TOUCH_BUTTONS 1
#if ENABLED(TFT_TOUCH_DEVICE_GT911)
#define HAS_CAP_TOUCH_BUTTONS 1
#else
#define HAS_RES_TOUCH_BUTTONS 1
#endif
#endif
#endif
#endif
#if (HAS_X_AXIS && X_HOME_DIR) || (HAS_Y_AXIS && Y_HOME_DIR) || (HAS_Z_AXIS && Z_HOME_DIR) \
|| (HAS_I_AXIS && I_HOME_DIR) || (HAS_J_AXIS && J_HOME_DIR) || (HAS_K_AXIS && K_HOME_DIR) \
|| (HAS_U_AXIS && U_HOME_DIR) || (HAS_V_AXIS && V_HOME_DIR) || (HAS_W_AXIS && W_HOME_DIR)
#define HAS_ENDSTOPS 1
#define COORDINATE_OKAY(N,L,H) WITHIN(N,L,H)
#else
#define COORDINATE_OKAY(N,L,H) true
#endif
/**
* LED Backlight INDEX END
*/
#if defined(NEOPIXEL_BKGD_INDEX_FIRST) && !defined(NEOPIXEL_BKGD_INDEX_LAST)
#define NEOPIXEL_BKGD_INDEX_LAST NEOPIXEL_BKGD_INDEX_FIRST
#endif
#if ALL(SPI_FLASH, HAS_MEDIA, MARLIN_DEV_MODE)
#define SPI_FLASH_BACKUP 1
#endif
|
2301_81045437/Marlin
|
Marlin/src/inc/Conditionals_LCD.h
|
C
|
agpl-3.0
| 51,816
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#pragma once
/**
* Conditionals_adv.h
* Conditionals set before pins.h and which depend on Configuration_adv.h.
*/
#if ENABLED(MARLIN_SMALL_BUILD)
#undef EEPROM_CHITCHAT
#undef CAPABILITIES_REPORT
#define DISABLE_M503
#endif
#ifndef AXIS_RELATIVE_MODES
#define AXIS_RELATIVE_MODES {}
#endif
#if defined(SWITCHING_NOZZLE_E1_SERVO_NR) && DISABLED(MECHANICAL_SWITCHING_NOZZLE)
#define SWITCHING_NOZZLE_TWO_SERVOS 1
#endif
// Determine NUM_SERVOS if none was supplied
#ifndef NUM_SERVOS
#define NUM_SERVOS 0
#if HAS_Z_SERVO_PROBE && NUM_SERVOS <= Z_PROBE_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (Z_PROBE_SERVO_NR + 1)
#endif
#if ENABLED(CHAMBER_VENT) && NUM_SERVOS <= CHAMBER_VENT_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (CHAMBER_VENT_SERVO_NR + 1)
#endif
#if ENABLED(SWITCHING_TOOLHEAD) && NUM_SERVOS <= SWITCHING_TOOLHEAD_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (SWITCHING_TOOLHEAD_SERVO_NR + 1)
#endif
#if ENABLED(SWITCHING_NOZZLE)
#if NUM_SERVOS <= SWITCHING_NOZZLE_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (SWITCHING_NOZZLE_SERVO_NR + 1)
#endif
#if NUM_SERVOS <= SWITCHING_NOZZLE_E1_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (SWITCHING_NOZZLE_E1_SERVO_NR + 1)
#endif
#endif
#if ENABLED(SWITCHING_EXTRUDER)
#if NUM_SERVOS <= SWITCHING_EXTRUDER_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (SWITCHING_EXTRUDER_SERVO_NR + 1)
#endif
#if NUM_SERVOS <= SWITCHING_EXTRUDER_E23_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (SWITCHING_EXTRUDER_E23_SERVO_NR + 1)
#endif
#endif
#if ENABLED(SPINDLE_SERVO) && NUM_SERVOS <= SPINDLE_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (SPINDLE_SERVO_NR + 1)
#endif
#endif // !defined(NUM_SERVOS)
// Convenience override for a BLTouch alone
#if ENABLED(BLTOUCH)
#ifdef BLTOUCH_HS_MODE
#define HAS_BLTOUCH_HS_MODE 1
#endif
#if NUM_SERVOS == 1
#undef SERVO_DELAY
#define SERVO_DELAY { 50 }
#endif
#endif
#if !HAS_BED_PROBE
#undef BABYSTEP_ZPROBE_OFFSET
#endif
#if !HAS_STOWABLE_PROBE
#undef PROBE_DEPLOY_STOW_MENU
#endif
// Some options are disallowed without required axes
#if !HAS_X_AXIS
//#define LCD_SHOW_E_TOTAL
#define NO_WORKSPACE_OFFSETS
#define NO_HOME_OFFSETS
#undef AUTOTEMP
#undef CALIBRATION_MEASURE_LEFT
#undef CALIBRATION_MEASURE_RIGHT
#undef CALIBRATION_MEASURE_XMAX
#undef CALIBRATION_MEASURE_XMIN
#undef DISABLE_IDLE_X
#undef INPUT_SHAPING_X
#undef SAFE_BED_LEVELING_START_X
#undef SHAPING_BUFFER_X
#undef SHAPING_FREQ_X
#undef STEALTHCHOP_X
#endif
#if !HAS_Y_AXIS
#undef ARC_SUPPORT
#undef CALIBRATION_MEASURE_BACK
#undef CALIBRATION_MEASURE_FRONT
#undef CALIBRATION_MEASURE_YMAX
#undef CALIBRATION_MEASURE_YMIN
#undef DISABLE_IDLE_Y
#undef HOME_Y_BEFORE_X
#undef INPUT_SHAPING_Y
#undef QUICK_HOME
#undef SAFE_BED_LEVELING_START_Y
#undef SHAPING_BUFFER_Y
#undef SHAPING_FREQ_Y
#undef STEALTHCHOP_Y
#undef STEP_STATE_Y
#endif
#if !HAS_Z_AXIS
#undef CALIBRATION_MEASURE_ZMAX
#undef CALIBRATION_MEASURE_ZMIN
#undef CNC_WORKSPACE_PLANES
#undef DISABLE_IDLE_Z
#undef ENABLE_LEVELING_FADE_HEIGHT
#undef HOME_Z_FIRST
#undef HOMING_Z_WITH_PROBE
#undef NUM_Z_STEPPERS
#undef SAFE_BED_LEVELING_START_Z
#undef STEALTHCHOP_Z
#undef STEP_STATE_Z
#undef Z_IDLE_HEIGHT
#undef Z_PROBE_SLED
#undef Z_SAFE_HOMING
#endif
#if !HAS_I_AXIS
#undef CALIBRATION_MEASURE_IMAX
#undef CALIBRATION_MEASURE_IMIN
#undef DISABLE_IDLE_I
#undef SAFE_BED_LEVELING_START_I
#undef STEALTHCHOP_I
#undef STEP_STATE_I
#endif
#if !HAS_J_AXIS
#undef CALIBRATION_MEASURE_JMAX
#undef CALIBRATION_MEASURE_JMIN
#undef DISABLE_IDLE_J
#undef SAFE_BED_LEVELING_START_J
#undef STEALTHCHOP_J
#undef STEP_STATE_J
#endif
#if !HAS_K_AXIS
#undef CALIBRATION_MEASURE_KMAX
#undef CALIBRATION_MEASURE_KMIN
#undef DISABLE_IDLE_K
#undef SAFE_BED_LEVELING_START_K
#undef STEALTHCHOP_K
#undef STEP_STATE_K
#endif
#if !HAS_U_AXIS
#undef CALIBRATION_MEASURE_UMAX
#undef CALIBRATION_MEASURE_UMIN
#undef DISABLE_IDLE_U
#undef SAFE_BED_LEVELING_START_U
#undef STEALTHCHOP_U
#undef STEP_STATE_U
#endif
#if !HAS_V_AXIS
#undef CALIBRATION_MEASURE_VMAX
#undef CALIBRATION_MEASURE_VMIN
#undef DISABLE_IDLE_V
#undef SAFE_BED_LEVELING_START_V
#undef STEALTHCHOP_V
#undef STEP_STATE_V
#endif
#if !HAS_W_AXIS
#undef CALIBRATION_MEASURE_WMAX
#undef CALIBRATION_MEASURE_WMIN
#undef DISABLE_IDLE_W
#undef SAFE_BED_LEVELING_START_W
#undef STEALTHCHOP_W
#undef STEP_STATE_W
#endif
// Disallowed with no extruders
#if !HAS_EXTRUDERS
#define NO_VOLUMETRICS
#undef ADVANCED_PAUSE_FEATURE
#undef DISABLE_IDLE_E
#undef EXTRUDER_RUNOUT_PREVENT
#undef FILAMENT_LOAD_UNLOAD_GCODES
#undef FWRETRACT
#undef LCD_SHOW_E_TOTAL
#undef LIN_ADVANCE
#undef MANUAL_E_MOVES_RELATIVE
#undef PID_EXTRUSION_SCALING
#undef SHOW_TEMP_ADC_VALUES
#undef STEALTHCHOP_E
#endif
#if ENABLED(DISABLE_X) && !defined(DISABLE_IDLE_X)
#define DISABLE_IDLE_X
#endif
#if ENABLED(DISABLE_Y) && !defined(DISABLE_IDLE_Y)
#define DISABLE_IDLE_Y
#endif
#if ENABLED(DISABLE_Z) && !defined(DISABLE_IDLE_Z)
#define DISABLE_IDLE_Z
#endif
#if ENABLED(DISABLE_I) && !defined(DISABLE_IDLE_I)
#define DISABLE_IDLE_I
#endif
#if ENABLED(DISABLE_J) && !defined(DISABLE_IDLE_J)
#define DISABLE_IDLE_J
#endif
#if ENABLED(DISABLE_K) && !defined(DISABLE_IDLE_K)
#define DISABLE_IDLE_K
#endif
#if ENABLED(DISABLE_U) && !defined(DISABLE_IDLE_U)
#define DISABLE_IDLE_U
#endif
#if ENABLED(DISABLE_V) && !defined(DISABLE_IDLE_V)
#define DISABLE_IDLE_V
#endif
#if ENABLED(DISABLE_W) && !defined(DISABLE_IDLE_W)
#define DISABLE_IDLE_W
#endif
#if ENABLED(DISABLE_E) && !defined(DISABLE_IDLE_E)
#define DISABLE_IDLE_E
#endif
#define _OR_HAS_DI(A) || ALL(HAS_##A##_AXIS, DISABLE_IDLE_##A)
#if ALL(HAS_EXTRUDERS, DISABLE_IDLE_E) MAP(_OR_HAS_DI, X, Y, Z, I, J, K, U, V, W)
#define HAS_DISABLE_IDLE_AXES 1
#endif
#undef _OR_HAS_DI
// Remove hotend-dependent settings
#if HOTENDS < 8
#undef E7_AUTO_FAN_PIN
#undef HEATER_7_MAXTEMP
#undef HEATER_7_MINTEMP
#if HOTENDS < 7
#undef E6_AUTO_FAN_PIN
#undef HEATER_6_MAXTEMP
#undef HEATER_6_MINTEMP
#if HOTENDS < 6
#undef E5_AUTO_FAN_PIN
#undef HEATER_5_MAXTEMP
#undef HEATER_5_MINTEMP
#if HOTENDS < 5
#undef E4_AUTO_FAN_PIN
#undef HEATER_4_MAXTEMP
#undef HEATER_4_MINTEMP
#if HOTENDS < 4
#undef E3_AUTO_FAN_PIN
#undef HEATER_3_MAXTEMP
#undef HEATER_3_MINTEMP
#if HOTENDS < 3
#undef E2_AUTO_FAN_PIN
#undef HEATER_2_MAXTEMP
#undef HEATER_2_MINTEMP
#if HOTENDS < 2
#undef E1_AUTO_FAN_PIN
#undef HEATER_1_MAXTEMP
#undef HEATER_1_MINTEMP
#if HOTENDS < 1
#undef AUTOTEMP
#undef E0_AUTO_FAN_PIN
#undef HEATER_0_MAXTEMP
#undef HEATER_0_MINTEMP
#undef PID_PARAMS_PER_HOTEND
#undef PIDTEMP
#undef MPCTEMP
#undef PREVENT_COLD_EXTRUSION
#undef THERMAL_PROTECTION_HOTENDS
#undef THERMAL_PROTECTION_PERIOD
#undef WATCH_TEMP_PERIOD
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
// Use Junction Deviation for motion if Jerk is disabled
#if DISABLED(CLASSIC_JERK)
#define HAS_JUNCTION_DEVIATION 1
#endif
// E jerk exists with JD disabled (of course) but also when Linear Advance is disabled on Delta/SCARA
#if HAS_EXTRUDERS && (ENABLED(CLASSIC_JERK) || (IS_KINEMATIC && DISABLED(LIN_ADVANCE)))
#define HAS_CLASSIC_E_JERK 1
#endif
// Linear advance uses Jerk since E is an isolated axis
#if ALL(HAS_JUNCTION_DEVIATION, LIN_ADVANCE)
#define HAS_LINEAR_E_JERK 1
#endif
// Some displays can toggle Adaptive Step Smoothing.
// The state is saved to EEPROM.
// In future this may be added to a G-code such as M205 A.
#if ALL(ADAPTIVE_STEP_SMOOTHING, DWIN_LCD_PROUI)
#define ADAPTIVE_STEP_SMOOTHING_TOGGLE
#endif
/**
* Temperature Sensors; define what sensor(s) we have.
*/
// Temperature sensor IDs
#define H_NONE -128
#define H_REDUNDANT -7
#define H_SOC -6
#define H_BOARD -5
#define H_COOLER -4
#define H_PROBE -3
#define H_CHAMBER -2
#define H_BED -1
#define H_E0 0
#define H_E1 1
#define H_E2 2
#define H_E3 3
#define H_E4 4
#define H_E5 5
#define H_E6 6
#define H_E7 7
#define _SENSOR_IS(I,N) || (TEMP_SENSOR(N) == I)
#define _E_SENSOR_IS(I,N) _SENSOR_IS(N,I)
#define ANY_E_SENSOR_IS(N) (0 REPEAT2(HOTENDS, _E_SENSOR_IS, N))
#define ANY_THERMISTOR_IS(N) ( ANY_E_SENSOR_IS(N) _SENSOR_IS(N,REDUNDANT) \
_SENSOR_IS(N,BED) _SENSOR_IS(N,PROBE) _SENSOR_IS(N,CHAMBER) _SENSOR_IS(N,COOLER) _SENSOR_IS(N,BOARD) )
#if ANY_THERMISTOR_IS(1000)
#define HAS_USER_THERMISTORS 1
#endif
#if TEMP_SENSOR_REDUNDANT
#define _HEATER_ID(M) H_##M
#define HEATER_ID(M) _HEATER_ID(M)
#define REDUNDANT_TEMP_MATCH(M,N) (HEATER_ID(TEMP_SENSOR_REDUNDANT_##M) == _HEATER_ID(N))
#else
#define REDUNDANT_TEMP_MATCH(...) 0
#endif
#if TEMP_SENSOR_IS_MAX_TC(0)
#if TEMP_SENSOR_0 == -5
#define TEMP_SENSOR_0_IS_MAX31865 1
#define TEMP_SENSOR_0_MAX_TC_TMIN 0
#define TEMP_SENSOR_0_MAX_TC_TMAX 1024
#ifndef MAX31865_SENSOR_WIRES_0
#define MAX31865_SENSOR_WIRES_0 2
#endif
#ifndef MAX31865_WIRE_OHMS_0
#define MAX31865_WIRE_OHMS_0 0.0f
#endif
#elif TEMP_SENSOR_0 == -3
#define TEMP_SENSOR_0_IS_MAX31855 1
#define TEMP_SENSOR_0_MAX_TC_TMIN -270
#define TEMP_SENSOR_0_MAX_TC_TMAX 1800
#elif TEMP_SENSOR_0 == -2
#define TEMP_SENSOR_0_IS_MAX6675 1
#define TEMP_SENSOR_0_MAX_TC_TMIN 0
#define TEMP_SENSOR_0_MAX_TC_TMAX 1024
#endif
#elif TEMP_SENSOR_0 == -4
#define TEMP_SENSOR_0_IS_AD8495 1
#elif TEMP_SENSOR_0 == -1
#define TEMP_SENSOR_0_IS_AD595 1
#elif TEMP_SENSOR_0 > 0
#define TEMP_SENSOR_0_IS_THERMISTOR 1
#if TEMP_SENSOR_0 == 1000
#define TEMP_SENSOR_0_IS_CUSTOM 1
#elif TEMP_SENSOR_0 == 998 || TEMP_SENSOR_0 == 999
#define TEMP_SENSOR_0_IS_DUMMY 1
#endif
#endif
#if TEMP_SENSOR_IS_MAX_TC(1)
#if TEMP_SENSOR_1 == -5
#define TEMP_SENSOR_1_IS_MAX31865 1
#define TEMP_SENSOR_1_MAX_TC_TMIN 0
#define TEMP_SENSOR_1_MAX_TC_TMAX 1024
#ifndef MAX31865_SENSOR_WIRES_1
#define MAX31865_SENSOR_WIRES_1 2
#endif
#ifndef MAX31865_WIRE_OHMS_1
#define MAX31865_WIRE_OHMS_1 0.0f
#endif
#elif TEMP_SENSOR_1 == -3
#define TEMP_SENSOR_1_IS_MAX31855 1
#define TEMP_SENSOR_1_MAX_TC_TMIN -270
#define TEMP_SENSOR_1_MAX_TC_TMAX 1800
#elif TEMP_SENSOR_1 == -2
#define TEMP_SENSOR_1_IS_MAX6675 1
#define TEMP_SENSOR_1_MAX_TC_TMIN 0
#define TEMP_SENSOR_1_MAX_TC_TMAX 1024
#endif
#if TEMP_SENSOR_1 != TEMP_SENSOR_0
#if TEMP_SENSOR_1 == -5
#error "If MAX31865 Thermocouple (-5) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match."
#elif TEMP_SENSOR_1 == -3
#error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match."
#elif TEMP_SENSOR_1 == -2
#error "If MAX6675 Thermocouple (-2) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match."
#endif
#endif
#elif TEMP_SENSOR_1 == -4
#define TEMP_SENSOR_1_IS_AD8495 1
#elif TEMP_SENSOR_1 == -1
#define TEMP_SENSOR_1_IS_AD595 1
#elif TEMP_SENSOR_1 > 0
#define TEMP_SENSOR_1_IS_THERMISTOR 1
#if TEMP_SENSOR_1 == 1000
#define TEMP_SENSOR_1_IS_CUSTOM 1
#elif TEMP_SENSOR_1 == 998 || TEMP_SENSOR_1 == 999
#define TEMP_SENSOR_1_IS_DUMMY 1
#endif
#endif
#if TEMP_SENSOR_IS_MAX_TC(2)
#if TEMP_SENSOR_2 == -5
#define TEMP_SENSOR_2_IS_MAX31865 1
#define TEMP_SENSOR_2_MAX_TC_TMIN 0
#define TEMP_SENSOR_2_MAX_TC_TMAX 1024
#ifndef MAX31865_SENSOR_WIRES_2
#define MAX31865_SENSOR_WIRES_2 2
#endif
#ifndef MAX31865_WIRE_OHMS_2
#define MAX31865_WIRE_OHMS_2 0.0f
#endif
#elif TEMP_SENSOR_2 == -3
#define TEMP_SENSOR_2_IS_MAX31855 1
#define TEMP_SENSOR_2_MAX_TC_TMIN -270
#define TEMP_SENSOR_2_MAX_TC_TMAX 1800
#elif TEMP_SENSOR_2 == -2
#define TEMP_SENSOR_2_IS_MAX6675 1
#define TEMP_SENSOR_2_MAX_TC_TMIN 0
#define TEMP_SENSOR_2_MAX_TC_TMAX 1024
#endif
#if TEMP_SENSOR_2 != TEMP_SENSOR_0
#if TEMP_SENSOR_2 == -5
#error "If MAX31865 Thermocouple (-5) is used for TEMP_SENSOR_2 then TEMP_SENSOR_0 must match."
#elif TEMP_SENSOR_2 == -3
#error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_2 then TEMP_SENSOR_0 must match."
#elif TEMP_SENSOR_2 == -2
#error "If MAX6675 Thermocouple (-2) is used for TEMP_SENSOR_2 then TEMP_SENSOR_0 must match."
#endif
#endif
#elif TEMP_SENSOR_2 == -4
#define TEMP_SENSOR_2_IS_AD8495 1
#elif TEMP_SENSOR_2 == -1
#define TEMP_SENSOR_2_IS_AD595 1
#elif TEMP_SENSOR_2 > 0
#define TEMP_SENSOR_2_IS_THERMISTOR 1
#if TEMP_SENSOR_2 == 1000
#define TEMP_SENSOR_2_IS_CUSTOM 1
#elif TEMP_SENSOR_2 == 998 || TEMP_SENSOR_2 == 999
#define TEMP_SENSOR_2_IS_DUMMY 1
#endif
#endif
#if TEMP_SENSOR_3 > 0
#define TEMP_SENSOR_3_IS_THERMISTOR 1
#if TEMP_SENSOR_3 == 1000
#define TEMP_SENSOR_3_IS_CUSTOM 1
#elif TEMP_SENSOR_3 == 998 || TEMP_SENSOR_3 == 999
#define TEMP_SENSOR_3_IS_DUMMY 1
#endif
#endif
#if TEMP_SENSOR_4 > 0
#define TEMP_SENSOR_4_IS_THERMISTOR 1
#if TEMP_SENSOR_4 == 1000
#define TEMP_SENSOR_4_IS_CUSTOM 1
#elif TEMP_SENSOR_4 == 998 || TEMP_SENSOR_4 == 999
#define TEMP_SENSOR_4_IS_DUMMY 1
#endif
#endif
#if TEMP_SENSOR_5 > 0
#define TEMP_SENSOR_5_IS_THERMISTOR 1
#if TEMP_SENSOR_5 == 1000
#define TEMP_SENSOR_5_IS_CUSTOM 1
#elif TEMP_SENSOR_5 == 998 || TEMP_SENSOR_5 == 999
#define TEMP_SENSOR_5_IS_DUMMY 1
#endif
#endif
#if TEMP_SENSOR_6 > 0
#define TEMP_SENSOR_6_IS_THERMISTOR 1
#if TEMP_SENSOR_6 == 1000
#define TEMP_SENSOR_6_IS_CUSTOM 1
#elif TEMP_SENSOR_6 == 998 || TEMP_SENSOR_6 == 999
#define TEMP_SENSOR_6_IS_DUMMY 1
#endif
#endif
#if TEMP_SENSOR_7 > 0
#define TEMP_SENSOR_7_IS_THERMISTOR 1
#if TEMP_SENSOR_7 == 1000
#define TEMP_SENSOR_7_IS_CUSTOM 1
#elif TEMP_SENSOR_7 == 998 || TEMP_SENSOR_7 == 999
#define TEMP_SENSOR_7_IS_DUMMY 1
#endif
#endif
#if TEMP_SENSOR_IS_MAX_TC(REDUNDANT)
#define _REDUNDANT_E (REDUNDANT_TEMP_MATCH(SOURCE, E0) || REDUNDANT_TEMP_MATCH(SOURCE, E1) || REDUNDANT_TEMP_MATCH(SOURCE, E2))
#if TEMP_SENSOR_REDUNDANT == -5
#if !_REDUNDANT_E
#error "MAX31865 Thermocouples (-5) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_[0-2]."
#endif
#define TEMP_SENSOR_REDUNDANT_IS_MAX31865 1
#define TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN 0
#define TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX 1024
#elif TEMP_SENSOR_REDUNDANT == -3
#if !_REDUNDANT_E
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_[0-2]."
#endif
#define TEMP_SENSOR_REDUNDANT_IS_MAX31855 1
#define TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN -270
#define TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX 1800
#elif TEMP_SENSOR_REDUNDANT == -2
#if !_REDUNDANT_E
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_[0-2]."
#endif
#define TEMP_SENSOR_REDUNDANT_IS_MAX6675 1
#define TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN 0
#define TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX 1024
#endif
#undef _REDUNDANT_E
// Mimic setting up the source TEMP_SENSOR
#if REDUNDANT_TEMP_MATCH(SOURCE, E0)
#define TEMP_SENSOR_0_MAX_TC_TMIN TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN
#define TEMP_SENSOR_0_MAX_TC_TMAX TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX
#ifndef MAX31865_SENSOR_WIRES_0
#define MAX31865_SENSOR_WIRES_0 2
#endif
#elif REDUNDANT_TEMP_MATCH(SOURCE, E1)
#define TEMP_SENSOR_1_MAX_TC_TMIN TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN
#define TEMP_SENSOR_1_MAX_TC_TMAX TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX
#ifndef MAX31865_SENSOR_WIRES_1
#define MAX31865_SENSOR_WIRES_1 2
#endif
#elif REDUNDANT_TEMP_MATCH(SOURCE, E2)
#define TEMP_SENSOR_2_MAX_TC_TMIN TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN
#define TEMP_SENSOR_2_MAX_TC_TMAX TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX
#ifndef MAX31865_SENSOR_WIRES_2
#define MAX31865_SENSOR_WIRES_2 2
#endif
#endif
#if (TEMP_SENSOR_IS_MAX_TC(0) && TEMP_SENSOR_REDUNDANT != TEMP_SENSOR_0) || (TEMP_SENSOR_IS_MAX_TC(1) && TEMP_SENSOR_REDUNDANT != TEMP_SENSOR_1) || (TEMP_SENSOR_IS_MAX_TC(2) && TEMP_SENSOR_REDUNDANT != TEMP_SENSOR_2)
#if TEMP_SENSOR_REDUNDANT == -5
#error "If MAX31865 Thermocouple (-5) is used for TEMP_SENSOR_[0-2] then TEMP_SENSOR_REDUNDANT must match."
#elif TEMP_SENSOR_REDUNDANT == -3
#error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_[0-2] then TEMP_SENSOR_REDUNDANT must match."
#elif TEMP_SENSOR_REDUNDANT == -2
#error "If MAX6675 Thermocouple (-2) is used for TEMP_SENSOR_[0-2] then TEMP_SENSOR_REDUNDANT must match."
#endif
#endif
#elif TEMP_SENSOR_REDUNDANT == -4
#define TEMP_SENSOR_REDUNDANT_IS_AD8495 1
#elif TEMP_SENSOR_REDUNDANT == -1
#define TEMP_SENSOR_REDUNDANT_IS_AD595 1
#elif TEMP_SENSOR_REDUNDANT == 998 || TEMP_SENSOR_REDUNDANT == 999
#error "Dummy sensors are not supported for TEMP_SENSOR_REDUNDANT."
#elif TEMP_SENSOR_REDUNDANT > 0
#define TEMP_SENSOR_REDUNDANT_IS_THERMISTOR 1
#if TEMP_SENSOR_REDUNDANT == 1000
#define TEMP_SENSOR_REDUNDANT_IS_CUSTOM 1
#endif
#endif
#if TEMP_SENSOR_IS_MAX_TC(0) || TEMP_SENSOR_IS_MAX_TC(1) || TEMP_SENSOR_IS_MAX_TC(2) || TEMP_SENSOR_IS_MAX_TC(BED) || TEMP_SENSOR_IS_MAX_TC(REDUNDANT)
#define HAS_MAX_TC 1
#endif
#if TEMP_SENSOR_0_IS_MAX6675 || TEMP_SENSOR_1_IS_MAX6675 || TEMP_SENSOR_2_IS_MAX6675 || TEMP_SENSOR_BED_IS_MAX6675 || TEMP_SENSOR_REDUNDANT_IS_MAX6675
#define HAS_MAX6675 1
#endif
#if TEMP_SENSOR_0_IS_MAX31855 || TEMP_SENSOR_1_IS_MAX31855 || TEMP_SENSOR_2_IS_MAX31855 || TEMP_SENSOR_BED_IS_MAX31855 || TEMP_SENSOR_REDUNDANT_IS_MAX31855
#define HAS_MAX31855 1
#endif
#if TEMP_SENSOR_0_IS_MAX31865 || TEMP_SENSOR_1_IS_MAX31865 || TEMP_SENSOR_2_IS_MAX31865 || TEMP_SENSOR_BED_IS_MAX31865 || TEMP_SENSOR_REDUNDANT_IS_MAX31865
#define HAS_MAX31865 1
#endif
#if TEMP_SENSOR_3 == -4
#define TEMP_SENSOR_3_IS_AD8495 1
#elif TEMP_SENSOR_3 == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_3."
#elif TEMP_SENSOR_3 == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_3."
#elif TEMP_SENSOR_3 == -1
#define TEMP_SENSOR_3_IS_AD595 1
#elif TEMP_SENSOR_3 == 998 || TEMP_SENSOR_3 == 999
#define TEMP_SENSOR_3_IS_DUMMY 1
#elif TEMP_SENSOR_3 > 0
#define TEMP_SENSOR_3_IS_THERMISTOR 1
#if TEMP_SENSOR_3 == 1000
#define TEMP_SENSOR_3_IS_CUSTOM 1
#endif
#endif
#if TEMP_SENSOR_4 == -4
#define TEMP_SENSOR_4_IS_AD8495 1
#elif TEMP_SENSOR_4 == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_4."
#elif TEMP_SENSOR_4 == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_4."
#elif TEMP_SENSOR_4 == -1
#define TEMP_SENSOR_4_IS_AD595 1
#elif TEMP_SENSOR_4 == 998 || TEMP_SENSOR_4 == 999
#define TEMP_SENSOR_4_IS_DUMMY 1
#elif TEMP_SENSOR_4 > 0
#define TEMP_SENSOR_4_IS_THERMISTOR 1
#if TEMP_SENSOR_4 == 1000
#define TEMP_SENSOR_4_IS_CUSTOM 1
#endif
#endif
#if TEMP_SENSOR_5 == -4
#define TEMP_SENSOR_5_IS_AD8495 1
#elif TEMP_SENSOR_5 == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_5."
#elif TEMP_SENSOR_5 == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_5."
#elif TEMP_SENSOR_5 == -1
#define TEMP_SENSOR_5_IS_AD595 1
#elif TEMP_SENSOR_5 == 998 || TEMP_SENSOR_5 == 999
#define TEMP_SENSOR_5_IS_DUMMY 1
#elif TEMP_SENSOR_5 > 0
#define TEMP_SENSOR_5_IS_THERMISTOR 1
#if TEMP_SENSOR_5 == 1000
#define TEMP_SENSOR_5_IS_CUSTOM 1
#endif
#endif
#if TEMP_SENSOR_6 == -4
#define TEMP_SENSOR_6_IS_AD8495 1
#elif TEMP_SENSOR_6 == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_6."
#elif TEMP_SENSOR_6 == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_6."
#elif TEMP_SENSOR_6 == -1
#define TEMP_SENSOR_6_IS_AD595 1
#elif TEMP_SENSOR_6 == 998 || TEMP_SENSOR_6 == 999
#define TEMP_SENSOR_6_IS_DUMMY 1
#elif TEMP_SENSOR_6 > 0
#define TEMP_SENSOR_6_IS_THERMISTOR 1
#if TEMP_SENSOR_6 == 1000
#define TEMP_SENSOR_6_IS_CUSTOM 1
#endif
#endif
#if TEMP_SENSOR_7 == -4
#define TEMP_SENSOR_7_IS_AD8495 1
#elif TEMP_SENSOR_7 == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_7."
#elif TEMP_SENSOR_7 == -2
#error "MAX7775 Thermocouples (-2) not supported for TEMP_SENSOR_7."
#elif TEMP_SENSOR_7 == -1
#define TEMP_SENSOR_7_IS_AD595 1
#elif TEMP_SENSOR_7 == 998 || TEMP_SENSOR_7 == 999
#define TEMP_SENSOR_7_IS_DUMMY 1
#elif TEMP_SENSOR_7 > 0
#define TEMP_SENSOR_7_IS_THERMISTOR 1
#if TEMP_SENSOR_7 == 1000
#define TEMP_SENSOR_7_IS_CUSTOM 1
#endif
#endif
#if TEMP_SENSOR_IS_MAX_TC(BED)
#if TEMP_SENSOR_BED == -5
#define TEMP_SENSOR_BED_IS_MAX31865 1
#define TEMP_SENSOR_BED_MAX_TC_TMIN 0
#define TEMP_SENSOR_BED_MAX_TC_TMAX 1024
#ifndef MAX31865_SENSOR_WIRES_BED
#define MAX31865_SENSOR_WIRES_BED 2
#endif
#ifndef MAX31865_WIRE_OHMS_BED
#define MAX31865_WIRE_OHMS_BED 0.0f
#endif
#elif TEMP_SENSOR_BED == -3
#define TEMP_SENSOR_BED_IS_MAX31855 1
#define TEMP_SENSOR_BED_MAX_TC_TMIN -270
#define TEMP_SENSOR_BED_MAX_TC_TMAX 1800
#elif TEMP_SENSOR_BED == -2
#define TEMP_SENSOR_BED_IS_MAX6675 1
#define TEMP_SENSOR_BED_MAX_TC_TMIN 0
#define TEMP_SENSOR_BED_MAX_TC_TMAX 1024
#endif
#elif TEMP_SENSOR_BED == -4
#define TEMP_SENSOR_BED_IS_AD8495 1
#elif TEMP_SENSOR_BED == -1
#define TEMP_SENSOR_BED_IS_AD595 1
#elif TEMP_SENSOR_BED > 0
#define TEMP_SENSOR_BED_IS_THERMISTOR 1
#if TEMP_SENSOR_BED == 1000
#define TEMP_SENSOR_BED_IS_CUSTOM 1
#elif TEMP_SENSOR_BED == 998 || TEMP_SENSOR_BED == 999
#define TEMP_SENSOR_BED_IS_DUMMY 1
#endif
#else
#undef BED_MINTEMP
#undef BED_MAXTEMP
#endif
#if TEMP_SENSOR_CHAMBER == -4
#define TEMP_SENSOR_CHAMBER_IS_AD8495 1
#elif TEMP_SENSOR_CHAMBER == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_CHAMBER."
#elif TEMP_SENSOR_CHAMBER == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER."
#elif TEMP_SENSOR_CHAMBER == -1
#define TEMP_SENSOR_CHAMBER_IS_AD595 1
#elif TEMP_SENSOR_CHAMBER > 0
#define TEMP_SENSOR_CHAMBER_IS_THERMISTOR 1
#if TEMP_SENSOR_CHAMBER == 1000
#define TEMP_SENSOR_CHAMBER_IS_CUSTOM 1
#elif TEMP_SENSOR_CHAMBER == 998 || TEMP_SENSOR_CHAMBER == 999
#define TEMP_SENSOR_CHAMBER_IS_DUMMY 1
#endif
#else
#undef THERMAL_PROTECTION_CHAMBER
#undef CHAMBER_MINTEMP
#undef CHAMBER_MAXTEMP
#endif
#if TEMP_SENSOR_COOLER == -4
#define TEMP_SENSOR_COOLER_IS_AD8495 1
#elif TEMP_SENSOR_COOLER == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_COOLER."
#elif TEMP_SENSOR_COOLER == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_COOLER."
#elif TEMP_SENSOR_COOLER == -1
#define TEMP_SENSOR_COOLER_IS_AD595 1
#elif TEMP_SENSOR_COOLER == 998 || TEMP_SENSOR_COOLER == 999
#define TEMP_SENSOR_COOLER_IS_DUMMY 1
#elif TEMP_SENSOR_COOLER > 0
#define TEMP_SENSOR_COOLER_IS_THERMISTOR 1
#if TEMP_SENSOR_COOLER == 1000
#define TEMP_SENSOR_COOLER_IS_CUSTOM 1
#endif
#else
#undef THERMAL_PROTECTION_COOLER
#undef COOLER_MINTEMP
#undef COOLER_MAXTEMP
#endif
#if TEMP_SENSOR_PROBE == -4
#define TEMP_SENSOR_PROBE_IS_AD8495 1
#elif TEMP_SENSOR_PROBE == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_PROBE."
#elif TEMP_SENSOR_PROBE == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_PROBE."
#elif TEMP_SENSOR_PROBE == -1
#define TEMP_SENSOR_PROBE_IS_AD595 1
#elif TEMP_SENSOR_PROBE > 0
#define TEMP_SENSOR_PROBE_IS_THERMISTOR 1
#if TEMP_SENSOR_PROBE == 1000
#define TEMP_SENSOR_PROBE_IS_CUSTOM 1
#elif TEMP_SENSOR_PROBE == 998 || TEMP_SENSOR_PROBE == 999
#define TEMP_SENSOR_PROBE_IS_DUMMY 1
#endif
#endif
#if TEMP_SENSOR_BOARD == -4
#define TEMP_SENSOR_BOARD_IS_AD8495 1
#elif TEMP_SENSOR_BOARD == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_BOARD."
#elif TEMP_SENSOR_BOARD == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BOARD."
#elif TEMP_SENSOR_BOARD == -1
#define TEMP_SENSOR_BOARD_IS_AD595 1
#elif TEMP_SENSOR_BOARD > 0
#define TEMP_SENSOR_BOARD_IS_THERMISTOR 1
#if TEMP_SENSOR_BOARD == 1000
#define TEMP_SENSOR_BOARD_IS_CUSTOM 1
#elif TEMP_SENSOR_BOARD == 998 || TEMP_SENSOR_BOARD == 999
#define TEMP_SENSOR_BOARD_IS_DUMMY 1
#endif
#endif
#if HAS_MULTI_EXTRUDER || HAS_MULTI_HOTEND || HAS_PRUSA_MMU2 || (ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1)
#define HAS_TOOLCHANGE 1
#endif
#if ENABLED(MIXING_EXTRUDER) && (ENABLED(RETRACT_SYNC_MIXING) || ALL(FILAMENT_LOAD_UNLOAD_GCODES, FILAMENT_UNLOAD_ALL_EXTRUDERS))
#define HAS_MIXER_SYNC_CHANNEL 1
#endif
#if ANY(DUAL_X_CARRIAGE, MULTI_NOZZLE_DUPLICATION)
#define HAS_DUPLICATION_MODE 1
#endif
#if ENABLED(PRINTCOUNTER) && (SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0)
#define HAS_SERVICE_INTERVALS 1
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define HAS_FILAMENT_SENSOR 1
#if NUM_RUNOUT_SENSORS > 1
#define MULTI_FILAMENT_SENSOR 1
#endif
#ifdef FILAMENT_RUNOUT_DISTANCE_MM
#define HAS_FILAMENT_RUNOUT_DISTANCE 1
#endif
#if ENABLED(MIXING_EXTRUDER)
#define WATCH_ALL_RUNOUT_SENSORS
#endif
#endif
#if ANY(PTC_PROBE, PTC_BED, PTC_HOTEND)
#define HAS_PTC 1
#endif
// Let SD_FINISHED_RELEASECOMMAND stand in for SD_FINISHED_STEPPERRELEASE
#if ENABLED(SD_FINISHED_STEPPERRELEASE)
#ifndef SD_FINISHED_RELEASECOMMAND
#define SD_FINISHED_RELEASECOMMAND "M84" // planner.finish_and_disable()
#endif
#else
#undef SD_FINISHED_RELEASECOMMAND
#endif
#if ENABLED(NO_SD_AUTOSTART)
#undef MENU_ADDAUTOSTART
#endif
#if ANY(HAS_MEDIA, SET_PROGRESS_MANUALLY)
#define HAS_PRINT_PROGRESS 1
#endif
#if DISABLED(SET_PROGRESS_MANUALLY)
#undef SET_REMAINING_TIME
#undef SET_INTERACTION_TIME
#undef M73_REPORT
#endif
#if ANY(HAS_MARLINUI_MENU, ULTIPANEL_FEEDMULTIPLY, SOFT_RESET_ON_KILL)
#define HAS_ENCODER_ACTION 1
#endif
#if ENABLED(ENCODER_RATE_MULTIPLIER)
#ifndef ENCODER_5X_STEPS_PER_SEC
#define ENCODER_5X_STEPS_PER_SEC 0
#endif
#ifndef ENCODER_10X_STEPS_PER_SEC
#define ENCODER_10X_STEPS_PER_SEC 0
#endif
#ifndef ENCODER_100X_STEPS_PER_SEC
#define ENCODER_100X_STEPS_PER_SEC 0
#endif
#if !((HAS_MARLINUI_MENU || HAS_DWIN_E3V2) && (ENCODER_5X_STEPS_PER_SEC || ENCODER_10X_STEPS_PER_SEC || ENCODER_100X_STEPS_PER_SEC))
#undef ENCODER_RATE_MULTIPLIER
#undef ENCODER_5X_STEPS_PER_SEC
#undef ENCODER_10X_STEPS_PER_SEC
#undef ENCODER_100X_STEPS_PER_SEC
#endif
#endif
#if STATUS_MESSAGE_TIMEOUT_SEC > 0
#define HAS_STATUS_MESSAGE_TIMEOUT 1
#endif
#if HAS_MEDIA && SD_PROCEDURE_DEPTH
#define HAS_MEDIA_SUBCALLS 1
#endif
#if ANY(SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME)
#define HAS_TIME_DISPLAY 1
#endif
#if ANY(SHOW_PROGRESS_PERCENT, HAS_TIME_DISPLAY) && !HAS_GRAPHICAL_TFT
#define HAS_EXTRA_PROGRESS 1
#endif
#if HAS_PRINT_PROGRESS && ANY(PRINT_PROGRESS_SHOW_DECIMALS, SHOW_REMAINING_TIME)
#define HAS_PRINT_PROGRESS_PERMYRIAD 1
#endif
#if ANY(MARLIN_BRICKOUT, MARLIN_INVADERS, MARLIN_SNAKE, MARLIN_MAZE)
#define HAS_GAMES 1
#if MANY(MARLIN_BRICKOUT, MARLIN_INVADERS, MARLIN_SNAKE, MARLIN_MAZE)
#define HAS_GAME_MENU 1
#endif
#endif
#if ANY(FWRETRACT, HAS_LEVELING, SKEW_CORRECTION)
#define HAS_POSITION_MODIFIERS 1
#endif
#if ANY(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS, Z_MULTI_ENDSTOPS)
#define HAS_EXTRA_ENDSTOPS 1
#endif
#if ANY(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
#define HAS_SOFTWARE_ENDSTOPS 1
#endif
#if ANY(EXTENSIBLE_UI, IS_NEWPANEL, EMERGENCY_PARSER, HAS_ADC_BUTTONS, HAS_DWIN_E3V2)
#define HAS_RESUME_CONTINUE 1
#endif
#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED)
#define HAS_COLOR_LEDS 1
#else
#undef LED_POWEROFF_TIMEOUT
#endif
#if ALL(HAS_RESUME_CONTINUE, PRINTER_EVENT_LEDS, HAS_MEDIA)
#define HAS_LEDS_OFF_FLAG 1
#endif
#ifdef DISPLAY_SLEEP_MINUTES
#define HAS_DISPLAY_SLEEP 1
#endif
#ifdef LCD_BACKLIGHT_TIMEOUT_MINS
#define HAS_BACKLIGHT_TIMEOUT 1
#endif
#if ANY(DIGIPOT_MCP4018, DIGIPOT_MCP4451)
#define HAS_MOTOR_CURRENT_I2C 1
#endif
#if ENABLED(DUAL_X_CARRIAGE)
#ifndef INVERT_X2_DIR
#define INVERT_X2_DIR INVERT_X_DIR
#endif
#endif
// X2 but not IDEX => Dual Synchronized X Steppers
#if defined(X2_DRIVER_TYPE) && DISABLED(DUAL_X_CARRIAGE)
#define HAS_SYNCED_X_STEPPERS 1
#endif
// Y2 Stepper => Dual Synchronized Y Steppers
#ifdef Y2_DRIVER_TYPE
#define HAS_SYNCED_Y_STEPPERS 1
#endif
// Multiple Z steppers
#ifdef INVERT_Z_DIR
#if NUM_Z_STEPPERS >= 2 && !defined(INVERT_Z2_DIR)
#define INVERT_Z2_DIR INVERT_Z_DIR
#if NUM_Z_STEPPERS >= 3 && !defined(INVERT_Z3_DIR)
#define INVERT_Z3_DIR INVERT_Z_DIR
#if NUM_Z_STEPPERS >= 4 && !defined(INVERT_Z4_DIR)
#define INVERT_Z4_DIR INVERT_Z_DIR
#endif
#endif
#endif
#endif
#if NUM_Z_STEPPERS < 4
#undef INVERT_Z4_VS_Z_DIR
#if NUM_Z_STEPPERS < 3
#undef INVERT_Z3_VS_Z_DIR
#if NUM_Z_STEPPERS < 2
#undef INVERT_Z2_VS_Z_DIR
#endif
#endif
#endif
// Z Stepper Auto-align
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
#ifdef Z_STEPPER_ALIGN_STEPPER_XY
#define HAS_Z_STEPPER_ALIGN_STEPPER_XY 1
#undef Z_STEPPER_ALIGN_AMP
#endif
#ifndef Z_STEPPER_ALIGN_AMP
#define Z_STEPPER_ALIGN_AMP 1.0
#endif
#endif
//
// Spindle/Laser power display types
// Defined here so sanity checks can use them
//
#if ANY(SPINDLE_FEATURE, LASER_FEATURE)
#define HAS_CUTTER 1
#define _CUTTER_POWER_PWM255 1
#define _CUTTER_POWER_PERCENT 2
#define _CUTTER_POWER_RPM 3
#define _CUTTER_POWER(V) _CAT(_CUTTER_POWER_, V)
#define CUTTER_UNIT_IS(V) (_CUTTER_POWER(CUTTER_POWER_UNIT) == _CUTTER_POWER(V))
#endif
#if !defined(__AVR__) || !defined(USBCON)
// Define constants and variables for buffering serial data.
// Use only 0 or powers of 2 greater than 1
// : [0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...]
#ifndef RX_BUFFER_SIZE
#define RX_BUFFER_SIZE 128
#endif
// 256 is the max TX buffer limit due to uint8_t head and tail
// : [0, 4, 8, 16, 32, 64, 128, 256]
#ifndef TX_BUFFER_SIZE
#define TX_BUFFER_SIZE 32
#endif
#else
// SERIAL_XON_XOFF not supported on USB-native devices
#undef SERIAL_XON_XOFF
#endif
#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER)
#define HAS_GCODE_M876 1
#endif
#if ENABLED(HOST_ACTION_COMMANDS)
#ifndef ACTION_ON_PAUSE
#define ACTION_ON_PAUSE "pause"
#endif
#ifndef ACTION_ON_PAUSED
#define ACTION_ON_PAUSED "paused"
#endif
#ifndef ACTION_ON_RESUME
#define ACTION_ON_RESUME "resume"
#endif
#ifndef ACTION_ON_RESUMED
#define ACTION_ON_RESUMED "resumed"
#endif
#ifndef ACTION_ON_CANCEL
#define ACTION_ON_CANCEL "cancel"
#endif
#ifndef ACTION_ON_START
#define ACTION_ON_START "start"
#endif
#ifndef ACTION_ON_KILL
#define ACTION_ON_KILL "poweroff"
#endif
#ifndef SHUTDOWN_ACTION
#define SHUTDOWN_ACTION "shutdown"
#endif
#if HAS_FILAMENT_SENSOR
#ifndef ACTION_ON_FILAMENT_RUNOUT
#define ACTION_ON_FILAMENT_RUNOUT "filament_runout"
#endif
#ifndef ACTION_REASON_ON_FILAMENT_RUNOUT
#define ACTION_REASON_ON_FILAMENT_RUNOUT "filament_runout"
#endif
#endif
#if ENABLED(G29_RETRY_AND_RECOVER)
#ifndef ACTION_ON_G29_RECOVER
#define ACTION_ON_G29_RECOVER "probe_rewipe"
#endif
#ifndef ACTION_ON_G29_FAILURE
#define ACTION_ON_G29_FAILURE "probe_failed"
#endif
#endif
#endif
#if ANY(FYSETC_MINI_12864_2_1, FYSETC_242_OLED_12864)
#ifndef LED_USER_PRESET_GREEN
#define LED_USER_PRESET_GREEN 128
#endif
#ifndef LED_USER_PRESET_BLUE
#define LED_USER_PRESET_BLUE 0
#endif
#ifndef LED_USER_PRESET_BRIGHTNESS
#define LED_USER_PRESET_BRIGHTNESS 255
#endif
#endif
// Set defaults for unspecified LED user colors
#if ENABLED(LED_CONTROL_MENU)
#ifndef LED_USER_PRESET_RED
#define LED_USER_PRESET_RED 255
#endif
#ifndef LED_USER_PRESET_GREEN
#define LED_USER_PRESET_GREEN 255
#endif
#ifndef LED_USER_PRESET_BLUE
#define LED_USER_PRESET_BLUE 255
#endif
#ifndef LED_USER_PRESET_WHITE
#define LED_USER_PRESET_WHITE 0
#endif
#ifndef LED_USER_PRESET_BRIGHTNESS
#ifdef NEOPIXEL_BRIGHTNESS
#define LED_USER_PRESET_BRIGHTNESS NEOPIXEL_BRIGHTNESS
#else
#define LED_USER_PRESET_BRIGHTNESS 255
#endif
#endif
#endif
#if ALL(LED_CONTROL_MENU, NEOPIXEL2_SEPARATE)
#ifndef LED2_USER_PRESET_RED
#define LED2_USER_PRESET_RED 255
#endif
#ifndef LED2_USER_PRESET_GREEN
#define LED2_USER_PRESET_GREEN 255
#endif
#ifndef LED2_USER_PRESET_BLUE
#define LED2_USER_PRESET_BLUE 255
#endif
#ifndef LED2_USER_PRESET_WHITE
#define LED2_USER_PRESET_WHITE 0
#endif
#ifndef LED2_USER_PRESET_BRIGHTNESS
#ifdef NEOPIXEL2_BRIGHTNESS
#define LED2_USER_PRESET_BRIGHTNESS NEOPIXEL2_BRIGHTNESS
#else
#define LED2_USER_PRESET_BRIGHTNESS 255
#endif
#endif
#endif
// Full Touch Screen needs 'tft/xpt2046'
#if ANY(TFT_TOUCH_DEVICE_XPT2046, HAS_TFT_LVGL_UI)
#define HAS_TFT_XPT2046 1
#endif
// Touch Screen or "Touch Buttons" need XPT2046 pins
// but they use different components
#if HAS_TFT_XPT2046 || HAS_RES_TOUCH_BUTTONS
#define NEED_TOUCH_PINS 1
#endif
// Extensible UI pin mapping for RepRapDiscount
#if ENABLED(TOUCH_UI_FTDI_EVE) && ANY(AO_EXP1_PINMAP, AO_EXP2_PINMAP, CR10_TFT_PINMAP)
#define TOUCH_UI_ULTIPANEL 1
#endif
// Poll-based jogging for joystick and other devices
#if ENABLED(JOYSTICK)
#define POLL_JOG
#endif
#ifndef HOMING_BUMP_MM
#define HOMING_BUMP_MM { 0, 0, 0 }
#endif
#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && NONE(USE_OTG_USB_HOST, USE_UHS3_USB)
#define USE_UHS2_USB
#endif
/**
* Driver Timings (in nanoseconds)
* NOTE: Driver timing order is longest-to-shortest duration.
* Preserve this ordering when adding new drivers.
*/
#ifndef MINIMUM_STEPPER_POST_DIR_DELAY
#if HAS_DRIVER(TB6560)
#define MINIMUM_STEPPER_POST_DIR_DELAY 15000
#elif HAS_DRIVER(TB6600)
#define MINIMUM_STEPPER_POST_DIR_DELAY 1500
#elif HAS_DRIVER(DRV8825)
#define MINIMUM_STEPPER_POST_DIR_DELAY 650
#elif HAS_DRIVER(LV8729)
#define MINIMUM_STEPPER_POST_DIR_DELAY 500
#elif HAS_DRIVER(A5984)
#define MINIMUM_STEPPER_POST_DIR_DELAY 400
#elif HAS_DRIVER(A4988)
#define MINIMUM_STEPPER_POST_DIR_DELAY 200
#elif HAS_TRINAMIC_CONFIG || HAS_TRINAMIC_STANDALONE
#define MINIMUM_STEPPER_POST_DIR_DELAY 100
#else
#define MINIMUM_STEPPER_POST_DIR_DELAY 0 // Expect at least 10µS since one Stepper ISR must transpire
#endif
#endif
#ifndef MINIMUM_STEPPER_PRE_DIR_DELAY
#define MINIMUM_STEPPER_PRE_DIR_DELAY MINIMUM_STEPPER_POST_DIR_DELAY
#endif
#ifndef MINIMUM_STEPPER_PULSE
#if HAS_DRIVER(TB6560)
#define MINIMUM_STEPPER_PULSE 30
#elif HAS_DRIVER(TB6600)
#define MINIMUM_STEPPER_PULSE 3
#elif HAS_DRIVER(DRV8825)
#define MINIMUM_STEPPER_PULSE 2
#elif HAS_DRIVER(A4988) || HAS_DRIVER(A5984)
#define MINIMUM_STEPPER_PULSE 1
#elif HAS_TRINAMIC_CONFIG || HAS_TRINAMIC_STANDALONE
#define MINIMUM_STEPPER_PULSE 0
#elif HAS_DRIVER(LV8729)
#define MINIMUM_STEPPER_PULSE 0
#else
#define MINIMUM_STEPPER_PULSE 2
#endif
#endif
#ifndef MAXIMUM_STEPPER_RATE
#if HAS_DRIVER(TB6560)
#define MAXIMUM_STEPPER_RATE 15000
#elif HAS_DRIVER(TB6600)
#define MAXIMUM_STEPPER_RATE 150000
#elif HAS_DRIVER(DRV8825)
#define MAXIMUM_STEPPER_RATE 250000
#elif HAS_DRIVER(A4988)
#define MAXIMUM_STEPPER_RATE 500000
#elif HAS_DRIVER(LV8729)
#define MAXIMUM_STEPPER_RATE 1000000
#elif HAS_TRINAMIC_CONFIG || HAS_TRINAMIC_STANDALONE
#define MAXIMUM_STEPPER_RATE 5000000
#else
#define MAXIMUM_STEPPER_RATE 250000
#endif
#endif
// Test for edge stepping on any axis
#define AXIS_HAS_DEDGE(A) (ENABLED(EDGE_STEPPING) && AXIS_IS_TMC(A))
#if ENABLED(DIRECT_STEPPING)
#ifndef STEPPER_PAGES
#define STEPPER_PAGES 16
#endif
#ifndef STEPPER_PAGE_FORMAT
#define STEPPER_PAGE_FORMAT SP_4x2_256
#endif
#ifndef PAGE_MANAGER
#define PAGE_MANAGER SerialPageManager
#endif
#endif
#if defined(SAFE_BED_LEVELING_START_X) || defined(SAFE_BED_LEVELING_START_Y) || defined(SAFE_BED_LEVELING_START_Z) \
|| defined(SAFE_BED_LEVELING_START_I) || defined(SAFE_BED_LEVELING_START_J) || defined(SAFE_BED_LEVELING_START_K) \
|| defined(SAFE_BED_LEVELING_START_U) || defined(SAFE_BED_LEVELING_START_V) || defined(SAFE_BED_LEVELING_START_W)
#define HAS_SAFE_BED_LEVELING 1
#endif
//
// SD Card connection methods
// Defined here so pins and sanity checks can use them
//
#if HAS_MEDIA
#define _SDCARD_LCD 1
#define _SDCARD_ONBOARD 2
#define _SDCARD_CUSTOM_CABLE 3
#define _SDCARD_ID(V) _CAT(_SDCARD_, V)
#define SD_CONNECTION_IS(V) (_SDCARD_ID(SDCARD_CONNECTION) == _SDCARD_ID(V))
#else
#define SD_CONNECTION_IS(...) 0
#undef SD_ABORT_ON_ENDSTOP_HIT
#endif
// Power Monitor sensors
#if ANY(POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE)
#define HAS_POWER_MONITOR 1
#if ENABLED(POWER_MONITOR_CURRENT) && (ENABLED(POWER_MONITOR_VOLTAGE) || defined(POWER_MONITOR_FIXED_VOLTAGE))
#define HAS_POWER_MONITOR_WATTS 1
#endif
#endif
// Flag if an EEPROM type is pre-selected
#if ENABLED(EEPROM_SETTINGS) && NONE(I2C_EEPROM, SPI_EEPROM, QSPI_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION)
#define NO_EEPROM_SELECTED 1
#endif
// Flags for Case Light having a color property or a single pin
#if ENABLED(CASE_LIGHT_ENABLE)
#if ANY(CASE_LIGHT_USE_NEOPIXEL, CASE_LIGHT_USE_RGB_LED)
#define CASE_LIGHT_IS_COLOR_LED 1
#else
#define NEED_CASE_LIGHT_PIN 1
#endif
#endif
// Flags for Case Light having a brightness property
#if ENABLED(CASE_LIGHT_ENABLE) && (NONE(CASE_LIGHT_NO_BRIGHTNESS, CASE_LIGHT_IS_COLOR_LED) || ENABLED(CASE_LIGHT_USE_NEOPIXEL))
#define CASELIGHT_USES_BRIGHTNESS 1
#endif
// Flag whether least_squares_fit.cpp is used
#if ANY(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_LINEAR, HAS_Z_STEPPER_ALIGN_STEPPER_XY)
#define NEED_LSF 1
#endif
#if ALL(HAS_TFT_LVGL_UI, CUSTOM_MENU_MAIN)
#define _HAS_1(N) (defined(MAIN_MENU_ITEM_##N##_DESC) && defined(MAIN_MENU_ITEM_##N##_GCODE))
#define HAS_USER_ITEM(V...) DO(HAS,||,V)
#else
#define HAS_USER_ITEM(...) 0
#endif
/**
* LCD_SERIAL_PORT must be defined ahead of HAL.h and
* currently HAL.h must be included ahead of pins.h.
*/
#if LCD_IS_SERIAL_HOST && !defined(LCD_SERIAL_PORT)
#if MB(MKS_MONSTER8_V1, BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_MINI_E3_V3_0_1, BTT_SKR_E3_TURBO, BTT_OCTOPUS_V1_1, AQUILA_V101)
#define LCD_SERIAL_PORT 1
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_F401RE, CREALITY_V423, CREALITY_CR4NTXXC10, MKS_ROBIN, PANOWIN_CUTLASS, KODAMA_BARDO)
#define LCD_SERIAL_PORT 2
#else
#define LCD_SERIAL_PORT 3
#endif
#ifdef LCD_SERIAL_PORT
#define AUTO_ASSIGNED_LCD_SERIAL 1
#endif
#endif
#if !HAS_MULTI_SERIAL
#undef MEATPACK_ON_SERIAL_PORT_2
#endif
#if ANY(MEATPACK_ON_SERIAL_PORT_1, MEATPACK_ON_SERIAL_PORT_2)
#define HAS_MEATPACK 1
#endif
// AVR are (usually) too limited in resources to store the configuration into the binary
#if ENABLED(CONFIGURATION_EMBEDDING) && !defined(FORCE_CONFIG_EMBED) && (defined(__AVR__) || !HAS_MEDIA || ANY(SDCARD_READONLY, DISABLE_M503))
#undef CONFIGURATION_EMBEDDING
#define CANNOT_EMBED_CONFIGURATION defined(__AVR__)
#endif
// Input shaping
#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y)
#define HAS_ZV_SHAPING 1
#endif
// FT Motion unified window and batch size
#if ALL(FT_MOTION, FTM_UNIFIED_BWS)
#define FTM_WINDOW_SIZE FTM_BW_SIZE
#define FTM_BATCH_SIZE FTM_BW_SIZE
#endif
// Toolchange Event G-code
#if !HAS_MULTI_EXTRUDER || !(defined(EVENT_GCODE_TOOLCHANGE_T0) || defined(EVENT_GCODE_TOOLCHANGE_T1) || defined(EVENT_GCODE_TOOLCHANGE_T2) || defined(EVENT_GCODE_TOOLCHANGE_T3) || defined(EVENT_GCODE_TOOLCHANGE_T4) || defined(EVENT_GCODE_TOOLCHANGE_T5) || defined(EVENT_GCODE_TOOLCHANGE_T6) || defined(EVENT_GCODE_TOOLCHANGE_T7))
#undef TC_GCODE_USE_GLOBAL_X
#undef TC_GCODE_USE_GLOBAL_Y
#undef TC_GCODE_USE_GLOBAL_Z
#endif
// TOOLCHANGE_MIGRATION_FEATURE - Clean up after sloppy auto config
#if DISABLED(TOOLCHANGE_MIGRATION_FEATURE)
#undef MIGRATION_ZRAISE
#undef MIGRATION_FS_EXTRA_PRIME
#undef MIGRATION_FS_WIPE_RETRACT
#undef MIGRATION_FS_FAN_SPEED
#undef MIGRATION_FS_FAN_TIME
#undef TOOLCHANGE_MIGRATION_DO_PARK
#endif
// TOOLCHANGE_PARK - Clean up after sloppy auto config
#if DISABLED(TOOLCHANGE_PARK)
#undef TOOLCHANGE_PARK_XY
#undef TOOLCHANGE_PARK_XY_FEEDRATE
#undef TOOLCHANGE_PARK_X_ONLY
#undef TOOLCHANGE_PARK_Y_ONLY
#undef TOOLCHANGE_MIGRATION_DO_PARK
#endif
// Multi-Stepping Limit
#ifndef MULTISTEPPING_LIMIT
#define MULTISTEPPING_LIMIT 128
#define MULTISTEPPING_LIMIT_WARNING 1
#endif
// One redundant cooling fan by default
#if defined(REDUNDANT_PART_COOLING_FAN) && !defined(NUM_REDUNDANT_FANS)
#define NUM_REDUNDANT_FANS 1
#endif
// Clean up if only mm units are used
#if DISABLED(INCH_MODE_SUPPORT)
#undef MANUAL_MOVE_DISTANCE_IN
#endif
// Clean up if no rotational axes exist
#if !HAS_ROTATIONAL_AXES
#undef MANUAL_MOVE_DISTANCE_DEG
#endif
// Power-Loss Recovery
#if ENABLED(POWER_LOSS_RECOVERY)
#ifdef PLR_BED_THRESHOLD
#define HAS_PLR_BED_THRESHOLD 1
#endif
#if ANY(DWIN_CREALITY_LCD, DWIN_LCD_PROUI)
#define HAS_PLR_UI_FLAG 1 // recovery.ui_flag_resume
#endif
#endif
|
2301_81045437/Marlin
|
Marlin/src/inc/Conditionals_adv.h
|
C
|
agpl-3.0
| 43,166
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#pragma once
/**
* Conditionals_post.h
* Internal defines that depend on Configurations and Pins but are not user-editable.
*/
#ifdef GITHUB_ACTIONS
// Extras for CI testing
#endif
// Arduino IDE with Teensy Additions
#ifdef TEENSYDUINO
#undef max
#define max(a,b) ((a)>(b)?(a):(b))
#undef min
#define min(a,b) ((a)<(b)?(a):(b))
#undef NOT_A_PIN // Override Teensyduino legacy CapSense define work-around
#define NOT_A_PIN 0 // For PINS_DEBUGGING
#endif
// ADC
#ifdef BOARD_ADC_VREF_MV
#define ADC_VREF_MV BOARD_ADC_VREF_MV
#else
#define ADC_VREF_MV HAL_ADC_VREF_MV
#endif
// Determine which type of 'EEPROM' is in use
#if ENABLED(EEPROM_SETTINGS)
// EEPROM type may be defined by compile flags, configs, HALs, or pins
// Set additional flags to let HALs choose in their Conditionals_post.h
#if ANY(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION, QSPI_EEPROM)
#define USE_EMULATED_EEPROM 1
#elif ANY(I2C_EEPROM, SPI_EEPROM)
#define USE_WIRED_EEPROM 1
#elif ENABLED(IIC_BL24CXX_EEPROM)
// nothing
#else
#define USE_FALLBACK_EEPROM 1
#endif
#else
#undef I2C_EEPROM
#undef SPI_EEPROM
#undef QSPI_EEPROM
#undef SDCARD_EEPROM_EMULATION
#undef SRAM_EEPROM_EMULATION
#undef FLASH_EEPROM_EMULATION
#undef IIC_BL24CXX_EEPROM
#endif
#if DISABLED(IIC_BL24CXX_EEPROM)
#undef OTA_FIRMWARE_UPDATE
#endif
/**
* Axis lengths and center
*/
#if HAS_I_AXIS && !defined(AXIS4_NAME)
#define AXIS4_NAME 'A'
#endif
#if HAS_J_AXIS && !defined(AXIS5_NAME)
#define AXIS5_NAME 'B'
#endif
#if HAS_K_AXIS && !defined(AXIS6_NAME)
#define AXIS6_NAME 'C'
#endif
#if HAS_U_AXIS && !defined(AXIS7_NAME)
#define AXIS7_NAME 'U'
#endif
#if HAS_V_AXIS && !defined(AXIS8_NAME)
#define AXIS8_NAME 'V'
#endif
#if HAS_W_AXIS && !defined(AXIS9_NAME)
#define AXIS9_NAME 'W'
#endif
#if HAS_X_AXIS
#define X_MAX_LENGTH (X_MAX_POS - (X_MIN_POS))
#endif
#if HAS_Y_AXIS
#define Y_MAX_LENGTH (Y_MAX_POS - (Y_MIN_POS))
#endif
#if HAS_Z_AXIS
#define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS))
#else
#undef CONTROLLER_FAN_USE_Z_ONLY
#endif
#if HAS_I_AXIS
#define I_MAX_LENGTH (I_MAX_POS - (I_MIN_POS))
#endif
#if HAS_J_AXIS
#define J_MAX_LENGTH (J_MAX_POS - (J_MIN_POS))
#endif
#if HAS_K_AXIS
#define K_MAX_LENGTH (K_MAX_POS - (K_MIN_POS))
#endif
#if HAS_U_AXIS
#define U_MAX_LENGTH (U_MAX_POS - (U_MIN_POS))
#endif
#if HAS_V_AXIS
#define V_MAX_LENGTH (V_MAX_POS - (V_MIN_POS))
#endif
#if HAS_W_AXIS
#define W_MAX_LENGTH (W_MAX_POS - (W_MIN_POS))
#endif
// Defined only if the sanity-check is bypassed
#if HAS_X_AXIS && !defined(X_BED_SIZE)
#define X_BED_SIZE X_MAX_LENGTH
#endif
#if HAS_Y_AXIS && !defined(Y_BED_SIZE)
#define Y_BED_SIZE Y_MAX_LENGTH
#endif
#if HAS_I_AXIS && !defined(I_BED_SIZE)
#define I_BED_SIZE I_MAX_LENGTH
#endif
#if HAS_J_AXIS && !defined(J_BED_SIZE)
#define J_BED_SIZE J_MAX_LENGTH
#endif
#if HAS_K_AXIS && !defined(K_BED_SIZE)
#define K_BED_SIZE K_MAX_LENGTH
#endif
#if HAS_U_AXIS && !defined(U_BED_SIZE)
#define U_BED_SIZE U_MAX_LENGTH
#endif
#if HAS_V_AXIS && !defined(V_BED_SIZE)
#define V_BED_SIZE V_MAX_LENGTH
#endif
#if HAS_W_AXIS && !defined(W_BED_SIZE)
#define W_BED_SIZE W_MAX_LENGTH
#endif
// Require 0,0 bed center for Delta, SCARA, and Polargraph
#if IS_KINEMATIC
#define BED_CENTER_AT_0_0
#endif
// Define center values for future use
#if HAS_X_AXIS
#define _X_HALF_BED ((X_BED_SIZE) / 2)
#endif
#if HAS_Y_AXIS
#define _Y_HALF_BED ((Y_BED_SIZE) / 2)
#endif
#if HAS_I_AXIS
#define _I_HALF_IMAX ((I_BED_SIZE) / 2)
#endif
#if HAS_J_AXIS
#define _J_HALF_JMAX ((J_BED_SIZE) / 2)
#endif
#if HAS_K_AXIS
#define _K_HALF_KMAX ((K_BED_SIZE) / 2)
#endif
#if HAS_U_AXIS
#define _U_HALF_UMAX ((U_BED_SIZE) / 2)
#endif
#if HAS_V_AXIS
#define _V_HALF_VMAX ((V_BED_SIZE) / 2)
#endif
#if HAS_W_AXIS
#define _W_HALF_WMAX ((W_BED_SIZE) / 2)
#endif
#if HAS_X_AXIS
#define X_CENTER TERN(BED_CENTER_AT_0_0, 0, _X_HALF_BED)
#endif
#if HAS_Y_AXIS
#define Y_CENTER TERN(BED_CENTER_AT_0_0, 0, _Y_HALF_BED)
#define XY_CENTER { X_CENTER, Y_CENTER }
#endif
#if HAS_I_AXIS
#define I_CENTER _I_HALF_BED
#endif
#if HAS_J_AXIS
#define J_CENTER _J_HALF_BED
#endif
#if HAS_K_AXIS
#define K_CENTER _K_HALF_BED
#endif
#if HAS_U_AXIS
#define U_CENTER _U_HALF_BED
#endif
#if HAS_V_AXIS
#define V_CENTER _V_HALF_BED
#endif
#if HAS_W_AXIS
#define W_CENTER _W_HALF_BED
#endif
// Get the linear boundaries of the bed
#if HAS_X_AXIS
#define X_MIN_BED (X_CENTER - _X_HALF_BED)
#define X_MAX_BED (X_MIN_BED + X_BED_SIZE)
#endif
#if HAS_Y_AXIS
#define Y_MIN_BED (Y_CENTER - _Y_HALF_BED)
#define Y_MAX_BED (Y_MIN_BED + Y_BED_SIZE)
#endif
#if HAS_I_AXIS
#define I_MINIM (I_CENTER - _I_HALF_BED_SIZE)
#define I_MAXIM (I_MINIM + I_BED_SIZE)
#endif
#if HAS_J_AXIS
#define J_MINIM (J_CENTER - _J_HALF_BED_SIZE)
#define J_MAXIM (J_MINIM + J_BED_SIZE)
#endif
#if HAS_K_AXIS
#define K_MINIM (K_CENTER - _K_HALF_BED_SIZE)
#define K_MAXIM (K_MINIM + K_BED_SIZE)
#endif
#if HAS_U_AXIS
#define U_MINIM (U_CENTER - _U_HALF_BED_SIZE)
#define U_MAXIM (U_MINIM + U_BED_SIZE)
#endif
#if HAS_V_AXIS
#define V_MINIM (V_CENTER - _V_HALF_BED_SIZE)
#define V_MAXIM (V_MINIM + V_BED_SIZE)
#endif
#if HAS_W_AXIS
#define W_MINIM (W_CENTER - _W_HALF_BED_SIZE)
#define W_MAXIM (W_MINIM + W_BED_SIZE)
#endif
/**
* Dual X Carriage
*/
#if ENABLED(DUAL_X_CARRIAGE)
#ifndef X1_MIN_POS
#define X1_MIN_POS X_MIN_POS
#endif
#ifndef X1_MAX_POS
#define X1_MAX_POS X_BED_SIZE
#endif
#endif
// Calibration codes only for non-core axes
#if ANY(BACKLASH_GCODE, CALIBRATION_GCODE)
#if ANY(IS_CORE, MARKFORGED_XY, MARKFORGED_YX)
#define CAN_CALIBRATE(A,B) TERN0(HAS_##A##_AXIS, (_AXIS(A) == B))
#else
#define CAN_CALIBRATE(A,B) ENABLED(HAS_##A##_AXIS)
#endif
#define AXIS_CAN_CALIBRATE(A) CAN_CALIBRATE(A,NORMAL_AXIS)
#else
#define AXIS_CAN_CALIBRATE(A) false
#endif
/**
* No adjustable bed on non-cartesians
*/
#if IS_KINEMATIC
#undef LCD_BED_TRAMMING
#undef SLOWDOWN
#endif
/**
* SCARA cannot use SLOWDOWN and requires QUICKHOME
* Printable radius assumes joints can fully extend
*/
#if IS_SCARA
#if ENABLED(AXEL_TPARA)
#define PRINTABLE_RADIUS (TPARA_LINKAGE_1 + TPARA_LINKAGE_2)
#else
#define QUICK_HOME
#define PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2)
#endif
#endif
/**
* Set the home position based on settings or manual overrides
*/
#if HAS_X_AXIS
#ifdef MANUAL_X_HOME_POS
#define X_HOME_POS MANUAL_X_HOME_POS
#else
#define X_END_POS TERN(X_HOME_TO_MIN, X_MIN_POS, X_MAX_POS)
#if ENABLED(BED_CENTER_AT_0_0)
#define X_HOME_POS TERN(DELTA, 0, X_END_POS)
#else
#define X_HOME_POS TERN(DELTA, X_MIN_POS + (X_BED_SIZE) * 0.5, X_END_POS)
#endif
#endif
#endif
#if HAS_Y_AXIS
#ifdef MANUAL_Y_HOME_POS
#define Y_HOME_POS MANUAL_Y_HOME_POS
#else
#define Y_END_POS TERN(Y_HOME_TO_MIN, Y_MIN_POS, Y_MAX_POS)
#if ENABLED(BED_CENTER_AT_0_0)
#define Y_HOME_POS TERN(DELTA, 0, Y_END_POS)
#else
#define Y_HOME_POS TERN(DELTA, Y_MIN_POS + (Y_BED_SIZE) * 0.5, Y_END_POS)
#endif
#endif
#endif
#ifdef MANUAL_Z_HOME_POS
#define Z_HOME_POS MANUAL_Z_HOME_POS
#else
#define Z_HOME_POS TERN(Z_HOME_TO_MIN, Z_MIN_POS, Z_MAX_POS)
#endif
#if HAS_I_AXIS
#ifdef MANUAL_I_HOME_POS
#define I_HOME_POS MANUAL_I_HOME_POS
#else
#define I_HOME_POS TERN(I_HOME_TO_MIN, I_MIN_POS, I_MAX_POS)
#endif
#endif
#if HAS_J_AXIS
#ifdef MANUAL_J_HOME_POS
#define J_HOME_POS MANUAL_J_HOME_POS
#else
#define J_HOME_POS TERN(J_HOME_TO_MIN, J_MIN_POS, J_MAX_POS)
#endif
#endif
#if HAS_K_AXIS
#ifdef MANUAL_K_HOME_POS
#define K_HOME_POS MANUAL_K_HOME_POS
#else
#define K_HOME_POS TERN(K_HOME_TO_MIN, K_MIN_POS, K_MAX_POS)
#endif
#endif
#if HAS_U_AXIS
#ifdef MANUAL_U_HOME_POS
#define U_HOME_POS MANUAL_U_HOME_POS
#else
#define U_HOME_POS TERN(U_HOME_TO_MIN, U_MIN_POS, U_MAX_POS)
#endif
#endif
#if HAS_V_AXIS
#ifdef MANUAL_V_HOME_POS
#define V_HOME_POS MANUAL_V_HOME_POS
#else
#define V_HOME_POS TERN(V_HOME_TO_MIN, V_MIN_POS, V_MAX_POS)
#endif
#endif
#if HAS_W_AXIS
#ifdef MANUAL_W_HOME_POS
#define W_HOME_POS MANUAL_W_HOME_POS
#else
#define W_HOME_POS TERN(W_HOME_TO_MIN, W_MIN_POS, W_MAX_POS)
#endif
#endif
/**
* If DELTA_HEIGHT isn't defined use the old setting
*/
#if ENABLED(DELTA) && !defined(DELTA_HEIGHT)
#define DELTA_HEIGHT Z_HOME_POS
#endif
/**
* Z Sled Probe requires Z_SAFE_HOMING
*/
#if ENABLED(Z_PROBE_SLED)
#define Z_SAFE_HOMING
#endif
/**
* DELTA should ignore Z_SAFE_HOMING and SLOWDOWN
*/
#if ENABLED(DELTA)
#undef Z_SAFE_HOMING
#endif
#ifndef MESH_INSET
#define MESH_INSET 0
#endif
/**
* Safe Homing Options
*/
#if ENABLED(Z_SAFE_HOMING)
#if ENABLED(AUTO_BED_LEVELING_UBL)
// Home close to center so grid points have z heights very close to 0
#define _SAFE_POINT(A) (((GRID_MAX_POINTS_##A) / 2) * (A##_BED_SIZE - 2 * (MESH_INSET)) / (GRID_MAX_POINTS_##A - 1) + MESH_INSET)
#else
#define _SAFE_POINT(A) A##_CENTER
#endif
#ifndef Z_SAFE_HOMING_X_POINT
#define Z_SAFE_HOMING_X_POINT _SAFE_POINT(X)
#endif
#ifndef Z_SAFE_HOMING_Y_POINT
#define Z_SAFE_HOMING_Y_POINT _SAFE_POINT(Y)
#endif
#endif
#ifdef GRID_MAX_POINTS_X
#define GRID_MAX_CELLS_X (GRID_MAX_POINTS_X - 1)
#define GRID_MAX_CELLS_Y (GRID_MAX_POINTS_Y - 1)
#endif
/**
* Host keep alive
*/
#ifndef DEFAULT_KEEPALIVE_INTERVAL
#define DEFAULT_KEEPALIVE_INTERVAL 2
#endif
/**
* Provide a MAX_AUTORETRACT for older configs
*/
#if ENABLED(FWRETRACT) && !defined(MAX_AUTORETRACT)
#define MAX_AUTORETRACT 99
#endif
/**
* Provide a DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT in case NO_VOLUMETRICS is enabled
*/
#ifndef DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT
#define DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT 0.00
#endif
/**
* LCD Contrast for Graphical Displays
*/
#if ENABLED(CARTESIO_UI)
#define _LCD_CONTRAST_MIN 60
#define _LCD_CONTRAST_INIT 90
#define _LCD_CONTRAST_MAX 140
#elif ENABLED(miniVIKI)
#define _LCD_CONTRAST_MIN 75
#define _LCD_CONTRAST_INIT 95
#define _LCD_CONTRAST_MAX 115
#elif ENABLED(VIKI2)
#define _LCD_CONTRAST_INIT 140
#elif ENABLED(WYH_L12864)
#define _LCD_CONTRAST_INIT 190
#elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
#define _LCD_CONTRAST_MIN 90
#define _LCD_CONTRAST_INIT 110
#define _LCD_CONTRAST_MAX 130
#elif ENABLED(AZSMZ_12864)
#define _LCD_CONTRAST_MIN 120
#define _LCD_CONTRAST_INIT 190
#elif ANY(MKS_LCD12864A, MKS_LCD12864B)
#define _LCD_CONTRAST_MIN 120
#define _LCD_CONTRAST_INIT 205
#elif ANY(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
#define _LCD_CONTRAST_MIN 120
#define _LCD_CONTRAST_INIT 195
#elif ENABLED(FYSETC_MINI_12864_2_1)
#define _LCD_CONTRAST_MIN 230
#define _LCD_CONTRAST_INIT 255
#elif ENABLED(FYSETC_MINI_12864)
#define _LCD_CONTRAST_MIN 180
#define _LCD_CONTRAST_INIT 220
#elif ENABLED(ULTI_CONTROLLER)
#define _LCD_CONTRAST_INIT 127
#define _LCD_CONTRAST_MAX 254
#elif ENABLED(MAKRPANEL)
#define _LCD_CONTRAST_INIT 17
#elif ENABLED(MINIPANEL)
#define _LCD_CONTRAST_INIT 150
#elif ENABLED(ZONESTAR_12864OLED)
#define _LCD_CONTRAST_MIN 64
#define _LCD_CONTRAST_INIT 128
#elif ENABLED(EMOTION_TECH_LCD)
#define _LCD_CONTRAST_INIT 140
#elif IS_TFTGLCD_PANEL
#define _LCD_CONTRAST_INIT 250
#endif
#ifdef _LCD_CONTRAST_INIT
#define HAS_LCD_CONTRAST 1
#ifndef LCD_CONTRAST_MIN
#ifdef _LCD_CONTRAST_MIN
#define LCD_CONTRAST_MIN _LCD_CONTRAST_MIN
#else
#define LCD_CONTRAST_MIN 0
#endif
#endif
#ifndef LCD_CONTRAST_INIT
#define LCD_CONTRAST_INIT _LCD_CONTRAST_INIT
#endif
#ifndef LCD_CONTRAST_MAX
#ifdef _LCD_CONTRAST_MAX
#define LCD_CONTRAST_MAX _LCD_CONTRAST_MAX
#elif _LCD_CONTRAST_INIT > 63
#define LCD_CONTRAST_MAX 255
#else
#define LCD_CONTRAST_MAX 63 // ST7567 6-bits contrast
#endif
#endif
#ifndef LCD_CONTRAST_DEFAULT
#define LCD_CONTRAST_DEFAULT LCD_CONTRAST_INIT
#endif
#endif
/**
* Override the SD_DETECT_STATE set in Configuration_adv.h
* and enable sharing of onboard SD host drives (all platforms but AGCM4)
*/
#if HAS_MEDIA
#if HAS_SD_HOST_DRIVE && SD_CONNECTION_IS(ONBOARD) && DISABLED(KEEP_SD_DETECT)
//
// The external SD card is not used. Hardware SPI is used to access the card.
// When sharing the SD card with a PC we want the menu options to
// mount/unmount the card and refresh it. So we disable card detect.
//
#undef SD_DETECT_PIN
#define HAS_SHARED_MEDIA 1
#endif
// Extender cable doesn't support SD_DETECT_PIN
#if ENABLED(NO_SD_DETECT)
#undef SD_DETECT_PIN
#endif
// Not onboard or custom cable
#if SD_CONNECTION_IS(LCD) || !defined(SDCARD_CONNECTION)
#define SD_CONNECTION_TYPICAL 1
#endif
// Set SD_DETECT_STATE based on hardware if not overridden
#if PIN_EXISTS(SD_DETECT)
#define HAS_SD_DETECT 1
#ifndef SD_DETECT_STATE
#if ALL(SD_CONNECTION_TYPICAL, HAS_MARLINUI_MENU, ELB_FULL_GRAPHIC_CONTROLLER)
#define SD_DETECT_STATE HIGH
#else
#define SD_DETECT_STATE LOW
#endif
#endif
#endif
#if DISABLED(USB_FLASH_DRIVE_SUPPORT) || ALL(MULTI_VOLUME, VOLUME_SD_ONBOARD)
#if ENABLED(ONBOARD_SDIO)
#define NEED_SD2CARD_SDIO 1
#else
#define NEED_SD2CARD_SPI 1
#endif
#endif
#if HAS_SD_DETECT && NONE(HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, HAS_FSMC_GRAPHICAL_TFT, HAS_SPI_GRAPHICAL_TFT, IS_DWIN_MARLINUI, EXTENSIBLE_UI, HAS_DWIN_E3V2)
#define REINIT_NOISY_LCD 1 // Have the LCD re-init on SD insertion
#endif
#endif // HAS_MEDIA
/**
* Power Supply
*/
#ifndef PSU_NAME
#if DISABLED(PSU_CONTROL)
#define PSU_NAME "Generic" // No control
#elif PSU_ACTIVE_STATE
#define PSU_NAME "XBox" // X-Box 360 (203W)
#else
#define PSU_NAME "ATX" // ATX style
#endif
#endif
#if ENABLED(PSU_CONTROL)
#ifndef PSU_POWERUP_DELAY
#define PSU_POWERUP_DELAY 250
#endif
#ifndef POWER_OFF_DELAY
#define POWER_OFF_DELAY 0
#endif
#endif
/**
* Temp Sensor defines; set up pins as needed.
*/
// Usurp a sensor to do redundant readings
#if TEMP_SENSOR_REDUNDANT
#ifndef TEMP_SENSOR_REDUNDANT_SOURCE
#define TEMP_SENSOR_REDUNDANT_SOURCE E1
#endif
#ifndef TEMP_SENSOR_REDUNDANT_TARGET
#define TEMP_SENSOR_REDUNDANT_TARGET E0
#endif
#if !PIN_EXISTS(TEMP_REDUNDANT)
#ifndef TEMP_SENSOR_REDUNDANT_MAX_DIFF
#define TEMP_SENSOR_REDUNDANT_MAX_DIFF 10
#endif
#if REDUNDANT_TEMP_MATCH(SOURCE, BOARD)
#if !PIN_EXISTS(TEMP_BOARD)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to BOARD requires TEMP_BOARD_PIN."
#else
#define TEMP_REDUNDANT_PIN TEMP_BOARD_PIN
#endif
#elif REDUNDANT_TEMP_MATCH(SOURCE, COOLER)
#if !PIN_EXISTS(TEMP_COOLER)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to COOLER requires TEMP_COOLER_PIN."
#else
#define TEMP_REDUNDANT_PIN TEMP_COOLER_PIN
#endif
#elif REDUNDANT_TEMP_MATCH(SOURCE, PROBE)
#if !PIN_EXISTS(TEMP_PROBE)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to PROBE requires TEMP_PROBE_PIN."
#else
#define TEMP_REDUNDANT_PIN TEMP_PROBE_PIN
#endif
#elif REDUNDANT_TEMP_MATCH(SOURCE, CHAMBER)
#if !PIN_EXISTS(TEMP_CHAMBER)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to CHAMBER requires TEMP_CHAMBER_PIN."
#else
#define TEMP_REDUNDANT_PIN TEMP_CHAMBER_PIN
#endif
#elif REDUNDANT_TEMP_MATCH(SOURCE, BED)
#if !PIN_EXISTS(TEMP_BED)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to BED requires TEMP_BED_PIN."
#else
#define TEMP_REDUNDANT_PIN TEMP_BED_PIN
#endif
#elif REDUNDANT_TEMP_MATCH(SOURCE, E0)
#if !PIN_EXISTS(TEMP_0)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to E0 requires TEMP_0_PIN."
#else
#define TEMP_REDUNDANT_PIN TEMP_0_PIN
#endif
#elif REDUNDANT_TEMP_MATCH(SOURCE, E1)
#if !PIN_EXISTS(TEMP_1)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to E1 requires TEMP_1_PIN."
#else
#define TEMP_REDUNDANT_PIN TEMP_1_PIN
#endif
#elif REDUNDANT_TEMP_MATCH(SOURCE, E2)
#if !PIN_EXISTS(TEMP_2)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to E2 requires TEMP_2_PIN."
#else
#define TEMP_REDUNDANT_PIN TEMP_2_PIN
#endif
#elif REDUNDANT_TEMP_MATCH(SOURCE, E3)
#if !PIN_EXISTS(TEMP_3)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to E3 requires TEMP_3_PIN."
#else
#define TEMP_REDUNDANT_PIN TEMP_3_PIN
#endif
#elif REDUNDANT_TEMP_MATCH(SOURCE, E4)
#if !PIN_EXISTS(TEMP_4)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to E4 requires TEMP_4_PIN."
#else
#define TEMP_REDUNDANT_PIN TEMP_4_PIN
#endif
#elif REDUNDANT_TEMP_MATCH(SOURCE, E5)
#if !PIN_EXISTS(TEMP_5)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to E5 requires TEMP_5_PIN."
#else
#define TEMP_REDUNDANT_PIN TEMP_5_PIN
#endif
#elif REDUNDANT_TEMP_MATCH(SOURCE, E6)
#if !PIN_EXISTS(TEMP_6)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to E6 requires TEMP_6_PIN."
#else
#define TEMP_REDUNDANT_PIN TEMP_6_PIN
#endif
#elif REDUNDANT_TEMP_MATCH(SOURCE, E7)
#if !PIN_EXISTS(TEMP_7)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to E7 requires TEMP_7_PIN."
#else
#define TEMP_REDUNDANT_PIN TEMP_7_PIN
#endif
#endif
#endif
#endif
/**
* Compatibility layer for MAX (SPI) temp boards
*/
#define TEMP_SENSOR_IS_ANY_MAX_TC(n) (TEMP_SENSOR_IS_MAX_TC(n) || (TEMP_SENSOR_IS_MAX_TC(REDUNDANT) && REDUNDANT_TEMP_MATCH(SOURCE, E##n)))
#if HAS_MAX_TC
// Software SPI - enable if MISO/SCK are defined.
#if TEMP_SENSOR_IS_ANY_MAX_TC(0) && DISABLED(TEMP_SENSOR_0_FORCE_HW_SPI) && PINS_EXIST(TEMP_0_MISO, TEMP_0_SCK)
#if TEMP_SENSOR_0_IS_MAX31865 && !PIN_EXISTS(TEMP_0_MOSI)
#error "TEMP_SENSOR_0 MAX31865 requires TEMP_0_MOSI_PIN defined for Software SPI. To use Hardware SPI instead, undefine MISO/SCK or enable TEMP_SENSOR_0_FORCE_HW_SPI."
#else
#define TEMP_SENSOR_0_HAS_SPI_PINS 1
#endif
#endif
#if TEMP_SENSOR_IS_ANY_MAX_TC(1) && DISABLED(TEMP_SENSOR_1_FORCE_HW_SPI) && PINS_EXIST(TEMP_1_MISO, TEMP_1_SCK)
#if TEMP_SENSOR_1_IS_MAX31865 && !PIN_EXISTS(TEMP_1_MOSI)
#error "TEMP_SENSOR_1 MAX31865 requires TEMP_1_MOSI_PIN defined for Software SPI. To use Hardware SPI instead, undefine MISO/SCK or enable TEMP_SENSOR_1_FORCE_HW_SPI."
#else
#define TEMP_SENSOR_1_HAS_SPI_PINS 1
#endif
#endif
#if TEMP_SENSOR_IS_ANY_MAX_TC(2) && DISABLED(TEMP_SENSOR_2_FORCE_HW_SPI) && PINS_EXIST(TEMP_2_MISO, TEMP_2_SCK)
#if TEMP_SENSOR_2_IS_MAX31865 && !PIN_EXISTS(TEMP_2_MOSI)
#error "TEMP_SENSOR_2 MAX31865 requires TEMP_2_MOSI_PIN defined for Software SPI. To use Hardware SPI instead, undefine MISO/SCK or enable TEMP_SENSOR_2_FORCE_HW_SPI."
#else
#define TEMP_SENSOR_2_HAS_SPI_PINS 1
#endif
#endif
#if (TEMP_SENSOR_IS_MAX_TC(BED)) && DISABLED(TEMP_SENSOR_BED_FORCE_HW_SPI) && PINS_EXIST(TEMP_BED_MISO, TEMP_BED_SCK)
#if TEMP_SENSOR_BED_IS_MAX31865 && !PIN_EXISTS(TEMP_BED_MOSI)
#error "TEMP_SENSOR_BED MAX31865 requires TEMP_BED_MOSI_PIN defined for Software SPI. To use Hardware SPI instead, undefine MISO/SCK or enable TEMP_SENSOR_BED_FORCE_HW_SPI."
#else
#define TEMP_SENSOR_BED_HAS_SPI_PINS 1
#endif
#endif
//
// User-defined thermocouple libraries
//
// Add LIB_MAX6675 / LIB_MAX31855 / LIB_MAX31865 to the build_flags
// to select a USER library for MAX6675, MAX31855, MAX31865
//
#if ALL(HAS_MAX6675, LIB_MAX6675)
#define USE_LIB_MAX6675 1
#endif
#if ALL(HAS_MAX31855, LIB_MAX31855)
#define USE_ADAFRUIT_MAX31855 1
#endif
#if ALL(HAS_MAX31865, LIB_MAX31865)
#define USE_ADAFRUIT_MAX31865 1
#elif HAS_MAX31865
#define LIB_INTERNAL_MAX31865 1
#endif
#endif // HAS_MAX_TC
/**
* X_DUAL_ENDSTOPS endstop reassignment
*/
#if ENABLED(X_DUAL_ENDSTOPS)
#if X_HOME_TO_MAX
#ifndef X2_MAX_ENDSTOP_HIT_STATE
#if X2_STOP_PIN == X_MIN_PIN
#define X2_MAX_ENDSTOP_HIT_STATE X_MIN_ENDSTOP_HIT_STATE
#elif X2_STOP_PIN == X_MAX_PIN
#define X2_MAX_ENDSTOP_HIT_STATE X_MAX_ENDSTOP_HIT_STATE
#elif X2_STOP_PIN == Y_MIN_PIN
#define X2_MAX_ENDSTOP_HIT_STATE Y_MIN_ENDSTOP_HIT_STATE
#elif X2_STOP_PIN == Y_MAX_PIN
#define X2_MAX_ENDSTOP_HIT_STATE Y_MAX_ENDSTOP_HIT_STATE
#elif X2_STOP_PIN == Z_MIN_PIN
#define X2_MAX_ENDSTOP_HIT_STATE Z_MIN_ENDSTOP_HIT_STATE
#elif X2_STOP_PIN == Z_MAX_PIN
#define X2_MAX_ENDSTOP_HIT_STATE Z_MAX_ENDSTOP_HIT_STATE
#endif
#endif
#if !PIN_EXISTS(X2_MAX)
#undef X2_MAX_PIN
#if PIN_EXISTS(X2_STOP)
#define X2_MAX_PIN X2_STOP_PIN
#endif
#endif
#else
#ifndef X2_MIN_ENDSTOP_HIT_STATE
#if X2_STOP_PIN == X_MIN_PIN
#define X2_MIN_ENDSTOP_HIT_STATE X_MIN_ENDSTOP_HIT_STATE
#elif X2_STOP_PIN == X_MAX_PIN
#define X2_MIN_ENDSTOP_HIT_STATE X_MAX_ENDSTOP_HIT_STATE
#elif X2_STOP_PIN == Y_MIN_PIN
#define X2_MIN_ENDSTOP_HIT_STATE Y_MIN_ENDSTOP_HIT_STATE
#elif X2_STOP_PIN == Y_MAX_PIN
#define X2_MIN_ENDSTOP_HIT_STATE Y_MAX_ENDSTOP_HIT_STATE
#elif X2_STOP_PIN == Z_MIN_PIN
#define X2_MIN_ENDSTOP_HIT_STATE Z_MIN_ENDSTOP_HIT_STATE
#elif X2_STOP_PIN == Z_MAX_PIN
#define X2_MIN_ENDSTOP_HIT_STATE Z_MAX_ENDSTOP_HIT_STATE
#endif
#endif
#if !PIN_EXISTS(X2_MIN)
#undef X2_MIN_PIN
#if PIN_EXISTS(X2_STOP)
#define X2_MIN_PIN X2_STOP_PIN
#endif
#endif
#endif
#ifndef X2_MAX_ENDSTOP_HIT_STATE
#define X2_MAX_ENDSTOP_HIT_STATE HIGH
#endif
#ifndef X2_MIN_ENDSTOP_HIT_STATE
#define X2_MIN_ENDSTOP_HIT_STATE HIGH
#endif
#endif
/**
* Y_DUAL_ENDSTOPS endstop reassignment
*/
#if ENABLED(Y_DUAL_ENDSTOPS)
#if Y_HOME_TO_MAX
#ifndef Y2_MAX_ENDSTOP_HIT_STATE
#if Y2_STOP_PIN == X_MIN_PIN
#define Y2_MAX_ENDSTOP_HIT_STATE X_MIN_ENDSTOP_HIT_STATE
#elif Y2_STOP_PIN == X_MAX_PIN
#define Y2_MAX_ENDSTOP_HIT_STATE X_MAX_ENDSTOP_HIT_STATE
#elif Y2_STOP_PIN == Y_MIN_PIN
#define Y2_MAX_ENDSTOP_HIT_STATE Y_MIN_ENDSTOP_HIT_STATE
#elif Y2_STOP_PIN == Y_MAX_PIN
#define Y2_MAX_ENDSTOP_HIT_STATE Y_MAX_ENDSTOP_HIT_STATE
#elif Y2_STOP_PIN == Z_MIN_PIN
#define Y2_MAX_ENDSTOP_HIT_STATE Z_MIN_ENDSTOP_HIT_STATE
#elif Y2_STOP_PIN == Z_MAX_PIN
#define Y2_MAX_ENDSTOP_HIT_STATE Z_MAX_ENDSTOP_HIT_STATE
#endif
#endif
#if !PIN_EXISTS(Y2_MAX)
#undef Y2_MAX_PIN
#if PIN_EXISTS(Y2_STOP)
#define Y2_MAX_PIN Y2_STOP_PIN
#endif
#endif
#else
#ifndef Y2_MIN_ENDSTOP_HIT_STATE
#if Y2_STOP_PIN == X_MIN_PIN
#define Y2_MIN_ENDSTOP_HIT_STATE X_MIN_ENDSTOP_HIT_STATE
#elif Y2_STOP_PIN == X_MAX_PIN
#define Y2_MIN_ENDSTOP_HIT_STATE X_MAX_ENDSTOP_HIT_STATE
#elif Y2_STOP_PIN == Y_MIN_PIN
#define Y2_MIN_ENDSTOP_HIT_STATE Y_MIN_ENDSTOP_HIT_STATE
#elif Y2_STOP_PIN == Y_MAX_PIN
#define Y2_MIN_ENDSTOP_HIT_STATE Y_MAX_ENDSTOP_HIT_STATE
#elif Y2_STOP_PIN == Z_MIN_PIN
#define Y2_MIN_ENDSTOP_HIT_STATE Z_MIN_ENDSTOP_HIT_STATE
#elif Y2_STOP_PIN == Z_MAX_PIN
#define Y2_MIN_ENDSTOP_HIT_STATE Z_MAX_ENDSTOP_HIT_STATE
#endif
#endif
#if !PIN_EXISTS(Y2_MIN)
#undef Y2_MIN_PIN
#if PIN_EXISTS(Y2_STOP)
#define Y2_MIN_PIN Y2_STOP_PIN
#endif
#endif
#endif
#ifndef Y2_MAX_ENDSTOP_HIT_STATE
#define Y2_MAX_ENDSTOP_HIT_STATE HIGH
#endif
#ifndef Y2_MIN_ENDSTOP_HIT_STATE
#define Y2_MIN_ENDSTOP_HIT_STATE HIGH
#endif
#endif
/**
* Z_MULTI_ENDSTOPS endstop reassignment
*/
#if ENABLED(Z_MULTI_ENDSTOPS)
#if Z_HOME_TO_MAX
#ifndef Z2_MAX_ENDSTOP_HIT_STATE
#if Z2_STOP_PIN == X_MIN_PIN
#define Z2_MAX_ENDSTOP_HIT_STATE X_MIN_ENDSTOP_HIT_STATE
#elif Z2_STOP_PIN == X_MAX_PIN
#define Z2_MAX_ENDSTOP_HIT_STATE X_MAX_ENDSTOP_HIT_STATE
#elif Z2_STOP_PIN == Y_MIN_PIN
#define Z2_MAX_ENDSTOP_HIT_STATE Y_MIN_ENDSTOP_HIT_STATE
#elif Z2_STOP_PIN == Y_MAX_PIN
#define Z2_MAX_ENDSTOP_HIT_STATE Y_MAX_ENDSTOP_HIT_STATE
#elif Z2_STOP_PIN == Z_MIN_PIN
#define Z2_MAX_ENDSTOP_HIT_STATE Z_MIN_ENDSTOP_HIT_STATE
#elif Z2_STOP_PIN == Z_MAX_PIN
#define Z2_MAX_ENDSTOP_HIT_STATE Z_MAX_ENDSTOP_HIT_STATE
#endif
#endif
#if !PIN_EXISTS(Z2_MAX)
#undef Z2_MAX_PIN
#if PIN_EXISTS(Z2_STOP)
#define Z2_MAX_PIN Z2_STOP_PIN
#endif
#endif
#else
#ifndef Z2_MIN_ENDSTOP_HIT_STATE
#if Z2_STOP_PIN == X_MIN_PIN
#define Z2_MIN_ENDSTOP_HIT_STATE X_MIN_ENDSTOP_HIT_STATE
#elif Z2_STOP_PIN == X_MAX_PIN
#define Z2_MIN_ENDSTOP_HIT_STATE X_MAX_ENDSTOP_HIT_STATE
#elif Z2_STOP_PIN == Y_MIN_PIN
#define Z2_MIN_ENDSTOP_HIT_STATE Y_MIN_ENDSTOP_HIT_STATE
#elif Z2_STOP_PIN == Y_MAX_PIN
#define Z2_MIN_ENDSTOP_HIT_STATE Y_MAX_ENDSTOP_HIT_STATE
#elif Z2_STOP_PIN == Z_MIN_PIN
#define Z2_MIN_ENDSTOP_HIT_STATE Z_MIN_ENDSTOP_HIT_STATE
#elif Z2_STOP_PIN == Z_MAX_PIN
#define Z2_MIN_ENDSTOP_HIT_STATE Z_MAX_ENDSTOP_HIT_STATE
#endif
#endif
#if !PIN_EXISTS(Z2_MIN)
#undef Z2_MIN_PIN
#if PIN_EXISTS(Z2_STOP)
#define Z2_MIN_PIN Z2_STOP_PIN
#endif
#endif
#endif
#ifndef Z2_MAX_ENDSTOP_HIT_STATE
#define Z2_MAX_ENDSTOP_HIT_STATE HIGH
#endif
#ifndef Z2_MIN_ENDSTOP_HIT_STATE
#define Z2_MIN_ENDSTOP_HIT_STATE HIGH
#endif
#if NUM_Z_STEPPERS >= 3
#if Z_HOME_TO_MAX
#ifndef Z3_MAX_ENDSTOP_HIT_STATE
#if Z3_STOP_PIN == X_MIN_PIN
#define Z3_MAX_ENDSTOP_HIT_STATE X_MIN_ENDSTOP_HIT_STATE
#elif Z3_STOP_PIN == X_MAX_PIN
#define Z3_MAX_ENDSTOP_HIT_STATE X_MAX_ENDSTOP_HIT_STATE
#elif Z3_STOP_PIN == Y_MIN_PIN
#define Z3_MAX_ENDSTOP_HIT_STATE Y_MIN_ENDSTOP_HIT_STATE
#elif Z3_STOP_PIN == Y_MAX_PIN
#define Z3_MAX_ENDSTOP_HIT_STATE Y_MAX_ENDSTOP_HIT_STATE
#elif Z3_STOP_PIN == Z_MIN_PIN
#define Z3_MAX_ENDSTOP_HIT_STATE Z_MIN_ENDSTOP_HIT_STATE
#elif Z3_STOP_PIN == Z_MAX_PIN
#define Z3_MAX_ENDSTOP_HIT_STATE Z_MAX_ENDSTOP_HIT_STATE
#endif
#endif
#if !PIN_EXISTS(Z3_MAX)
#undef Z3_MAX_PIN
#if PIN_EXISTS(Z3_STOP)
#define Z3_MAX_PIN Z3_STOP_PIN
#endif
#endif
#else
#ifndef Z3_MIN_ENDSTOP_HIT_STATE
#if Z3_STOP_PIN == X_MIN_PIN
#define Z3_MIN_ENDSTOP_HIT_STATE X_MIN_ENDSTOP_HIT_STATE
#elif Z3_STOP_PIN == X_MAX_PIN
#define Z3_MIN_ENDSTOP_HIT_STATE X_MAX_ENDSTOP_HIT_STATE
#elif Z3_STOP_PIN == Y_MIN_PIN
#define Z3_MIN_ENDSTOP_HIT_STATE Y_MIN_ENDSTOP_HIT_STATE
#elif Z3_STOP_PIN == Y_MAX_PIN
#define Z3_MIN_ENDSTOP_HIT_STATE Y_MAX_ENDSTOP_HIT_STATE
#elif Z3_STOP_PIN == Z_MIN_PIN
#define Z3_MIN_ENDSTOP_HIT_STATE Z_MIN_ENDSTOP_HIT_STATE
#elif Z3_STOP_PIN == Z_MAX_PIN
#define Z3_MIN_ENDSTOP_HIT_STATE Z_MAX_ENDSTOP_HIT_STATE
#endif
#endif
#if !PIN_EXISTS(Z3_MIN)
#undef Z3_MIN_PIN
#if PIN_EXISTS(Z3_STOP)
#define Z3_MIN_PIN Z3_STOP_PIN
#endif
#endif
#endif
#ifndef Z3_MAX_ENDSTOP_HIT_STATE
#define Z3_MAX_ENDSTOP_HIT_STATE HIGH
#endif
#ifndef Z3_MIN_ENDSTOP_HIT_STATE
#define Z3_MIN_ENDSTOP_HIT_STATE HIGH
#endif
#endif
#if NUM_Z_STEPPERS >= 4
#if Z_HOME_TO_MAX
#ifndef Z4_MAX_ENDSTOP_HIT_STATE
#if Z4_STOP_PIN == X_MIN_PIN
#define Z4_MAX_ENDSTOP_HIT_STATE X_MIN_ENDSTOP_HIT_STATE
#elif Z4_STOP_PIN == X_MAX_PIN
#define Z4_MAX_ENDSTOP_HIT_STATE X_MAX_ENDSTOP_HIT_STATE
#elif Z4_STOP_PIN == Y_MIN_PIN
#define Z4_MAX_ENDSTOP_HIT_STATE Y_MIN_ENDSTOP_HIT_STATE
#elif Z4_STOP_PIN == Y_MAX_PIN
#define Z4_MAX_ENDSTOP_HIT_STATE Y_MAX_ENDSTOP_HIT_STATE
#elif Z4_STOP_PIN == Z_MIN_PIN
#define Z4_MAX_ENDSTOP_HIT_STATE Z_MIN_ENDSTOP_HIT_STATE
#elif Z4_STOP_PIN == Z_MAX_PIN
#define Z4_MAX_ENDSTOP_HIT_STATE Z_MAX_ENDSTOP_HIT_STATE
#endif
#endif
#if !PIN_EXISTS(Z4_MAX)
#undef Z4_MAX_PIN
#if PIN_EXISTS(Z4_STOP)
#define Z4_MAX_PIN Z4_STOP_PIN
#endif
#endif
#else
#ifndef Z4_MIN_ENDSTOP_HIT_STATE
#if Z4_STOP_PIN == X_MIN_PIN
#define Z4_MIN_ENDSTOP_HIT_STATE X_MIN_ENDSTOP_HIT_STATE
#elif Z4_STOP_PIN == X_MAX_PIN
#define Z4_MIN_ENDSTOP_HIT_STATE X_MAX_ENDSTOP_HIT_STATE
#elif Z4_STOP_PIN == Y_MIN_PIN
#define Z4_MIN_ENDSTOP_HIT_STATE Y_MIN_ENDSTOP_HIT_STATE
#elif Z4_STOP_PIN == Y_MAX_PIN
#define Z4_MIN_ENDSTOP_HIT_STATE Y_MAX_ENDSTOP_HIT_STATE
#elif Z4_STOP_PIN == Z_MIN_PIN
#define Z4_MIN_ENDSTOP_HIT_STATE Z_MIN_ENDSTOP_HIT_STATE
#elif Z4_STOP_PIN == Z_MAX_PIN
#define Z4_MIN_ENDSTOP_HIT_STATE Z_MAX_ENDSTOP_HIT_STATE
#endif
#endif
#if !PIN_EXISTS(Z4_MIN)
#undef Z4_MIN_PIN
#if PIN_EXISTS(Z4_STOP)
#define Z4_MIN_PIN Z4_STOP_PIN
#endif
#endif
#endif
#ifndef Z4_MAX_ENDSTOP_HIT_STATE
#define Z4_MAX_ENDSTOP_HIT_STATE HIGH
#endif
#ifndef Z4_MIN_ENDSTOP_HIT_STATE
#define Z4_MIN_ENDSTOP_HIT_STATE HIGH
#endif
#endif
#endif // Z_MULTI_ENDSTOPS
/**
* Shorthand for pin tests, used wherever needed
*/
// Steppers
#if HAS_X_AXIS
#if PIN_EXISTS(X_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X))
#define HAS_X_ENABLE 1
#endif
#if PIN_EXISTS(X_DIR)
#define HAS_X_DIR 1
#endif
#if PIN_EXISTS(X_STEP)
#define HAS_X_STEP 1
#endif
#if PIN_EXISTS(X_MS1)
#define HAS_X_MS_PINS 1
#endif
#if PIN_EXISTS(X2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2))
#define HAS_X2_ENABLE 1
#endif
#if PIN_EXISTS(X2_DIR)
#define HAS_X2_DIR 1
#endif
#if PIN_EXISTS(X2_STEP)
#define HAS_X2_STEP 1
#endif
#if PIN_EXISTS(X2_MS1)
#define HAS_X2_MS_PINS 1
#endif
#endif
/**
* Set defaults for missing (newer) options
*/
#if HAS_Y_AXIS
#if PIN_EXISTS(Y_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y))
#define HAS_Y_ENABLE 1
#endif
#if PIN_EXISTS(Y_DIR)
#define HAS_Y_DIR 1
#endif
#if PIN_EXISTS(Y_STEP)
#define HAS_Y_STEP 1
#endif
#if PIN_EXISTS(Y_MS1)
#define HAS_Y_MS_PINS 1
#endif
#if HAS_Y2_STEPPER
#if PIN_EXISTS(Y2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2))
#define HAS_Y2_ENABLE 1
#endif
#if PIN_EXISTS(Y2_DIR)
#define HAS_Y2_DIR 1
#endif
#if PIN_EXISTS(Y2_STEP)
#define HAS_Y2_STEP 1
#endif
#if PIN_EXISTS(Y2_MS1)
#define HAS_Y2_MS_PINS 1
#endif
#endif
#endif
#if HAS_Z_AXIS
#if PIN_EXISTS(Z_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z))
#define HAS_Z_ENABLE 1
#endif
#if PIN_EXISTS(Z_DIR)
#define HAS_Z_DIR 1
#endif
#if PIN_EXISTS(Z_STEP)
#define HAS_Z_STEP 1
#endif
#if PIN_EXISTS(Z_MS1)
#define HAS_Z_MS_PINS 1
#endif
#endif
#if NUM_Z_STEPPERS >= 2
#if PIN_EXISTS(Z2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2))
#define HAS_Z2_ENABLE 1
#endif
#if PIN_EXISTS(Z2_DIR)
#define HAS_Z2_DIR 1
#endif
#if PIN_EXISTS(Z2_STEP)
#define HAS_Z2_STEP 1
#endif
#if PIN_EXISTS(Z2_MS1)
#define HAS_Z2_MS_PINS 1
#endif
#endif
#if NUM_Z_STEPPERS >= 3
#if PIN_EXISTS(Z3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3))
#define HAS_Z3_ENABLE 1
#endif
#if PIN_EXISTS(Z3_DIR)
#define HAS_Z3_DIR 1
#endif
#if PIN_EXISTS(Z3_STEP)
#define HAS_Z3_STEP 1
#endif
#if PIN_EXISTS(Z3_MS1)
#define HAS_Z3_MS_PINS 1
#endif
#endif
#if NUM_Z_STEPPERS >= 4
#if PIN_EXISTS(Z4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4))
#define HAS_Z4_ENABLE 1
#endif
#if PIN_EXISTS(Z4_DIR)
#define HAS_Z4_DIR 1
#endif
#if PIN_EXISTS(Z4_STEP)
#define HAS_Z4_STEP 1
#endif
#if PIN_EXISTS(Z4_MS1)
#define HAS_Z4_MS_PINS 1
#endif
#endif
#if HAS_I_AXIS
#if PIN_EXISTS(I_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(I))
#define HAS_I_ENABLE 1
#endif
#if PIN_EXISTS(I_DIR)
#define HAS_I_DIR 1
#endif
#if PIN_EXISTS(I_STEP)
#define HAS_I_STEP 1
#endif
#if PIN_EXISTS(I_MS1)
#define HAS_I_MS_PINS 1
#endif
#endif
#if HAS_J_AXIS
#if PIN_EXISTS(J_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(J))
#define HAS_J_ENABLE 1
#endif
#if PIN_EXISTS(J_DIR)
#define HAS_J_DIR 1
#endif
#if PIN_EXISTS(J_STEP)
#define HAS_J_STEP 1
#endif
#if PIN_EXISTS(J_MS1)
#define HAS_J_MS_PINS 1
#endif
#endif
#if HAS_K_AXIS
#if PIN_EXISTS(K_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(K))
#define HAS_K_ENABLE 1
#endif
#if PIN_EXISTS(K_DIR)
#define HAS_K_DIR 1
#endif
#if PIN_EXISTS(K_STEP)
#define HAS_K_STEP 1
#endif
#if PIN_EXISTS(K_MS1)
#define HAS_K_MS_PINS 1
#endif
#endif
#if HAS_U_AXIS
#if PIN_EXISTS(U_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(U))
#define HAS_U_ENABLE 1
#endif
#if PIN_EXISTS(U_DIR)
#define HAS_U_DIR 1
#endif
#if PIN_EXISTS(U_STEP)
#define HAS_U_STEP 1
#endif
#if PIN_EXISTS(U_MS1)
#define HAS_U_MS_PINS 1
#endif
#endif
#if HAS_V_AXIS
#if PIN_EXISTS(V_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(V))
#define HAS_V_ENABLE 1
#endif
#if PIN_EXISTS(V_DIR)
#define HAS_V_DIR 1
#endif
#if PIN_EXISTS(V_STEP)
#define HAS_V_STEP 1
#endif
#if PIN_EXISTS(V_MS1)
#define HAS_V_MS_PINS 1
#endif
#endif
#if HAS_W_AXIS
#if PIN_EXISTS(W_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(W))
#define HAS_W_ENABLE 1
#endif
#if PIN_EXISTS(W_DIR)
#define HAS_W_DIR 1
#endif
#if PIN_EXISTS(W_STEP)
#define HAS_W_STEP 1
#endif
#if PIN_EXISTS(W_MS1)
#define HAS_W_MS_PINS 1
#endif
#endif
// Extruder steppers and solenoids
#if HAS_EXTRUDERS
#if PIN_EXISTS(E0_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0))
#define HAS_E0_ENABLE 1
#endif
#if PIN_EXISTS(E0_DIR)
#define HAS_E0_DIR 1
#endif
#if PIN_EXISTS(E0_STEP)
#define HAS_E0_STEP 1
#endif
#if PIN_EXISTS(E0_MS1)
#define HAS_E0_MS_PINS 1
#endif
#if E_STEPPERS > 1 || ENABLED(E_DUAL_STEPPER_DRIVERS)
#if PIN_EXISTS(E1_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1))
#define HAS_E1_ENABLE 1
#endif
#if PIN_EXISTS(E1_DIR)
#define HAS_E1_DIR 1
#endif
#if PIN_EXISTS(E1_STEP)
#define HAS_E1_STEP 1
#endif
#if PIN_EXISTS(E1_MS1)
#define HAS_E1_MS_PINS 1
#endif
#endif
#if E_STEPPERS > 2
#if PIN_EXISTS(E2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2))
#define HAS_E2_ENABLE 1
#endif
#if PIN_EXISTS(E2_DIR)
#define HAS_E2_DIR 1
#endif
#if PIN_EXISTS(E2_STEP)
#define HAS_E2_STEP 1
#endif
#if PIN_EXISTS(E2_MS1)
#define HAS_E2_MS_PINS 1
#endif
#endif
#if E_STEPPERS > 3
#if PIN_EXISTS(E3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3))
#define HAS_E3_ENABLE 1
#endif
#if PIN_EXISTS(E3_DIR)
#define HAS_E3_DIR 1
#endif
#if PIN_EXISTS(E3_STEP)
#define HAS_E3_STEP 1
#endif
#if PIN_EXISTS(E3_MS1)
#define HAS_E3_MS_PINS 1
#endif
#endif
#if E_STEPPERS > 4
#if PIN_EXISTS(E4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4))
#define HAS_E4_ENABLE 1
#endif
#if PIN_EXISTS(E4_DIR)
#define HAS_E4_DIR 1
#endif
#if PIN_EXISTS(E4_STEP)
#define HAS_E4_STEP 1
#endif
#if PIN_EXISTS(E4_MS1)
#define HAS_E4_MS_PINS 1
#endif
#endif
#if E_STEPPERS > 5
#if PIN_EXISTS(E5_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5))
#define HAS_E5_ENABLE 1
#endif
#if PIN_EXISTS(E5_DIR)
#define HAS_E5_DIR 1
#endif
#if PIN_EXISTS(E5_STEP)
#define HAS_E5_STEP 1
#endif
#if PIN_EXISTS(E5_MS1)
#define HAS_E5_MS_PINS 1
#endif
#endif
#if E_STEPPERS > 6
#if PIN_EXISTS(E6_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6))
#define HAS_E6_ENABLE 1
#endif
#if PIN_EXISTS(E6_DIR)
#define HAS_E6_DIR 1
#endif
#if PIN_EXISTS(E6_STEP)
#define HAS_E6_STEP 1
#endif
#if PIN_EXISTS(E6_MS1)
#define HAS_E6_MS_PINS 1
#endif
#endif
#if E_STEPPERS > 7
#if PIN_EXISTS(E7_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7))
#define HAS_E7_ENABLE 1
#endif
#if PIN_EXISTS(E7_DIR)
#define HAS_E7_DIR 1
#endif
#if PIN_EXISTS(E7_STEP)
#define HAS_E7_STEP 1
#endif
#if PIN_EXISTS(E7_MS1)
#define HAS_E7_MS_PINS 1
#endif
#endif
#endif // HAS_EXTRUDERS
/**
* Set solenoid flags if any features use solenoids
* - EXT_SOLENOID (M380, M381) to enable/disable the extruder solenoid
* - MANUAL_SOLENOID_CONTROL (M380, M381) to enable/disable solenoids by index
* - PARKING_EXTRUDER uses SOL0_PIN and SOL1_PIN
* - SOLENOID_PROBE uses SOL1_PIN
* - Z_PROBE_SLED uses SOL1_PIN, when defined (unless EXT_SOLENOID is enabled)
*/
#if ANY(EXT_SOLENOID, MANUAL_SOLENOID_CONTROL, PARKING_EXTRUDER, SOLENOID_PROBE, Z_PROBE_SLED)
#if PIN_EXISTS(SOL0) && (ANY(MANUAL_SOLENOID_CONTROL, PARKING_EXTRUDER) || ALL(EXT_SOLENOID, HAS_EXTRUDERS))
#define HAS_SOLENOID_0 1
#endif
#if PIN_EXISTS(SOL1) && (ANY(MANUAL_SOLENOID_CONTROL, PARKING_EXTRUDER, SOLENOID_PROBE, Z_PROBE_SLED) || TERN0(EXT_SOLENOID, E_STEPPERS > 1))
#define HAS_SOLENOID_1 1
#endif
#if PIN_EXISTS(SOL2) && (ENABLED(MANUAL_SOLENOID_CONTROL) || TERN0(EXT_SOLENOID, E_STEPPERS > 2))
#define HAS_SOLENOID_2 2
#endif
#if PIN_EXISTS(SOL3) && (ENABLED(MANUAL_SOLENOID_CONTROL) || TERN0(EXT_SOLENOID, E_STEPPERS > 3))
#define HAS_SOLENOID_3 3
#endif
#if PIN_EXISTS(SOL4) && (ENABLED(MANUAL_SOLENOID_CONTROL) || TERN0(EXT_SOLENOID, E_STEPPERS > 4))
#define HAS_SOLENOID_4 4
#endif
#if PIN_EXISTS(SOL5) && (ENABLED(MANUAL_SOLENOID_CONTROL) || TERN0(EXT_SOLENOID, E_STEPPERS > 5))
#define HAS_SOLENOID_5 5
#endif
#if PIN_EXISTS(SOL6) && (ENABLED(MANUAL_SOLENOID_CONTROL) || TERN0(EXT_SOLENOID, E_STEPPERS > 6))
#define HAS_SOLENOID_6 6
#endif
#if PIN_EXISTS(SOL7) && (ENABLED(MANUAL_SOLENOID_CONTROL) || TERN0(EXT_SOLENOID, E_STEPPERS > 7))
#define HAS_SOLENOID_7 7
#endif
#endif
//
// Trinamic Stepper Drivers
//
#if HAS_TRINAMIC_CONFIG
#if ANY(STEALTHCHOP_E, STEALTHCHOP_XY, STEALTHCHOP_Z, STEALTHCHOP_I, STEALTHCHOP_J, STEALTHCHOP_K, STEALTHCHOP_U, STEALTHCHOP_V, STEALTHCHOP_W)
#define STEALTHCHOP_ENABLED 1
#endif
#if ANY(SENSORLESS_HOMING, SENSORLESS_PROBING)
#define USE_SENSORLESS 1
#endif
// Disable Z axis sensorless homing if a probe is used to home the Z axis
#if HOMING_Z_WITH_PROBE
#undef Z_STALL_SENSITIVITY
#undef Z2_STALL_SENSITIVITY
#undef Z3_STALL_SENSITIVITY
#undef Z4_STALL_SENSITIVITY
#endif
#if AXIS_IS_TMC(X)
#if defined(X_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(X)
#define X_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(X)
#define X_SPI_SENSORLESS 1
#endif
#endif
#if AXIS_HAS_STEALTHCHOP(X)
#define X_HAS_STEALTHCHOP 1
#endif
#ifndef X_INTERPOLATE
#define X_INTERPOLATE INTERPOLATE
#endif
#ifndef X_HOLD_MULTIPLIER
#define X_HOLD_MULTIPLIER HOLD_MULTIPLIER
#endif
#ifndef X_SLAVE_ADDRESS
#define X_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(X2)
#if defined(X2_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(X2)
#define X2_SENSORLESS 1
#endif
#if AXIS_HAS_STEALTHCHOP(X2)
#define X2_HAS_STEALTHCHOP 1
#endif
#ifndef X2_INTERPOLATE
#define X2_INTERPOLATE X_INTERPOLATE
#endif
#ifndef X2_HOLD_MULTIPLIER
#define X2_HOLD_MULTIPLIER X_HOLD_MULTIPLIER
#endif
#ifndef X2_SLAVE_ADDRESS
#define X2_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(Y)
#if defined(Y_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y)
#define Y_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(Y)
#define Y_SPI_SENSORLESS 1
#endif
#endif
#if AXIS_HAS_STEALTHCHOP(Y)
#define Y_HAS_STEALTHCHOP 1
#endif
#ifndef Y_INTERPOLATE
#define Y_INTERPOLATE INTERPOLATE
#endif
#ifndef Y_HOLD_MULTIPLIER
#define Y_HOLD_MULTIPLIER HOLD_MULTIPLIER
#endif
#ifndef Y_SLAVE_ADDRESS
#define Y_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(Y2)
#if defined(Y2_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y2)
#define Y2_SENSORLESS 1
#endif
#if AXIS_HAS_STEALTHCHOP(Y2)
#define Y2_HAS_STEALTHCHOP 1
#endif
#ifndef Y2_INTERPOLATE
#define Y2_INTERPOLATE Y_INTERPOLATE
#endif
#ifndef Y2_HOLD_MULTIPLIER
#define Y2_HOLD_MULTIPLIER Y_HOLD_MULTIPLIER
#endif
#ifndef Y2_SLAVE_ADDRESS
#define Y2_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(Z)
#if defined(Z_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z)
#define Z_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(Z)
#define Z_SPI_SENSORLESS 1
#endif
#endif
#if AXIS_HAS_STEALTHCHOP(Z)
#define Z_HAS_STEALTHCHOP 1
#endif
#ifndef Z_INTERPOLATE
#define Z_INTERPOLATE INTERPOLATE
#endif
#ifndef Z_HOLD_MULTIPLIER
#define Z_HOLD_MULTIPLIER HOLD_MULTIPLIER
#endif
#ifndef Z_SLAVE_ADDRESS
#define Z_SLAVE_ADDRESS 0
#endif
#endif
#if NUM_Z_STEPPERS >= 2 && AXIS_IS_TMC(Z2)
#if defined(Z2_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z2)
#define Z2_SENSORLESS 1
#endif
#if AXIS_HAS_STEALTHCHOP(Z2)
#define Z2_HAS_STEALTHCHOP 1
#endif
#ifndef Z2_INTERPOLATE
#define Z2_INTERPOLATE Z_INTERPOLATE
#endif
#ifndef Z2_HOLD_MULTIPLIER
#define Z2_HOLD_MULTIPLIER Z_HOLD_MULTIPLIER
#endif
#ifndef Z2_SLAVE_ADDRESS
#define Z2_SLAVE_ADDRESS 0
#endif
#endif
#if NUM_Z_STEPPERS >= 3 && AXIS_IS_TMC(Z3)
#if defined(Z3_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z3)
#define Z3_SENSORLESS 1
#endif
#if AXIS_HAS_STEALTHCHOP(Z3)
#define Z3_HAS_STEALTHCHOP 1
#endif
#ifndef Z3_INTERPOLATE
#define Z3_INTERPOLATE Z_INTERPOLATE
#endif
#ifndef Z3_HOLD_MULTIPLIER
#define Z3_HOLD_MULTIPLIER Z_HOLD_MULTIPLIER
#endif
#ifndef Z3_SLAVE_ADDRESS
#define Z3_SLAVE_ADDRESS 0
#endif
#endif
#if NUM_Z_STEPPERS >= 4 && AXIS_IS_TMC(Z4)
#if defined(Z4_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z4)
#define Z4_SENSORLESS 1
#endif
#if AXIS_HAS_STEALTHCHOP(Z4)
#define Z4_HAS_STEALTHCHOP 1
#endif
#ifndef Z4_INTERPOLATE
#define Z4_INTERPOLATE Z_INTERPOLATE
#endif
#ifndef Z4_HOLD_MULTIPLIER
#define Z4_HOLD_MULTIPLIER Z_HOLD_MULTIPLIER
#endif
#ifndef Z4_SLAVE_ADDRESS
#define Z4_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(I)
#if defined(I_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(I)
#define I_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(I)
#define I_SPI_SENSORLESS 1
#endif
#endif
#if AXIS_HAS_STEALTHCHOP(I)
#define I_HAS_STEALTHCHOP 1
#endif
#ifndef I_INTERPOLATE
#define I_INTERPOLATE INTERPOLATE
#endif
#ifndef I_HOLD_MULTIPLIER
#define I_HOLD_MULTIPLIER HOLD_MULTIPLIER
#endif
#ifndef I_SLAVE_ADDRESS
#define I_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(J)
#if defined(J_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(J)
#define J_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(J)
#define J_SPI_SENSORLESS 1
#endif
#endif
#if AXIS_HAS_STEALTHCHOP(J)
#define J_HAS_STEALTHCHOP 1
#endif
#ifndef J_INTERPOLATE
#define J_INTERPOLATE INTERPOLATE
#endif
#ifndef J_HOLD_MULTIPLIER
#define J_HOLD_MULTIPLIER HOLD_MULTIPLIER
#endif
#ifndef J_SLAVE_ADDRESS
#define J_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(K)
#if defined(K_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(K)
#define K_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(K)
#define K_SPI_SENSORLESS 1
#endif
#endif
#if AXIS_HAS_STEALTHCHOP(K)
#define K_HAS_STEALTHCHOP 1
#endif
#ifndef K_INTERPOLATE
#define K_INTERPOLATE INTERPOLATE
#endif
#ifndef K_HOLD_MULTIPLIER
#define K_HOLD_MULTIPLIER HOLD_MULTIPLIER
#endif
#ifndef K_SLAVE_ADDRESS
#define K_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(U)
#if defined(U_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(U)
#define U_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(U)
#define U_SPI_SENSORLESS 1
#endif
#endif
#if AXIS_HAS_STEALTHCHOP(U)
#define U_HAS_STEALTHCHOP 1
#endif
#ifndef U_INTERPOLATE
#define U_INTERPOLATE INTERPOLATE
#endif
#ifndef U_HOLD_MULTIPLIER
#define U_HOLD_MULTIPLIER HOLD_MULTIPLIER
#endif
#ifndef U_SLAVE_ADDRESS
#define U_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(V)
#if defined(V_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(V)
#define V_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(V)
#define V_SPI_SENSORLESS 1
#endif
#endif
#if AXIS_HAS_STEALTHCHOP(V)
#define V_HAS_STEALTHCHOP 1
#endif
#ifndef V_INTERPOLATE
#define V_INTERPOLATE INTERPOLATE
#endif
#ifndef V_HOLD_MULTIPLIER
#define V_HOLD_MULTIPLIER HOLD_MULTIPLIER
#endif
#ifndef V_SLAVE_ADDRESS
#define V_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(W)
#if defined(W_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(W)
#define W_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(W)
#define W_SPI_SENSORLESS 1
#endif
#endif
#if AXIS_HAS_STEALTHCHOP(W)
#define W_HAS_STEALTHCHOP 1
#endif
#ifndef W_INTERPOLATE
#define W_INTERPOLATE INTERPOLATE
#endif
#ifndef W_HOLD_MULTIPLIER
#define W_HOLD_MULTIPLIER HOLD_MULTIPLIER
#endif
#ifndef W_SLAVE_ADDRESS
#define W_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(E0)
#if AXIS_HAS_STEALTHCHOP(E0)
#define E0_HAS_STEALTHCHOP 1
#endif
#ifndef E0_INTERPOLATE
#define E0_INTERPOLATE INTERPOLATE
#endif
#ifndef E0_HOLD_MULTIPLIER
#define E0_HOLD_MULTIPLIER HOLD_MULTIPLIER
#endif
#ifndef E0_SLAVE_ADDRESS
#define E0_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(E1)
#if AXIS_HAS_STEALTHCHOP(E1)
#define E1_HAS_STEALTHCHOP 1
#endif
#ifndef E1_INTERPOLATE
#define E1_INTERPOLATE E0_INTERPOLATE
#endif
#ifndef E1_HOLD_MULTIPLIER
#define E1_HOLD_MULTIPLIER E0_HOLD_MULTIPLIER
#endif
#ifndef E1_SLAVE_ADDRESS
#define E1_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(E2)
#if AXIS_HAS_STEALTHCHOP(E2)
#define E2_HAS_STEALTHCHOP 1
#endif
#ifndef E2_INTERPOLATE
#define E2_INTERPOLATE E0_INTERPOLATE
#endif
#ifndef E2_HOLD_MULTIPLIER
#define E2_HOLD_MULTIPLIER E0_HOLD_MULTIPLIER
#endif
#ifndef E2_SLAVE_ADDRESS
#define E2_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(E3)
#if AXIS_HAS_STEALTHCHOP(E3)
#define E3_HAS_STEALTHCHOP 1
#endif
#ifndef E3_INTERPOLATE
#define E3_INTERPOLATE E0_INTERPOLATE
#endif
#ifndef E3_HOLD_MULTIPLIER
#define E3_HOLD_MULTIPLIER E0_HOLD_MULTIPLIER
#endif
#ifndef E3_SLAVE_ADDRESS
#define E3_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(E4)
#if AXIS_HAS_STEALTHCHOP(E4)
#define E4_HAS_STEALTHCHOP 1
#endif
#ifndef E4_INTERPOLATE
#define E4_INTERPOLATE E0_INTERPOLATE
#endif
#ifndef E4_HOLD_MULTIPLIER
#define E4_HOLD_MULTIPLIER E0_HOLD_MULTIPLIER
#endif
#ifndef E4_SLAVE_ADDRESS
#define E4_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(E5)
#if AXIS_HAS_STEALTHCHOP(E5)
#define E5_HAS_STEALTHCHOP 1
#endif
#ifndef E5_INTERPOLATE
#define E5_INTERPOLATE E0_INTERPOLATE
#endif
#ifndef E5_HOLD_MULTIPLIER
#define E5_HOLD_MULTIPLIER E0_HOLD_MULTIPLIER
#endif
#ifndef E5_SLAVE_ADDRESS
#define E5_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(E6)
#if AXIS_HAS_STEALTHCHOP(E6)
#define E6_HAS_STEALTHCHOP 1
#endif
#ifndef E6_INTERPOLATE
#define E6_INTERPOLATE E0_INTERPOLATE
#endif
#ifndef E6_HOLD_MULTIPLIER
#define E6_HOLD_MULTIPLIER E0_HOLD_MULTIPLIER
#endif
#ifndef E6_SLAVE_ADDRESS
#define E6_SLAVE_ADDRESS 0
#endif
#endif
#if AXIS_IS_TMC(E7)
#if AXIS_HAS_STEALTHCHOP(E7)
#define E7_HAS_STEALTHCHOP 1
#endif
#ifndef E7_INTERPOLATE
#define E7_INTERPOLATE E0_INTERPOLATE
#endif
#ifndef E7_HOLD_MULTIPLIER
#define E7_HOLD_MULTIPLIER E0_HOLD_MULTIPLIER
#endif
#ifndef E7_SLAVE_ADDRESS
#define E7_SLAVE_ADDRESS 0
#endif
#endif
#endif // HAS_TRINAMIC_CONFIG
#if ANY_AXIS_HAS(HW_SERIAL)
#define HAS_TMC_HW_SERIAL 1
#endif
#if ANY_AXIS_HAS(SW_SERIAL)
#define HAS_TMC_SW_SERIAL 1
#endif
#ifndef SERIAL_FLOAT_PRECISION
#define SERIAL_FLOAT_PRECISION 2
#endif
#if DISABLED(SENSORLESS_HOMING)
#undef SENSORLESS_BACKOFF_MM
#endif
//
// Set USING_HW_SERIALn flags for used Serial Ports
//
// Flag the indexed hardware serial ports in use
#define SERIAL_IN_USE(N) ( (defined(SERIAL_PORT) && N == SERIAL_PORT) \
|| (defined(SERIAL_PORT_2) && N == SERIAL_PORT_2) \
|| (defined(SERIAL_PORT_3) && N == SERIAL_PORT_3) \
|| (defined(MMU2_SERIAL_PORT) && N == MMU2_SERIAL_PORT) \
|| (defined(LCD_SERIAL_PORT) && N == LCD_SERIAL_PORT) )
// Flag the named hardware serial ports in use
#define TMC_UART_IS(A,N) (defined(A##_HARDWARE_SERIAL) && (CAT(HW_,A##_HARDWARE_SERIAL) == HW_Serial##N || CAT(HW_,A##_HARDWARE_SERIAL) == HW_MSerial##N))
#define ANY_SERIAL_IS(N) ( SERIAL_IN_USE(N) \
|| TMC_UART_IS(X, N) || TMC_UART_IS(Y , N) || TMC_UART_IS(Z , N) \
|| TMC_UART_IS(I, N) || TMC_UART_IS(J , N) || TMC_UART_IS(K , N) \
|| TMC_UART_IS(U, N) || TMC_UART_IS(V , N) || TMC_UART_IS(W , N) \
|| TMC_UART_IS(X2, N) || TMC_UART_IS(Y2, N) || TMC_UART_IS(Z2, N) || TMC_UART_IS(Z3, N) || TMC_UART_IS(Z4, N) \
|| TMC_UART_IS(E0, N) || TMC_UART_IS(E1, N) || TMC_UART_IS(E2, N) || TMC_UART_IS(E3, N) || TMC_UART_IS(E4, N) )
#define HW_Serial 501
#define HW_Serial0 502
#define HW_Serial1 503
#define HW_Serial2 504
#define HW_Serial3 505
#define HW_Serial4 506
#define HW_Serial5 507
#define HW_Serial6 508
#define HW_MSerial0 509
#define HW_MSerial1 510
#define HW_MSerial2 511
#define HW_MSerial3 512
#define HW_MSerial4 513
#define HW_MSerial5 514
#define HW_MSerial6 515
#define HW_MSerial7 516
#define HW_MSerial8 517
#define HW_MSerial9 518
#define HW_MSerial10 519
#if SERIAL_IN_USE(-1)
#define USING_HW_SERIALUSB 1
#endif
#if ANY_SERIAL_IS(0)
#define USING_HW_SERIAL0 1
#endif
#if ANY_SERIAL_IS(1)
#define USING_HW_SERIAL1 1
#endif
#if ANY_SERIAL_IS(2)
#define USING_HW_SERIAL2 1
#endif
#if ANY_SERIAL_IS(3)
#define USING_HW_SERIAL3 1
#endif
#if ANY_SERIAL_IS(4)
#define USING_HW_SERIAL4 1
#endif
#if ANY_SERIAL_IS(5)
#define USING_HW_SERIAL5 1
#endif
#if ANY_SERIAL_IS(6)
#define USING_HW_SERIAL6 1
#endif
#if ANY_SERIAL_IS(7)
#define USING_HW_SERIAL7 1
#endif
#if ANY_SERIAL_IS(8)
#define USING_HW_SERIAL8 1
#endif
#if ANY_SERIAL_IS(9)
#define USING_HW_SERIAL9 1
#endif
#if ANY_SERIAL_IS(10)
#define USING_HW_SERIAL10 1
#endif
#undef HW_Serial
#undef HW_Serial0
#undef HW_Serial1
#undef HW_Serial2
#undef HW_Serial3
#undef HW_Serial4
#undef HW_Serial5
#undef HW_Serial6
#undef HW_MSerial0
#undef HW_MSerial1
#undef HW_MSerial2
#undef HW_MSerial3
#undef HW_MSerial4
#undef HW_MSerial5
#undef HW_MSerial6
#undef HW_MSerial7
#undef HW_MSerial8
#undef HW_MSerial9
#undef HW_MSerial10
#undef _SERIAL_ID
#undef _TMC_UART_IS
#undef TMC_UART_IS
#undef ANY_SERIAL_IS
#if defined(__AVR_ARCH__) && defined(TMC_SPI_MISO) && defined(TMC_SPI_MOSI) && defined(TMC_SPI_SCK)
// Check that the pins are the solitary supported SPI hardware pins of the (AVR) platform.
// Otherwise we are forced to enable software SPI.
#if TMC_SPI_MISO != MISO || TMC_SPI_MOSI != MOSI || TMC_SPI_SCK != SCK
#define TMC_USE_SW_SPI
#endif
#endif
// Clean up unused ESP_WIFI pins
#ifdef ESP_WIFI_MODULE_COM
#if !SERIAL_IN_USE(ESP_WIFI_MODULE_COM)
#undef ESP_WIFI_MODULE_COM
#undef ESP_WIFI_MODULE_BAUDRATE
#undef ESP_WIFI_MODULE_RESET_PIN
#undef ESP_WIFI_MODULE_ENABLE_PIN
#undef ESP_WIFI_MODULE_TXD_PIN
#undef ESP_WIFI_MODULE_RXD_PIN
#undef ESP_WIFI_MODULE_GPIO0_PIN
#undef ESP_WIFI_MODULE_GPIO2_PIN
#undef ESP_WIFI_MODULE_GPIO4_PIN
#endif
#endif
/**
* Endstop and probe flags
* - Set USE_(AXIS)_(MIN|MAX) flags for each used endstop that has a pin, including those for DIAG0 state.
* - Note: Dual X Carriage uses "X" and "X2" steppers, but X_MIN and X_MAX endstop states (i.e., not X2_MAX).
* - Set a HAS_(AXIS)_(MIN|MAX)_STATE flag for each endstop that has a state, including SPI Sensorless which don't use a pin.
* - Set a HAS_(AXIS)_STATE flag for each axis that has at least one state.
* - Consider (AXIS)_SAFETY_STOP for the case where the axis has a second endstop.
* Currently this must be distinct, but we can add a mechanism to use the same pin for sensorless
* or switches wired to the same pin, or for the single SPI stall state on the axis.
*/
#define _ANY_STOP(A,N,M) ANY(A##_HOME_TO_##M, A##N##_SAFETY_STOP)
#define _USE_STOP(A,N,M,C) ((_ANY_STOP(A,N,M) || (C+0)) && PIN_EXISTS(A##N##_##M) && !A##_SPI_SENSORLESS)
#define _HAS_STATE(A,N,M) (USE_##A##N##_##M || (_ANY_STOP(A,N,M) && A##_SPI_SENSORLESS))
#if _USE_STOP(X,,MIN,)
#define USE_X_MIN 1
#endif
#if _USE_STOP(X,,MAX,ENABLED(DUAL_X_CARRIAGE))
#define USE_X_MAX 1
#endif
#if _HAS_STATE(X,,MIN)
#define HAS_X_MIN_STATE 1
#endif
#if _HAS_STATE(X,,MAX)
#define HAS_X_MAX_STATE 1
#endif
#if HAS_X_MIN_STATE || HAS_X_MAX_STATE
#define HAS_X_STATE 1
#endif
#if _USE_STOP(Y,,MIN,)
#define USE_Y_MIN 1
#endif
#if _USE_STOP(Y,,MAX,)
#define USE_Y_MAX 1
#endif
#if _HAS_STATE(Y,,MIN)
#define HAS_Y_MIN_STATE 1
#endif
#if _HAS_STATE(Y,,MAX)
#define HAS_Y_MAX_STATE 1
#endif
#if HAS_Y_MIN_STATE || HAS_Y_MAX_STATE
#define HAS_Y_STATE 1
#endif
#if _USE_STOP(Z,,MIN,ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) && (DISABLED(USE_PROBE_FOR_Z_HOMING) || ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN))
#define USE_Z_MIN 1
#endif
#if _USE_STOP(Z,,MAX,)
#define USE_Z_MAX 1
#endif
#if _HAS_STATE(Z,,MIN)
#define HAS_Z_MIN_STATE 1
#endif
#if _HAS_STATE(Z,,MAX)
#define HAS_Z_MAX_STATE 1
#endif
#if HAS_Z_MIN_STATE || HAS_Z_MAX_STATE
#define HAS_Z_STATE 1
#endif
#if _USE_STOP(I,,MIN,)
#define USE_I_MIN 1
#endif
#if _USE_STOP(I,,MAX,)
#define USE_I_MAX 1
#endif
#if _HAS_STATE(I,,MIN)
#define HAS_I_MIN_STATE 1
#endif
#if _HAS_STATE(I,,MAX)
#define HAS_I_MAX_STATE 1
#endif
#if HAS_I_MIN_STATE || HAS_I_MAX_STATE
#define HAS_I_STATE 1
#endif
#if _USE_STOP(J,,MIN,)
#define USE_J_MIN 1
#endif
#if _USE_STOP(J,,MAX,)
#define USE_J_MAX 1
#endif
#if _HAS_STATE(J,,MIN)
#define HAS_J_MIN_STATE 1
#endif
#if _HAS_STATE(J,,MAX)
#define HAS_J_MAX_STATE 1
#endif
#if HAS_J_MIN_STATE || HAS_J_MAX_STATE
#define HAS_J_STATE 1
#endif
#if _USE_STOP(K,,MIN,)
#define USE_K_MIN 1
#endif
#if _USE_STOP(K,,MAX,)
#define USE_K_MAX 1
#endif
#if _HAS_STATE(K,,MIN)
#define HAS_K_MIN_STATE 1
#endif
#if _HAS_STATE(K,,MAX)
#define HAS_K_MAX_STATE 1
#endif
#if HAS_K_MIN_STATE || HAS_K_MAX_STATE
#define HAS_K_STATE 1
#endif
#if _USE_STOP(U,,MIN,)
#define USE_U_MIN 1
#endif
#if _USE_STOP(U,,MAX,)
#define USE_U_MAX 1
#endif
#if _HAS_STATE(U,,MIN)
#define HAS_U_MIN_STATE 1
#endif
#if _HAS_STATE(U,,MAX)
#define HAS_U_MAX_STATE 1
#endif
#if HAS_U_MIN_STATE || HAS_U_MAX_STATE
#define HAS_U_STATE 1
#endif
#if _USE_STOP(V,,MIN,)
#define USE_V_MIN 1
#endif
#if _USE_STOP(V,,MAX,)
#define USE_V_MAX 1
#endif
#if _HAS_STATE(V,,MIN)
#define HAS_V_MIN_STATE 1
#endif
#if _HAS_STATE(V,,MAX)
#define HAS_V_MAX_STATE 1
#endif
#if HAS_V_MIN_STATE || HAS_V_MAX_STATE
#define HAS_V_STATE 1
#endif
#if _USE_STOP(W,,MIN,)
#define USE_W_MIN 1
#endif
#if _USE_STOP(W,,MAX,)
#define USE_W_MAX 1
#endif
#if _HAS_STATE(W,,MIN)
#define HAS_W_MIN_STATE 1
#endif
#if _HAS_STATE(W,,MAX)
#define HAS_W_MAX_STATE 1
#endif
#if HAS_W_MIN_STATE || HAS_W_MAX_STATE
#define HAS_W_STATE 1
#endif
#if ENABLED(X_DUAL_ENDSTOPS)
#if _USE_STOP(X,2,MIN,)
#define USE_X2_MIN 1
#endif
#if _USE_STOP(X,2,MAX,)
#define USE_X2_MAX 1
#endif
#if _HAS_STATE(X,2,MIN) || HAS_X_MIN_STATE
#define HAS_X2_MIN_STATE 1
#endif
#if _HAS_STATE(X,2,MAX) || HAS_X_MAX_STATE
#define HAS_X2_MAX_STATE 1
#endif
#if HAS_X2_MIN_STATE || HAS_X2_MAX_STATE
#define HAS_X2_STATE 1
#endif
#endif
#if ENABLED(Y_DUAL_ENDSTOPS)
#if _USE_STOP(Y,2,MIN,)
#define USE_Y2_MIN 1
#endif
#if _USE_STOP(Y,2,MAX,)
#define USE_Y2_MAX 1
#endif
#if _HAS_STATE(Y,2,MIN) || HAS_Y_MIN_STATE
#define HAS_Y2_MIN_STATE 1
#endif
#if _HAS_STATE(Y,2,MAX) || HAS_Y_MAX_STATE
#define HAS_Y2_MAX_STATE 1
#endif
#if HAS_Y2_MIN_STATE || HAS_Y2_MAX_STATE
#define HAS_Y2_STATE 1
#endif
#endif
#if ENABLED(Z_MULTI_ENDSTOPS)
#if _USE_STOP(Z,2,MIN,)
#define USE_Z2_MIN 1
#endif
#if _USE_STOP(Z,2,MAX,)
#define USE_Z2_MAX 1
#endif
#if _HAS_STATE(Z,2,MIN) || HAS_Z_MIN_STATE
#define HAS_Z2_MIN_STATE 1
#endif
#if _HAS_STATE(Z,2,MAX) || HAS_Z_MAX_STATE
#define HAS_Z2_MAX_STATE 1
#endif
#if HAS_Z2_MIN_STATE || HAS_Z2_MAX_STATE
#define HAS_Z2_STATE 1
#endif
#if NUM_Z_STEPPERS >= 3
#if _USE_STOP(Z,3,MIN,)
#define USE_Z3_MIN 1
#endif
#if _USE_STOP(Z,3,MAX,)
#define USE_Z3_MAX 1
#endif
#if _HAS_STATE(Z,3,MIN) || HAS_Z_MIN_STATE
#define HAS_Z3_MIN_STATE 1
#endif
#if _HAS_STATE(Z,3,MAX) || HAS_Z_MAX_STATE
#define HAS_Z3_MAX_STATE 1
#endif
#if HAS_Z3_MIN_STATE || HAS_Z3_MAX_STATE
#define HAS_Z3_STATE 1
#endif
#endif
#if NUM_Z_STEPPERS >= 4
#if _USE_STOP(Z,4,MIN,)
#define USE_Z4_MIN 1
#endif
#if _USE_STOP(Z,4,MAX,)
#define USE_Z4_MAX 1
#endif
#if _HAS_STATE(Z,4,MIN) || HAS_Z_MIN_STATE
#define HAS_Z4_MIN_STATE 1
#endif
#if _HAS_STATE(Z,4,MAX) || HAS_Z_MAX_STATE
#define HAS_Z4_MAX_STATE 1
#endif
#if HAS_Z4_MIN_STATE || HAS_Z4_MAX_STATE
#define HAS_Z4_STATE 1
#endif
#endif
#endif
#if NEED_Z_MIN_PROBE_PIN && PIN_EXISTS(Z_MIN_PROBE)
#define USE_Z_MIN_PROBE 1
#endif
#if HAS_REAL_BED_PROBE
#define HAS_Z_PROBE_STATE 1
#endif
#undef _ANY_STOP
#undef _USE_STOP
#undef _HAS_STATE
/**
* Set ENDSTOPPULLUPS for active endstop switches
*/
#if ENABLED(ENDSTOPPULLUPS)
#if USE_X_MIN
#define ENDSTOPPULLUP_XMIN
#endif
#if USE_X_MAX
#define ENDSTOPPULLUP_XMAX
#endif
#if USE_Y_MIN
#define ENDSTOPPULLUP_YMIN
#endif
#if USE_Y_MAX
#define ENDSTOPPULLUP_YMAX
#endif
#if USE_Z_MIN
#define ENDSTOPPULLUP_ZMIN
#endif
#if USE_Z_MAX
#define ENDSTOPPULLUP_ZMAX
#endif
#if USE_I_MIN
#define ENDSTOPPULLUP_IMIN
#endif
#if USE_I_MAX
#define ENDSTOPPULLUP_IMAX
#endif
#if USE_J_MIN
#define ENDSTOPPULLUP_JMIN
#endif
#if USE_J_MAX
#define ENDSTOPPULLUP_JMAX
#endif
#if USE_K_MIN
#define ENDSTOPPULLUP_KMIN
#endif
#if USE_K_MAX
#define ENDSTOPPULLUP_KMAX
#endif
#if USE_U_MIN
#define ENDSTOPPULLUP_UMIN
#endif
#if USE_U_MAX
#define ENDSTOPPULLUP_UMAX
#endif
#if USE_V_MIN
#define ENDSTOPPULLUP_VMIN
#endif
#if USE_V_MAX
#define ENDSTOPPULLUP_VMAX
#endif
#if USE_W_MIN
#define ENDSTOPPULLUP_WMIN
#endif
#if USE_W_MAX
#define ENDSTOPPULLUP_WMAX
#endif
#endif
/**
* Set ENDSTOPPULLDOWNS for active endstop switches
*/
#if ENABLED(ENDSTOPPULLDOWNS)
#if USE_X_MIN
#define ENDSTOPPULLDOWN_XMIN
#endif
#if USE_X_MAX
#define ENDSTOPPULLDOWN_XMAX
#endif
#if USE_Y_MIN
#define ENDSTOPPULLDOWN_YMIN
#endif
#if USE_Y_MAX
#define ENDSTOPPULLDOWN_YMAX
#endif
#if USE_Z_MIN
#define ENDSTOPPULLDOWN_ZMIN
#endif
#if USE_Z_MAX
#define ENDSTOPPULLDOWN_ZMAX
#endif
#if USE_I_MIN
#define ENDSTOPPULLDOWN_IMIN
#endif
#if USE_I_MAX
#define ENDSTOPPULLDOWN_IMAX
#endif
#if USE_J_MIN
#define ENDSTOPPULLDOWN_JMIN
#endif
#if USE_J_MAX
#define ENDSTOPPULLDOWN_JMAX
#endif
#if USE_K_MIN
#define ENDSTOPPULLDOWN_KMIN
#endif
#if USE_K_MAX
#define ENDSTOPPULLDOWN_KMAX
#endif
#if USE_U_MIN
#define ENDSTOPPULLDOWN_UMIN
#endif
#if USE_U_MAX
#define ENDSTOPPULLDOWN_UMAX
#endif
#if USE_V_MIN
#define ENDSTOPPULLDOWN_VMIN
#endif
#if USE_V_MAX
#define ENDSTOPPULLDOWN_VMAX
#endif
#if USE_W_MIN
#define ENDSTOPPULLDOWN_WMIN
#endif
#if USE_W_MAX
#define ENDSTOPPULLDOWN_WMAX
#endif
#endif
//
// ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface)
//
#define HAS_ADC_TEST(P) (TEMP_SENSOR(P) && PIN_EXISTS(TEMP_##P) && !TEMP_SENSOR_IS_MAX_TC(P) && !TEMP_SENSOR_##P##_IS_DUMMY)
#if HOTENDS > 0 && HAS_ADC_TEST(0)
#define HAS_TEMP_ADC_0 1
#endif
#if HOTENDS > 1 && HAS_ADC_TEST(1)
#define HAS_TEMP_ADC_1 1
#endif
#if HOTENDS > 2 && HAS_ADC_TEST(2)
#define HAS_TEMP_ADC_2 1
#endif
#if HOTENDS > 3 && HAS_ADC_TEST(3)
#define HAS_TEMP_ADC_3 1
#endif
#if HOTENDS > 4 && HAS_ADC_TEST(4)
#define HAS_TEMP_ADC_4 1
#endif
#if HOTENDS > 5 && HAS_ADC_TEST(5)
#define HAS_TEMP_ADC_5 1
#endif
#if HOTENDS > 6 && HAS_ADC_TEST(6)
#define HAS_TEMP_ADC_6 1
#endif
#if HOTENDS > 7 && HAS_ADC_TEST(7)
#define HAS_TEMP_ADC_7 1
#endif
#if TEMP_SENSOR_BED
#define HAS_HEATED_BED 1
#if HAS_ADC_TEST(BED)
#define HAS_TEMP_ADC_BED 1
#endif
#endif
#if HAS_ADC_TEST(PROBE)
#define HAS_TEMP_ADC_PROBE 1
#endif
#if HAS_ADC_TEST(CHAMBER)
#define HAS_TEMP_ADC_CHAMBER 1
#endif
#if HAS_ADC_TEST(COOLER)
#define HAS_TEMP_ADC_COOLER 1
#endif
#if HAS_ADC_TEST(BOARD)
#define HAS_TEMP_ADC_BOARD 1
#endif
#if HAS_ADC_TEST(SOC)
#define HAS_TEMP_ADC_SOC 1
#endif
#if HAS_ADC_TEST(REDUNDANT)
#define HAS_TEMP_ADC_REDUNDANT 1
#endif
#define HAS_TEMP(N) (TEMP_SENSOR_IS_MAX_TC(N) || HAS_TEMP_ADC_##N || TEMP_SENSOR_##N##_IS_DUMMY)
#if HAS_HOTEND && HAS_TEMP(0)
#define HAS_TEMP_HOTEND 1
#endif
#if HAS_TEMP(BED)
#define HAS_TEMP_BED 1
#endif
#if HAS_TEMP(CHAMBER)
#define HAS_TEMP_CHAMBER 1
#endif
#if HAS_TEMP(PROBE)
#define HAS_TEMP_PROBE 1
#endif
#if HAS_TEMP(COOLER)
#define HAS_TEMP_COOLER 1
#endif
#if HAS_TEMP(BOARD)
#define HAS_TEMP_BOARD 1
#endif
#if HAS_TEMP(SOC)
#define HAS_TEMP_SOC 1
#endif
#if HAS_TEMP(REDUNDANT)
#define HAS_TEMP_REDUNDANT 1
#endif
#if ENABLED(JOYSTICK)
#if PIN_EXISTS(JOY_X)
#define HAS_JOY_ADC_X 1
#endif
#if PIN_EXISTS(JOY_Y)
#define HAS_JOY_ADC_Y 1
#endif
#if PIN_EXISTS(JOY_Z)
#define HAS_JOY_ADC_Z 1
#endif
#if PIN_EXISTS(JOY_EN)
#define HAS_JOY_ADC_EN 1
#endif
#endif
// Heaters
#if PIN_EXISTS(HEATER_0)
#define HAS_HEATER_0 1
#endif
#if PIN_EXISTS(HEATER_1)
#define HAS_HEATER_1 1
#endif
#if PIN_EXISTS(HEATER_2)
#define HAS_HEATER_2 1
#endif
#if PIN_EXISTS(HEATER_3)
#define HAS_HEATER_3 1
#endif
#if PIN_EXISTS(HEATER_4)
#define HAS_HEATER_4 1
#endif
#if PIN_EXISTS(HEATER_5)
#define HAS_HEATER_5 1
#endif
#if PIN_EXISTS(HEATER_6)
#define HAS_HEATER_6 1
#endif
#if PIN_EXISTS(HEATER_7)
#define HAS_HEATER_7 1
#endif
#if PIN_EXISTS(HEATER_BED)
#define HAS_HEATER_BED 1
#endif
#if PIN_EXISTS(HEATER_CHAMBER)
#define HAS_HEATER_CHAMBER 1
#endif
// Shorthand for common combinations
#if HAS_HEATED_BED
#ifndef BED_OVERSHOOT
#define BED_OVERSHOOT 10
#endif
#define BED_MAX_TARGET ((BED_MAXTEMP) - (BED_OVERSHOOT))
#else
#undef PIDTEMPBED
#undef PREHEAT_BEFORE_LEVELING
#endif
#if HAS_TEMP_COOLER && PIN_EXISTS(COOLER)
#define HAS_COOLER 1
#ifndef COOLER_OVERSHOOT
#define COOLER_OVERSHOOT 2
#endif
#define COOLER_MIN_TARGET ((COOLER_MINTEMP) + (COOLER_OVERSHOOT))
#define COOLER_MAX_TARGET ((COOLER_MAXTEMP) - (COOLER_OVERSHOOT))
#endif
#if HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_TEMP_CHAMBER || HAS_TEMP_PROBE || HAS_TEMP_COOLER || HAS_TEMP_BOARD || HAS_TEMP_SOC
#define HAS_TEMP_SENSOR 1
#endif
#if HAS_TEMP_CHAMBER && HAS_HEATER_CHAMBER
#define HAS_HEATED_CHAMBER 1
#ifndef CHAMBER_OVERSHOOT
#define CHAMBER_OVERSHOOT 10
#endif
#define CHAMBER_MAX_TARGET ((CHAMBER_MAXTEMP) - (CHAMBER_OVERSHOOT))
#else
#undef PIDTEMPCHAMBER
#endif
// PID heating
#if ANY(PIDTEMP, PIDTEMPBED, PIDTEMPCHAMBER)
#define HAS_PID_HEATING 1
#endif
// Thermal protection
#if !HAS_HEATED_BED
#undef THERMAL_PROTECTION_BED
#undef THERMAL_PROTECTION_BED_PERIOD
#endif
#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
#define WATCH_HOTENDS 1
#endif
#if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
#define WATCH_BED 1
#endif
#if ALL(HAS_HEATED_CHAMBER, THERMAL_PROTECTION_CHAMBER) && WATCH_CHAMBER_TEMP_PERIOD > 0
#define WATCH_CHAMBER 1
#endif
#if ALL(HAS_COOLER, THERMAL_PROTECTION_COOLER) && WATCH_COOLER_TEMP_PERIOD > 0
#define WATCH_COOLER 1
#endif
#if NONE(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_CHAMBER, THERMAL_PROTECTION_BED, THERMAL_PROTECTION_COOLER)
#undef THERMAL_PROTECTION_VARIANCE_MONITOR
#endif
#if (ENABLED(THERMAL_PROTECTION_HOTENDS) || !EXTRUDERS) \
&& (ENABLED(THERMAL_PROTECTION_BED) || !HAS_HEATED_BED) \
&& (ENABLED(THERMAL_PROTECTION_CHAMBER) || !HAS_HEATED_CHAMBER) \
&& (ENABLED(THERMAL_PROTECTION_COOLER) || !HAS_COOLER)
#define THERMALLY_SAFE 1
#endif
// Auto fans
#if HAS_HOTEND && PIN_EXISTS(E0_AUTO_FAN)
#define HAS_AUTO_FAN_0 1
#endif
#if HAS_MULTI_HOTEND && PIN_EXISTS(E1_AUTO_FAN)
#define HAS_AUTO_FAN_1 1
#endif
#if HOTENDS > 2 && PIN_EXISTS(E2_AUTO_FAN)
#define HAS_AUTO_FAN_2 1
#endif
#if HOTENDS > 3 && PIN_EXISTS(E3_AUTO_FAN)
#define HAS_AUTO_FAN_3 1
#endif
#if HOTENDS > 4 && PIN_EXISTS(E4_AUTO_FAN)
#define HAS_AUTO_FAN_4 1
#endif
#if HOTENDS > 5 && PIN_EXISTS(E5_AUTO_FAN)
#define HAS_AUTO_FAN_5 1
#endif
#if HOTENDS > 6 && PIN_EXISTS(E6_AUTO_FAN)
#define HAS_AUTO_FAN_6 1
#endif
#if HOTENDS > 7 && PIN_EXISTS(E7_AUTO_FAN)
#define HAS_AUTO_FAN_7 1
#endif
#if HAS_TEMP_CHAMBER && PIN_EXISTS(CHAMBER_AUTO_FAN)
#define HAS_AUTO_CHAMBER_FAN 1
#endif
#if HAS_TEMP_COOLER && PIN_EXISTS(COOLER_AUTO_FAN)
#define HAS_AUTO_COOLER_FAN 1
#endif
#if ANY(HAS_AUTO_FAN_0, HAS_AUTO_FAN_1, HAS_AUTO_FAN_2, HAS_AUTO_FAN_3, HAS_AUTO_FAN_4, HAS_AUTO_FAN_5, HAS_AUTO_FAN_6, HAS_AUTO_FAN_7, HAS_AUTO_CHAMBER_FAN, HAS_AUTO_COOLER_FAN)
#define HAS_AUTO_FAN 1
#define _FANOVERLAP(I,T) (T##_AUTO_FAN_PIN == E##I##_AUTO_FAN_PIN)
#if HAS_AUTO_CHAMBER_FAN
#define _CHFANOVERLAP(I) || _FANOVERLAP(I,CHAMBER)
#if (0 REPEAT(8, _CHFANOVERLAP))
#define AUTO_CHAMBER_IS_E 1
#endif
#undef _CHFANOVERLAP
#endif
#if HAS_AUTO_COOLER_FAN
#define _COFANOVERLAP(I) || _FANOVERLAP(I,COOLER)
#if (0 REPEAT(8, _COFANOVERLAP))
#define AUTO_COOLER_IS_E 1
#endif
#undef _COFANOVERLAP
#endif
#endif
// Fans check
#if HAS_HOTEND && PIN_EXISTS(E0_FAN_TACHO)
#define HAS_E0_FAN_TACHO 1
#endif
#if HOTENDS > 1 && PIN_EXISTS(E1_FAN_TACHO)
#define HAS_E1_FAN_TACHO 1
#endif
#if HOTENDS > 2 && PIN_EXISTS(E2_FAN_TACHO)
#define HAS_E2_FAN_TACHO 1
#endif
#if HOTENDS > 3 && PIN_EXISTS(E3_FAN_TACHO)
#define HAS_E3_FAN_TACHO 1
#endif
#if HOTENDS > 4 && PIN_EXISTS(E4_FAN_TACHO)
#define HAS_E4_FAN_TACHO 1
#endif
#if HOTENDS > 5 && PIN_EXISTS(E5_FAN_TACHO)
#define HAS_E5_FAN_TACHO 1
#endif
#if HOTENDS > 6 && PIN_EXISTS(E6_FAN_TACHO)
#define HAS_E6_FAN_TACHO 1
#endif
#if HOTENDS > 7 && PIN_EXISTS(E7_FAN_TACHO)
#define HAS_E7_FAN_TACHO 1
#endif
#if ANY(HAS_E0_FAN_TACHO, HAS_E1_FAN_TACHO, HAS_E2_FAN_TACHO, HAS_E3_FAN_TACHO, HAS_E4_FAN_TACHO, HAS_E5_FAN_TACHO, HAS_E6_FAN_TACHO, HAS_E7_FAN_TACHO)
#define HAS_FANCHECK 1
#if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255 && DISABLED(FOURWIRES_FANS)
#define HAS_PWMFANCHECK 1
#endif
#endif
#if !HAS_TEMP_SENSOR
#undef AUTO_REPORT_TEMPERATURES
#endif
#if ANY(AUTO_REPORT_TEMPERATURES, AUTO_REPORT_SD_STATUS, AUTO_REPORT_POSITION, AUTO_REPORT_FANS)
#define HAS_AUTO_REPORTING 1
#endif
#if !HAS_AUTO_CHAMBER_FAN || AUTO_CHAMBER_IS_E
#undef AUTO_POWER_CHAMBER_FAN
#endif
#if !HAS_AUTO_COOLER_FAN || AUTO_COOLER_IS_E
#undef AUTO_POWER_COOLER_FAN
#endif
#if !HAS_CUTTER
#undef AUTO_POWER_SPINDLE_LASER
#endif
/**
* Controller Fan Settings
*/
#if PIN_EXISTS(CONTROLLER_FAN)
#define HAS_CONTROLLER_FAN 1
#endif
#if HAS_CONTROLLER_FAN
#if ENABLED(CONTROLLER_FAN_USE_BOARD_TEMP)
#define HAS_CONTROLLER_FAN_BOARD_TEMP_TRIGGER 1
#ifndef CONTROLLER_FAN_TRIGGER_TEMP
#define CONTROLLER_FAN_TRIGGER_TEMP 30
#endif
#else
#undef CONTROLLER_FAN_TRIGGER_TEMP
#endif
#endif
/**
* Up to 12 PWM fans
*/
#ifdef NUM_M106_FANS
#define MAX_FANS NUM_M106_FANS
#else
#define MAX_FANS 12 // Max supported fans
#endif
#define _IS_E_AUTO(N,F) (PIN_EXISTS(E##N##_AUTO_FAN) && E##N##_AUTO_FAN_PIN == FAN##F##_PIN)
#define _HAS_FAN(F) (F < MAX_FANS && PIN_EXISTS(FAN##F) \
&& !(HAS_CONTROLLER_FAN && CONTROLLER_FAN_PIN == FAN##F##_PIN) \
&& !_IS_E_AUTO(0,F) && !_IS_E_AUTO(1,F) \
&& !_IS_E_AUTO(2,F) && !_IS_E_AUTO(3,F) \
&& !_IS_E_AUTO(4,F) && !_IS_E_AUTO(5,F) \
&& !_IS_E_AUTO(6,F) && !_IS_E_AUTO(7,F))
#if _HAS_FAN(0)
#define HAS_FAN0 1
#endif
#if _HAS_FAN(1)
#define HAS_FAN1 1
#endif
#if _HAS_FAN(2)
#define HAS_FAN2 1
#endif
#if _HAS_FAN(3)
#define HAS_FAN3 1
#endif
#if _HAS_FAN(4)
#define HAS_FAN4 1
#endif
#if _HAS_FAN(5)
#define HAS_FAN5 1
#endif
#if _HAS_FAN(6)
#define HAS_FAN6 1
#endif
#if _HAS_FAN(7)
#define HAS_FAN7 1
#endif
#if _HAS_FAN(8)
#define HAS_FAN8 1
#endif
#if _HAS_FAN(9)
#define HAS_FAN9 1
#endif
#if _HAS_FAN(10)
#define HAS_FAN10 1
#endif
#if _HAS_FAN(11)
#define HAS_FAN11 1
#endif
#undef _HAS_FAN
#undef _IS_E_AUTO
#if HAS_FAN11
#define FAN_COUNT 12
#elif HAS_FAN10
#define FAN_COUNT 11
#elif HAS_FAN9
#define FAN_COUNT 10
#elif HAS_FAN8
#define FAN_COUNT 9
#elif HAS_FAN7
#define FAN_COUNT 8
#elif HAS_FAN6
#define FAN_COUNT 7
#elif HAS_FAN5
#define FAN_COUNT 6
#elif HAS_FAN4
#define FAN_COUNT 5
#elif HAS_FAN3
#define FAN_COUNT 4
#elif HAS_FAN2
#define FAN_COUNT 3
#elif HAS_FAN1
#define FAN_COUNT 2
#elif HAS_FAN0
#define FAN_COUNT 1
#else
#define FAN_COUNT 0
#endif
#if FAN_COUNT > 0
#define HAS_FAN 1
#endif
#if PIN_EXISTS(FANMUX0)
#define HAS_FANMUX 1 // Part Cooling fan multipliexer
#endif
/**
* MIN/MAX fan PWM scaling
*/
#if ANY(HAS_FAN, USE_CONTROLLER_FAN)
#ifndef FAN_OFF_PWM
#define FAN_OFF_PWM 0
#endif
#ifndef FAN_MIN_PWM
#if FAN_OFF_PWM > 0
#define FAN_MIN_PWM (FAN_OFF_PWM + 1)
#else
#define FAN_MIN_PWM 0
#endif
#endif
#ifndef FAN_MAX_PWM
#define FAN_MAX_PWM 255
#endif
#if FAN_MIN_PWM == 0 && FAN_MAX_PWM == 255
#define CALC_FAN_SPEED(f) (f ?: FAN_OFF_PWM)
#else
#define CALC_FAN_SPEED(f) (f ? map(f, 1, 255, FAN_MIN_PWM, FAN_MAX_PWM) : FAN_OFF_PWM)
#endif
#endif
// Fan Kickstart
#if FAN_KICKSTART_TIME && !defined(FAN_KICKSTART_POWER)
#define FAN_KICKSTART_POWER 180
#endif
// Servos
#if NUM_SERVOS > 0
#define HAS_SERVOS 1
#if PIN_EXISTS(SERVO0)
#define HAS_SERVO_0 1
#endif
#if PIN_EXISTS(SERVO1) && NUM_SERVOS > 1
#define HAS_SERVO_1 1
#endif
#if PIN_EXISTS(SERVO2) && NUM_SERVOS > 2
#define HAS_SERVO_2 1
#endif
#if PIN_EXISTS(SERVO3) && NUM_SERVOS > 3
#define HAS_SERVO_3 1
#endif
#if PIN_EXISTS(SERVO4) && NUM_SERVOS > 4
#define HAS_SERVO_4 1
#endif
#if PIN_EXISTS(SERVO5) && NUM_SERVOS > 5
#define HAS_SERVO_5 1
#endif
#if defined(PAUSE_SERVO_OUTPUT) && defined(RESUME_SERVO_OUTPUT)
#define HAS_PAUSE_SERVO_OUTPUT 1
#endif
#else
#undef SERVO_DELAY
#undef DEACTIVATE_SERVOS_AFTER_MOVE
#undef EDITABLE_SERVO_ANGLES
#undef SERVO_DETACH_GCODE
#endif
// Sensors
#if PIN_EXISTS(FILWIDTH)
#define HAS_FILAMENT_WIDTH_SENSOR 1
#endif
// User Interface
#if ENABLED(FREEZE_FEATURE) && !PIN_EXISTS(FREEZE) && PIN_EXISTS(KILL)
#define FREEZE_PIN KILL_PIN
#elif PIN_EXISTS(KILL) && TERN1(FREEZE_FEATURE, KILL_PIN != FREEZE_PIN)
#define HAS_KILL 1
#endif
#if PIN_EXISTS(HOME)
#define HAS_HOME 1
#endif
#if PIN_EXISTS(SUICIDE)
#define HAS_SUICIDE 1
#endif
#if PIN_EXISTS(PHOTOGRAPH)
#define HAS_PHOTOGRAPH 1
#endif
// Digital control
#if PIN_EXISTS(STEPPER_RESET)
#define HAS_STEPPER_RESET 1
#endif
#if PIN_EXISTS(DIGIPOTSS)
#define HAS_MOTOR_CURRENT_SPI 1
#endif
#if HAS_EXTRUDERS && PIN_EXISTS(MOTOR_CURRENT_PWM_E)
#define HAS_MOTOR_CURRENT_PWM_E 1
#endif
#if HAS_MOTOR_CURRENT_PWM_E || ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_Z, MOTOR_CURRENT_PWM_I, MOTOR_CURRENT_PWM_J, MOTOR_CURRENT_PWM_K, MOTOR_CURRENT_PWM_U, MOTOR_CURRENT_PWM_V, MOTOR_CURRENT_PWM_W)
#define HAS_MOTOR_CURRENT_PWM 1
#endif
#if ANY(HAS_Z_MS_PINS, HAS_Z2_MS_PINS, HAS_Z3_MS_PINS, HAS_Z4_MS_PINS)
#define HAS_SOME_Z_MS_PINS 1
#endif
#if ANY(HAS_E0_MS_PINS, HAS_E1_MS_PINS, HAS_E2_MS_PINS, HAS_E3_MS_PINS, HAS_E4_MS_PINS, HAS_E5_MS_PINS, HAS_E6_MS_PINS, HAS_E7_MS_PINS)
#define HAS_SOME_E_MS_PINS 1
#endif
#if ANY(HAS_X_MS_PINS, HAS_X2_MS_PINS, HAS_Y_MS_PINS, HAS_Y2_MS_PINS, HAS_SOME_Z_MS_PINS, HAS_I_MS_PINS, HAS_J_MS_PINS, HAS_K_MS_PINS, HAS_U_MS_PINS, HAS_V_MS_PINS, HAS_W_MS_PINS, HAS_SOME_E_MS_PINS)
#define HAS_MICROSTEPS 1
#endif
/**
* Helper Macros for heaters and extruder fan
*/
#define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, (v) ^ ENABLED(HEATER_0_INVERTING))
#if ANY(HAS_MULTI_HOTEND, HEATERS_PARALLEL)
#define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, (v) ^ ENABLED(HEATER_1_INVERTING))
#if HOTENDS > 2
#define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, (v) ^ ENABLED(HEATER_2_INVERTING))
#if HOTENDS > 3
#define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, (v) ^ ENABLED(HEATER_3_INVERTING))
#if HOTENDS > 4
#define WRITE_HEATER_4(v) WRITE(HEATER_4_PIN, (v) ^ ENABLED(HEATER_4_INVERTING))
#if HOTENDS > 5
#define WRITE_HEATER_5(v) WRITE(HEATER_5_PIN, (v) ^ ENABLED(HEATER_5_INVERTING))
#if HOTENDS > 6
#define WRITE_HEATER_6(v) WRITE(HEATER_6_PIN, (v) ^ ENABLED(HEATER_6_INVERTING))
#if HOTENDS > 7
#define WRITE_HEATER_7(v) WRITE(HEATER_7_PIN, (v) ^ ENABLED(HEATER_7_INVERTING))
#endif // HOTENDS > 7
#endif // HOTENDS > 6
#endif // HOTENDS > 5
#endif // HOTENDS > 4
#endif // HOTENDS > 3
#endif // HOTENDS > 2
#endif // HAS_MULTI_HOTEND || HEATERS_PARALLEL
#if ENABLED(HEATERS_PARALLEL)
#define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); }
#else
#define WRITE_HEATER_0(v) WRITE_HEATER_0P(v)
#endif
/**
* Heated bed requires settings
*/
#if HAS_HEATED_BED
#ifndef MIN_BED_POWER
#define MIN_BED_POWER 0
#endif
#ifndef MAX_BED_POWER
#define MAX_BED_POWER 255
#endif
#define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, (v) ^ ENABLED(HEATER_BED_INVERTING))
#endif
/**
* Heated chamber requires settings
*/
#if HAS_HEATED_CHAMBER
#ifndef MIN_CHAMBER_POWER
#define MIN_CHAMBER_POWER 0
#endif
#ifndef MAX_CHAMBER_POWER
#define MAX_CHAMBER_POWER 255
#endif
#define WRITE_HEATER_CHAMBER(v) WRITE(HEATER_CHAMBER_PIN, (v) ^ ENABLED(HEATER_CHAMBER_INVERTING))
#endif
/**
* Laser Cooling requires settings
*/
#if HAS_COOLER
#ifndef MAX_COOLER_POWER
#define MAX_COOLER_POWER 255
#endif
#define WRITE_HEATER_COOLER(v) WRITE(COOLER_PIN, (v) ^ ENABLED(COOLER_INVERTING))
#endif
#if HAS_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER || HAS_COOLER
#define HAS_TEMPERATURE 1
#endif
#if HAS_TEMPERATURE && ANY(HAS_MARLINUI_MENU, HAS_DWIN_E3V2, HAS_DGUS_LCD_CLASSIC)
#ifdef PREHEAT_10_LABEL
#define PREHEAT_COUNT 10
#elif defined(PREHEAT_9_LABEL)
#define PREHEAT_COUNT 9
#elif defined(PREHEAT_8_LABEL)
#define PREHEAT_COUNT 8
#elif defined(PREHEAT_7_LABEL)
#define PREHEAT_COUNT 7
#elif defined(PREHEAT_6_LABEL)
#define PREHEAT_COUNT 6
#elif defined(PREHEAT_5_LABEL)
#define PREHEAT_COUNT 5
#elif defined(PREHEAT_4_LABEL)
#define PREHEAT_COUNT 4
#elif defined(PREHEAT_3_LABEL)
#define PREHEAT_COUNT 3
#elif defined(PREHEAT_2_LABEL)
#define PREHEAT_COUNT 2
#elif defined(PREHEAT_1_LABEL)
#define PREHEAT_COUNT 1
#endif
#if PREHEAT_COUNT && ANY(HAS_HOTEND, HAS_HEATED_BED, HAS_FAN)
#define HAS_PREHEAT 1
#endif
#endif
#if !HAS_PREHEAT
#undef PREHEAT_SHORTCUT_MENU_ITEM
#undef DGUS_PREHEAT_UI
#endif
/**
* MIN/MAX case light PWM scaling
*/
#if ENABLED(CASE_LIGHT_ENABLE)
#ifndef CASE_LIGHT_MAX_PWM
#define CASE_LIGHT_MAX_PWM 255
#elif !WITHIN(CASE_LIGHT_MAX_PWM, 1, 255)
#error "CASE_LIGHT_MAX_PWM must be a value from 1 to 255."
#endif
#endif
/**
* Bed Probe dependencies
*/
#if ANY(MESH_BED_LEVELING, HAS_BED_PROBE)
#ifndef PROBE_OFFSET_ZMIN
#define PROBE_OFFSET_ZMIN -20
#endif
#ifndef PROBE_OFFSET_ZMAX
#define PROBE_OFFSET_ZMAX 20
#endif
#endif
#if HAS_BED_PROBE
#ifndef PROBE_OFFSET_XMIN
#define PROBE_OFFSET_XMIN -(X_BED_SIZE)
#endif
#ifndef PROBE_OFFSET_XMAX
#define PROBE_OFFSET_XMAX X_BED_SIZE
#endif
#ifndef PROBE_OFFSET_YMIN
#define PROBE_OFFSET_YMIN -(Y_BED_SIZE)
#endif
#ifndef PROBE_OFFSET_YMAX
#define PROBE_OFFSET_YMAX Y_BED_SIZE
#endif
#if ALL(ENDSTOPPULLUPS, USE_Z_MIN_PROBE)
#define ENDSTOPPULLUP_ZMIN_PROBE
#endif
#ifndef XY_PROBE_FEEDRATE
#define XY_PROBE_FEEDRATE ((homing_feedrate_mm_m.x + homing_feedrate_mm_m.y) / 2)
#endif
#ifndef NOZZLE_TO_PROBE_OFFSET
#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 }
#endif
#endif
/**
* XYZ Bed Skew Correction
*/
#if ENABLED(SKEW_CORRECTION)
#define SKEW_FACTOR_MIN -1
#define SKEW_FACTOR_MAX 1
#define _GET_SIDE(a,b,c) (SQRT(2*sq(a)+2*sq(b)-4*sq(c))*0.5)
#define _SKEW_SIDE(a,b,c) tan(M_PI*0.5-acos((sq(a)-sq(b)-sq(c))/(2*c*b)))
#define _SKEW_FACTOR(a,b,c) _SKEW_SIDE(float(a),_GET_SIDE(float(a),float(b),float(c)),float(c))
#ifndef XY_SKEW_FACTOR
#if defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD)
#define XY_SKEW_FACTOR _SKEW_FACTOR(XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD)
#else
#define XY_SKEW_FACTOR 0.0
#endif
#endif
#ifndef XZ_SKEW_FACTOR
#if defined(XY_SIDE_AD) && !defined(XZ_SIDE_AD)
#define XZ_SIDE_AD XY_SIDE_AD
#endif
#if defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD)
#define XZ_SKEW_FACTOR _SKEW_FACTOR(XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD)
#else
#define XZ_SKEW_FACTOR 0.0
#endif
#endif
#ifndef YZ_SKEW_FACTOR
#if defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD)
#define YZ_SKEW_FACTOR _SKEW_FACTOR(YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD)
#else
#define YZ_SKEW_FACTOR 0.0
#endif
#endif
#endif // SKEW_CORRECTION
/**
* Heater, Fan, and Probe interactions
*/
#if !HAS_FAN
#undef ADAPTIVE_FAN_SLOWING
#undef TEMP_TUNING_MAINTAIN_FAN
#endif
#if !ALL(HAS_BED_PROBE, HAS_FAN)
#undef PROBING_FANS_OFF
#endif
#if !ALL(HAS_BED_PROBE, HAS_EXTRUDERS)
#undef PROBING_ESTEPPERS_OFF
#elif ENABLED(PROBING_STEPPERS_OFF)
// PROBING_STEPPERS_OFF implies PROBING_ESTEPPERS_OFF, make sure it is defined
#define PROBING_ESTEPPERS_OFF
#endif
#if ANY(ADVANCED_PAUSE_FEATURE, PROBING_HEATERS_OFF)
#define HEATER_IDLE_HANDLER 1
#endif
#if HAS_BED_PROBE && (ANY(PROBING_HEATERS_OFF, PROBING_STEPPERS_OFF, PROBING_ESTEPPERS_OFF, PROBING_FANS_OFF) || DELAY_BEFORE_PROBING > 0)
#define HAS_QUIET_PROBING 1
#endif
/**
* Advanced Pause - Filament Change
*/
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_JYERSUI) || ALL(EMERGENCY_PARSER, HOST_PROMPT_SUPPORT)
#define M600_PURGE_MORE_RESUMABLE 1 // UI provides some way to Purge More / Resume
#endif
#ifndef FILAMENT_CHANGE_SLOW_LOAD_LENGTH
#define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0
#endif
#endif
#if HAS_MULTI_EXTRUDER && !defined(TOOLCHANGE_FS_EXTRA_PRIME)
#define TOOLCHANGE_FS_EXTRA_PRIME 0
#endif
/**
* Only constrain Z on DELTA / SCARA machines
*/
#if ENABLED(POLAR)
#undef MIN_SOFTWARE_ENDSTOP_Y
#undef MAX_SOFTWARE_ENDSTOP_Y
#elif IS_KINEMATIC
#undef MIN_SOFTWARE_ENDSTOP_X
#undef MIN_SOFTWARE_ENDSTOP_Y
#undef MAX_SOFTWARE_ENDSTOP_X
#undef MAX_SOFTWARE_ENDSTOP_Y
#endif
/**
* Bed Probing bounds
*/
#ifndef PROBING_MARGIN
#define PROBING_MARGIN 0
#endif
#if IS_KINEMATIC
#undef PROBING_MARGIN_LEFT
#undef PROBING_MARGIN_RIGHT
#undef PROBING_MARGIN_FRONT
#undef PROBING_MARGIN_BACK
#define PROBING_MARGIN_LEFT 0
#define PROBING_MARGIN_RIGHT 0
#define PROBING_MARGIN_FRONT 0
#define PROBING_MARGIN_BACK 0
#else
#ifndef PROBING_MARGIN_LEFT
#define PROBING_MARGIN_LEFT PROBING_MARGIN
#endif
#ifndef PROBING_MARGIN_RIGHT
#define PROBING_MARGIN_RIGHT PROBING_MARGIN
#endif
#ifndef PROBING_MARGIN_FRONT
#define PROBING_MARGIN_FRONT PROBING_MARGIN
#endif
#ifndef PROBING_MARGIN_BACK
#define PROBING_MARGIN_BACK PROBING_MARGIN
#endif
#endif
#if ENABLED(DELTA)
/**
* Delta radius/rod trimmers/angle trimmers
*/
#ifndef DELTA_ENDSTOP_ADJ
#define DELTA_ENDSTOP_ADJ { 0, 0, 0 }
#endif
#ifndef DELTA_TOWER_ANGLE_TRIM
#define DELTA_TOWER_ANGLE_TRIM { 0, 0, 0 }
#endif
#ifndef DELTA_RADIUS_TRIM_TOWER
#define DELTA_RADIUS_TRIM_TOWER { 0, 0, 0 }
#endif
#ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER
#define DELTA_DIAGONAL_ROD_TRIM_TOWER { 0, 0, 0 }
#endif
#endif
#ifndef DEFAULT_LEVELING_FADE_HEIGHT
#define DEFAULT_LEVELING_FADE_HEIGHT 0.0
#endif
#if ENABLED(SEGMENT_LEVELED_MOVES) && !defined(LEVELED_SEGMENT_LENGTH)
#define LEVELED_SEGMENT_LENGTH 5
#endif
/**
* Default mesh area is an area with an inset margin on the print area.
*/
#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
#if IS_KINEMATIC
// Probing points may be verified at compile time within the radius
// using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(PRINTABLE_RADIUS),"bad probe point!")
// so that may be added to SanityCheck.h in the future.
#define _MESH_MIN_X (X_MIN_BED + (MESH_INSET))
#define _MESH_MIN_Y (Y_MIN_BED + (MESH_INSET))
#define _MESH_MAX_X (X_MAX_BED - (MESH_INSET))
#define _MESH_MAX_Y (Y_MAX_BED - (MESH_INSET))
#else
// Boundaries for Cartesian probing based on set limits
#define _MESH_MIN_X (_MAX(X_MIN_BED + (MESH_INSET), X_MIN_POS)) // UBL is careful not to probe off the bed. It doesn't
#define _MESH_MIN_Y (_MAX(Y_MIN_BED + (MESH_INSET), Y_MIN_POS)) // need NOZZLE_TO_PROBE_OFFSET in the mesh dimensions.
#define _MESH_MAX_X (_MIN(X_MAX_BED - (MESH_INSET), X_MAX_POS))
#define _MESH_MAX_Y (_MIN(Y_MAX_BED - (MESH_INSET), Y_MAX_POS))
#endif
// These may be overridden in Configuration.h if a smaller area is desired
#ifndef MESH_MIN_X
#define MESH_MIN_X _MESH_MIN_X
#endif
#ifndef MESH_MIN_Y
#define MESH_MIN_Y _MESH_MIN_Y
#endif
#ifndef MESH_MAX_X
#define MESH_MAX_X _MESH_MAX_X
#endif
#ifndef MESH_MAX_Y
#define MESH_MAX_Y _MESH_MAX_Y
#endif
#else
#undef MESH_MIN_X
#undef MESH_MIN_Y
#undef MESH_MAX_X
#undef MESH_MAX_Y
#endif
#if NEEDS_THREE_PROBE_POINTS && defined(PROBE_PT_1)
#define HAS_FIXED_3POINT 1 // Points are defined for ABL/UBL. Else calculated in probe.get_three_points.
#endif
/**
* Buzzer/Speaker
*/
#if PIN_EXISTS(BEEPER)
#define HAS_BEEPER 1
#endif
#if ANY(IS_TFTGLCD_PANEL, PCA9632_BUZZER, LCD_USE_I2C_BUZZER)
#define USE_MARLINUI_BUZZER 1
#endif
#if ANY(HAS_BEEPER, USE_MARLINUI_BUZZER)
#define HAS_SOUND 1
#endif
#if ENABLED(LCD_USE_I2C_BUZZER)
#ifndef LCD_FEEDBACK_FREQUENCY_HZ
#define LCD_FEEDBACK_FREQUENCY_HZ 1000
#endif
#ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
#endif
#elif HAS_SOUND
#ifndef LCD_FEEDBACK_FREQUENCY_HZ
#define LCD_FEEDBACK_FREQUENCY_HZ 5000
#endif
#ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2
#endif
#endif
#if HAS_SOUND
#if LCD_FEEDBACK_FREQUENCY_DURATION_MS && LCD_FEEDBACK_FREQUENCY_HZ
#define HAS_CHIRP 1
#endif
#else
#undef SOUND_MENU_ITEM // No buzzer menu item without a buzzer
#undef SOUND_ON_DEFAULT
#endif
/**
* Z_CLEARANCE_FOR_HOMING / Z_CLEARANCE_BETWEEN_PROBES
*/
#ifndef Z_CLEARANCE_FOR_HOMING
#ifdef Z_CLEARANCE_BETWEEN_PROBES
#define Z_CLEARANCE_FOR_HOMING Z_CLEARANCE_BETWEEN_PROBES
#else
#define Z_CLEARANCE_FOR_HOMING 0
#endif
#endif
#ifndef Z_CLEARANCE_BETWEEN_PROBES
#define Z_CLEARANCE_BETWEEN_PROBES Z_CLEARANCE_FOR_HOMING
#endif
#if PROBE_SELECTED
#if Z_CLEARANCE_BETWEEN_PROBES > Z_CLEARANCE_FOR_HOMING
#define Z_CLEARANCE_BETWEEN_MANUAL_PROBES Z_CLEARANCE_BETWEEN_PROBES
#else
#define Z_CLEARANCE_BETWEEN_MANUAL_PROBES Z_CLEARANCE_FOR_HOMING
#endif
#ifndef Z_CLEARANCE_MULTI_PROBE
#define Z_CLEARANCE_MULTI_PROBE Z_CLEARANCE_BETWEEN_PROBES
#endif
#if ENABLED(BLTOUCH) && !defined(BLTOUCH_DELAY)
#define BLTOUCH_DELAY 500
#endif
#endif
// Define a starting height for measuring manual probe points
#ifndef MANUAL_PROBE_START_Z
#if ANY(MESH_BED_LEVELING, PROBE_MANUALLY)
// Leave MANUAL_PROBE_START_Z undefined so the prior Z height will be used.
// Note: If Z_CLEARANCE_BETWEEN_MANUAL_PROBES is 0 there will be no raise between points
#elif ENABLED(AUTO_BED_LEVELING_UBL) && defined(Z_CLEARANCE_BETWEEN_PROBES)
#define MANUAL_PROBE_START_Z Z_CLEARANCE_BETWEEN_PROBES
#endif
#endif
#ifndef __SAM3X8E__ //todo: hal: broken hal encapsulation
#undef UI_VOLTAGE_LEVEL
#undef RADDS_DISPLAY
#undef MOTOR_CURRENT
#endif
// G92 shifts the workspace
#if DISABLED(NO_WORKSPACE_OFFSETS)
#define HAS_WORKSPACE_OFFSET 1
#endif
#if DISABLED(NO_HOME_OFFSETS)
#if IS_CARTESIAN
#define HAS_HOME_OFFSET 1 // M206 affects the Native Machine Space on G28
#elif IS_SCARA
#define HAS_SCARA_OFFSET 1 // The SCARA home offset applies only on G28
#endif
#endif
#if ANY(HAS_MARLINUI_MENU, TOUCH_UI_FTDI_EVE)
// LCD timeout to status screen default is 15s
#ifndef LCD_TIMEOUT_TO_STATUS
#define LCD_TIMEOUT_TO_STATUS 15000
#endif
#if LCD_TIMEOUT_TO_STATUS
#define HAS_SCREEN_TIMEOUT 1
#endif
#endif
// Add commands that need sub-codes to this list
#if ANY(G38_PROBE_TARGET, CNC_COORDINATE_SYSTEMS, POWER_LOSS_RECOVERY, HAS_ROTATIONAL_AXES)
#define USE_GCODE_SUBCODES 1
#endif
// Parking Extruder
#if ENABLED(PARKING_EXTRUDER)
#ifndef PARKING_EXTRUDER_GRAB_DISTANCE
#define PARKING_EXTRUDER_GRAB_DISTANCE 0
#endif
#ifndef PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE
#define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE HIGH
#endif
#endif
// Touch Calibration
#if ANY(HAS_SPI_TFT, HAS_FSMC_TFT, HAS_LTDC_TFT)
#ifndef TOUCH_CALIBRATION_X
#define TOUCH_CALIBRATION_X 0
#endif
#ifndef TOUCH_CALIBRATION_Y
#define TOUCH_CALIBRATION_Y 0
#endif
#ifndef TOUCH_OFFSET_X
#define TOUCH_OFFSET_X 0
#endif
#ifndef TOUCH_OFFSET_Y
#define TOUCH_OFFSET_Y 0
#endif
#ifndef TOUCH_ORIENTATION
#define TOUCH_ORIENTATION TOUCH_LANDSCAPE
#endif
#endif
// Number of VFAT entries used. Each entry has 13 UTF-16 characters
#if ANY(SCROLL_LONG_FILENAMES, HAS_DWIN_E3V2, TFT_COLOR_UI)
#define VFAT_ENTRIES_LIMIT 5
#else
#define VFAT_ENTRIES_LIMIT 2
#endif
#define MAX_VFAT_ENTRIES 20 // by VFAT specs to fit LFN of length 255
// Nozzle park for Delta
#if ALL(NOZZLE_PARK_FEATURE, DELTA)
#undef NOZZLE_PARK_Z_FEEDRATE
#define NOZZLE_PARK_Z_FEEDRATE NOZZLE_PARK_XY_FEEDRATE
#endif
// Force SDCARD_SORT_ALPHA to be enabled for Graphical LCD on LPC1768
// on boards where SD card and LCD display share the same SPI bus
// because of a bug in the shared SPI implementation. (See #8122)
#if defined(TARGET_LPC1768) && IS_RRD_FG_SC && (SD_SCK_PIN == LCD_PINS_D4)
#define SDCARD_SORT_ALPHA // Keep one directory level in RAM. Changing directory levels
// may still glitch the screen, but LCD updates clean it up.
#if SDSORT_LIMIT > 64 || !SDSORT_USES_RAM || SDSORT_USES_STACK || !SDSORT_CACHE_NAMES
#undef SDSORT_LIMIT
#undef SDSORT_USES_RAM
#undef SDSORT_USES_STACK
#undef SDSORT_CACHE_NAMES
#define SDSORT_LIMIT 64
#define SDSORT_USES_RAM true
#define SDSORT_USES_STACK false
#define SDSORT_CACHE_NAMES true
#define SDSORT_CACHE_LPC1768_WARNING 1
#endif
#ifndef SDSORT_FOLDERS
#define SDSORT_FOLDERS -1
#endif
#ifndef SDSORT_GCODE
#define SDSORT_GCODE false
#endif
#ifndef SDSORT_DYNAMIC_RAM
#define SDSORT_DYNAMIC_RAM false
#endif
#ifndef SDSORT_CACHE_VFATS
#define SDSORT_CACHE_VFATS 2
#endif
#endif
// Fallback SPI Speed for SD
#if HAS_MEDIA && !defined(SD_SPI_SPEED)
#define SD_SPI_SPEED SPI_FULL_SPEED
#endif
#if HAS_WIRED_LCD
// Get LCD character width/height, which may be overridden by pins, configs, etc.
#ifndef LCD_WIDTH
#if HAS_MARLINUI_U8GLIB
#define LCD_WIDTH 21
#elif IS_DWIN_MARLINUI
// Defined by header
#else
#define LCD_WIDTH TERN(IS_ULTIPANEL, 20, 16)
#endif
#endif
#ifndef LCD_HEIGHT
#if HAS_MARLINUI_U8GLIB
#define LCD_HEIGHT 5
#elif IS_DWIN_MARLINUI
// Defined by header
#else
#define LCD_HEIGHT TERN(IS_ULTIPANEL, 4, 2)
#endif
#endif
#endif
#if BUTTONS_EXIST(EN1, EN2, ENC)
#define HAS_ROTARY_ENCODER 1
#endif
#if PIN_EXISTS(SAFE_POWER) && DISABLED(DISABLE_DRIVER_SAFE_POWER_PROTECT)
#define HAS_DRIVER_SAFE_POWER_PROTECT 1
#endif
#if ANY(ENDSTOPPULLDOWNS, ENDSTOPPULLDOWN_ZMIN_PROBE, \
ENDSTOPPULLDOWN_XMIN, ENDSTOPPULLDOWN_YMIN, ENDSTOPPULLDOWN_ZMIN, \
ENDSTOPPULLDOWN_IMIN, ENDSTOPPULLDOWN_JMIN, ENDSTOPPULLDOWN_KMIN, \
ENDSTOPPULLDOWN_XMAX, ENDSTOPPULLDOWN_YMAX, ENDSTOPPULLDOWN_ZMAX, \
ENDSTOPPULLDOWN_IMAX, ENDSTOPPULLDOWN_JMAX, ENDSTOPPULLDOWN_KMAX, \
POWER_LOSS_PULLDOWN, CALIBRATION_PIN_PULLDOWN, FIL_RUNOUT_PULLDOWN, \
FIL_RUNOUT1_PULLDOWN, FIL_RUNOUT2_PULLDOWN, FIL_RUNOUT3_PULLDOWN, FIL_RUNOUT4_PULLDOWN, \
FIL_RUNOUT5_PULLDOWN, FIL_RUNOUT6_PULLDOWN, FIL_RUNOUT7_PULLDOWN, FIL_RUNOUT8_PULLDOWN)
#define USING_PULLDOWNS 1
#endif
// Machine UUID can come from STM32 CPU Serial Number
#ifdef MACHINE_UUID
#undef HAS_STM32_UID
#elif !HAS_STM32_UID && defined(DEFAULT_MACHINE_UUID)
#define MACHINE_UUID DEFAULT_MACHINE_UUID
#endif
// Flag whether hex_print.cpp is needed
#if ANY(AUTO_BED_LEVELING_UBL, M100_FREE_MEMORY_WATCHER, DEBUG_GCODE_PARSER, TMC_DEBUG, MARLIN_DEV_MODE, DEBUG_CARDREADER, M20_TIMESTAMP_SUPPORT, HAS_STM32_UID)
#define NEED_HEX_PRINT 1
#endif
|
2301_81045437/Marlin
|
Marlin/src/inc/Conditionals_post.h
|
C
|
agpl-3.0
| 92,928
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2024 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/>.
*
*/
#pragma once
/**
* Conditionals_type.h
* Internal defines that depend on Configurations and Pins but are not user-editable.
* Define conditionals in this file if they depend on core/types.h.
*/
#ifdef GITHUB_ACTIONS
// Extras for CI testing
#endif
|
2301_81045437/Marlin
|
Marlin/src/inc/Conditionals_type.h
|
C
|
agpl-3.0
| 1,118
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#pragma once
//
// Prefix header for all Marlin sources
//
#include "MarlinConfigPre.h"
#ifdef __MARLIN_DEPS__
#include "../HAL/shared/fauxpins.h"
#else
#include "../HAL/HAL.h"
#endif
#include "../pins/pins.h"
#ifndef __MARLIN_DEPS__
#include HAL_PATH(.., timers.h)
#include HAL_PATH(.., spi_pins.h)
#endif
#include "Conditionals_post.h"
#ifndef __MARLIN_DEPS__
#include HAL_PATH(.., inc/Conditionals_post.h)
#include "../core/types.h" // Ahead of sanity-checks
#include "Conditionals_type.h"
#include HAL_PATH(.., inc/Conditionals_type.h)
#include "Changes.h"
#include "SanityCheck.h"
#include HAL_PATH(.., inc/SanityCheck.h)
// Include all core headers
#include "../core/language.h"
#include "../core/utility.h"
#include "../core/mstring.h"
#include "../core/serial.h"
#include "../core/endianness.h"
#endif
#include "../core/multi_language.h"
|
2301_81045437/Marlin
|
Marlin/src/inc/MarlinConfig.h
|
C
|
agpl-3.0
| 1,757
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#pragma once
#ifndef __MARLIN_FIRMWARE__
#define __MARLIN_FIRMWARE__
#endif
//
// Prefix header to acquire configurations
//
#include <stdint.h>
#ifndef __MARLIN_DEPS__
#include "../HAL/platforms.h"
#endif
#include "../core/macros.h"
#include "../core/boards.h"
#include "../../Configuration.h"
#ifdef CUSTOM_VERSION_FILE
#if __has_include(STRINGIFY(../../CUSTOM_VERSION_FILE))
#include STRINGIFY(../../CUSTOM_VERSION_FILE)
#endif
#endif
#include "Version.h"
#include "Conditionals_LCD.h"
#ifndef __MARLIN_DEPS__
#include HAL_PATH(.., inc/Conditionals_LCD.h)
#endif
#include "../core/drivers.h"
#include "../../Configuration_adv.h"
#include "Conditionals_adv.h"
#ifndef __MARLIN_DEPS__
#include HAL_PATH(.., inc/Conditionals_adv.h)
#endif
|
2301_81045437/Marlin
|
Marlin/src/inc/MarlinConfigPre.h
|
C
|
agpl-3.0
| 1,626
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#pragma once
/**
* SanityCheck.h
*
* Test configuration values for errors at compile-time.
*/
/**
* Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features.
*/
#if __cplusplus < 201103L
#error "Marlin requires C++11 support (gcc >= 4.7, Arduino IDE >= 1.6.8). Please upgrade your toolchain."
#endif
// Strings for sanity check messages
#define _NUM_AXES_STR NUM_AXIS_GANG("X ", "Y ", "Z ", "I ", "J ", "K ", "U ", "V ", "W ")
#define _LOGICAL_AXES_STR LOGICAL_AXIS_GANG("E ", "X ", "Y ", "Z ", "I ", "J ", "K ", "U ", "V ", "W ")
// Make sure macros aren't borked
#define TEST1
#define TEST2 1
#define TEST3 0
#define TEST4 true
#if ENABLED(TEST0) || !ENABLED(TEST2) || ENABLED(TEST3) || !ENABLED(TEST1, TEST2, TEST4)
#error "ENABLED is borked!"
#endif
#if ALL(TEST0, TEST1)
#error "ALL is borked!"
#endif
#if DISABLED(TEST1) || !DISABLED(TEST3) || DISABLED(TEST4) || DISABLED(TEST0, TEST1, TEST2, TEST4) || !DISABLED(TEST0, TEST3)
#error "DISABLED is borked!"
#endif
#if !ANY(TEST1, TEST2, TEST3, TEST4) || ANY(TEST0, TEST3)
#error "ANY is borked!"
#endif
#if NONE(TEST0, TEST1, TEST2, TEST4) || !NONE(TEST0, TEST3)
#error "NONE is borked!"
#endif
#undef TEST1
#undef TEST2
#undef TEST3
#undef TEST4
/**
* This is to alert you about non-matching versions of config files.
*
* You can edit the version tag in your old config files and try the build again.
* The checks below will alert you about options that need to be changed, but they won't
* tell you about new options that you might find useful. So it's recommended to transfer
* your settings to new Configuration files matching your Marlin version as soon as possible.
*/
#define HEXIFY(H) _CAT(0x,H)
#if !defined(CONFIGURATION_H_VERSION) || HEXIFY(CONFIGURATION_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_H_VERSION)
#error "Your Configuration.h file is for an old version of Marlin. Downgrade Marlin or upgrade your Configuration.h."
#elif HEXIFY(CONFIGURATION_H_VERSION) > HEXIFY(REQUIRED_CONFIGURATION_H_VERSION)
#error "Your Configuration.h file is for a newer version of Marlin. Upgrade Marlin or downgrade your Configuration.h."
#endif
#if !defined(CONFIGURATION_ADV_H_VERSION) || HEXIFY(CONFIGURATION_ADV_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION)
#error "Your Configuration_adv.h file is for an old version of Marlin. Downgrade Marlin or upgrade your Configuration_adv.h."
#elif HEXIFY(CONFIGURATION_ADV_H_VERSION) > HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION)
#error "Your Configuration_adv.h file is for a newer version of Marlin. Upgrade Marlin or downgrade your Configuration_adv.h."
#endif
#undef HEXIFY
/**
* Warnings for old configurations
*/
#ifndef MOTHERBOARD
#error "MOTHERBOARD is required. You must '#define MOTHERBOARD BOARD_MYNAME' (not just '#define BOARD_MYNAME')."
#endif
/**
* Required Version defines
*/
#ifndef SHORT_BUILD_VERSION
#error "SHORT_BUILD_VERSION must be specified."
#elif !defined(DETAILED_BUILD_VERSION)
#error "BUILD_VERSION must be specified."
#elif !defined(STRING_DISTRIBUTION_DATE)
#error "STRING_DISTRIBUTION_DATE must be specified."
#elif !defined(PROTOCOL_VERSION)
#error "PROTOCOL_VERSION must be specified."
#elif !defined(MACHINE_NAME)
#error "MACHINE_NAME must be specified."
#elif !defined(SOURCE_CODE_URL)
#error "SOURCE_CODE_URL must be specified."
#elif !defined(DEFAULT_MACHINE_UUID)
#error "DEFAULT_MACHINE_UUID must be specified."
#elif !defined(WEBSITE_URL)
#error "WEBSITE_URL must be specified."
#endif
// Check AXIS_RELATIVE_MODES
constexpr float arm[] = AXIS_RELATIVE_MODES;
static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements.");
/**
* RADDS is forbidden for non-DUE boards, for now.
*/
#if ENABLED(RADDS_DISPLAY) && !defined(__SAM3X8E__)
#error "RADDS_DISPLAY is currently only incompatible with DUE boards."
#endif
/**
* Heated Bed requirements
*/
#if HAS_HEATED_BED
#if !HAS_TEMP_BED
#error "The Heated Bed requires a TEMP_BED_PIN or Thermocouple."
#elif !HAS_HEATER_BED
#error "The Heated Bed requires HEATER_BED_PIN."
#endif
#endif
/**
* Hephestos 2 Heated Bed Kit requirements
*/
#if ENABLED(HEPHESTOS2_HEATED_BED_KIT)
#if TEMP_SENSOR_BED != 70
#error "HEPHESTOS2_HEATED_BED_KIT requires TEMP_SENSOR_BED 70."
#elif DISABLED(HEATER_BED_INVERTING)
#error "HEPHESTOS2_HEATED_BED_KIT requires HEATER_BED_INVERTING."
#endif
#endif
/**
* Probe temp compensation requirements
*/
#if HAS_PTC
#if TEMP_SENSOR_PROBE && TEMP_SENSOR_BED && !(defined(PTC_PARK_POS) && defined(PTC_PROBE_POS))
#error "PTC_PARK_POS and PTC_PROBE_POS are required for Probe Temperature Compensation."
#endif
#if ENABLED(PTC_PROBE)
#if !TEMP_SENSOR_PROBE
#error "PTC_PROBE requires a probe with a thermistor."
#endif
#ifdef PTC_PROBE_START
constexpr auto _ptc_sample_start = PTC_PROBE_START;
constexpr decltype(_ptc_sample_start) _test_ptc_sample_start = 12.3f;
static_assert(_test_ptc_sample_start != 12.3f, "PTC_PROBE_START must be a whole number.");
#endif
#ifdef PTC_PROBE_RES
constexpr auto _ptc_sample_res = PTC_PROBE_RES;
constexpr decltype(_ptc_sample_res) _test_ptc_sample_res = 12.3f;
static_assert(_test_ptc_sample_res != 12.3f, "PTC_PROBE_RES must be a whole number.");
#endif
#if ENABLED(PTC_BED) && defined(PTC_PROBE_TEMP)
constexpr auto _btc_probe_temp = PTC_PROBE_TEMP;
constexpr decltype(_btc_probe_temp) _test_btc_probe_temp = 12.3f;
static_assert(_test_btc_probe_temp != 12.3f, "PTC_PROBE_TEMP must be a whole number.");
#endif
#endif
#if ENABLED(PTC_BED)
#if !TEMP_SENSOR_BED
#error "PTC_BED requires a bed with a thermistor."
#endif
#ifdef PTC_BED_START
constexpr auto _btc_sample_start = PTC_BED_START;
constexpr decltype(_btc_sample_start) _test_btc_sample_start = 12.3f;
static_assert(_test_btc_sample_start != 12.3f, "PTC_BED_START must be a whole number.");
#endif
#ifdef PTC_BED_RES
constexpr auto _btc_sample_res = PTC_BED_RES;
constexpr decltype(_btc_sample_res) _test_btc_sample_res = 12.3f;
static_assert(_test_btc_sample_res != 12.3f, "PTC_BED_RES must be a whole number.");
#endif
#endif
#if ENABLED(PTC_HOTEND)
#if EXTRUDERS != 1
#error "PTC_HOTEND requires a single extruder."
#endif
#ifdef PTC_HOTEND_START
constexpr auto _etc_sample_start = PTC_HOTEND_START;
constexpr decltype(_etc_sample_start) _test_etc_sample_start = 12.3f;
static_assert(_test_etc_sample_start != 12.3f, "PTC_HOTEND_START must be a whole number.");
#endif
#ifdef PTC_HOTEND_RES
constexpr auto _etc_sample_res = PTC_HOTEND_RES;
constexpr decltype(_etc_sample_res) _test_etc_sample_res = 12.3f;
static_assert(_test_etc_sample_res != 12.3f, "PTC_HOTEND_RES must be a whole number.");
#endif
#endif
#endif // HAS_PTC
/**
* Serial
*/
#ifndef SERIAL_PORT
#error "SERIAL_PORT must be defined."
#elif defined(SERIAL_PORT_2) && SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 cannot be the same as SERIAL_PORT."
#elif defined(SERIAL_PORT_3)
#ifndef SERIAL_PORT_2
#error "Use SERIAL_PORT_2 before using SERIAL_PORT_3"
#elif SERIAL_PORT_3 == SERIAL_PORT
#error "SERIAL_PORT_3 cannot be the same as SERIAL_PORT."
#elif SERIAL_PORT_3 == SERIAL_PORT_2
#error "SERIAL_PORT_3 cannot be the same as SERIAL_PORT_2."
#endif
#endif
#if !(defined(__AVR__) && defined(USBCON))
#if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024
#error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
#elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE))
#error "RX_BUFFER_SIZE must be a power of 2 greater than 1."
#elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
#error "TX_BUFFER_SIZE must be 0 or a power of 2 between 1 and 256."
#endif
#elif ANY(SERIAL_XON_XOFF, SERIAL_STATS_MAX_RX_QUEUED, SERIAL_STATS_DROPPED_RX)
#error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices."
#endif
// Serial DMA is only available for some STM32 MCUs and HC32
#if ENABLED(SERIAL_DMA)
#if defined(ARDUINO_ARCH_HC32)
// checks for HC32 are located in HAL/HC32/inc/SanityCheck.h
#elif !HAL_STM32 || NONE(STM32F0xx, STM32F1xx, STM32F2xx, STM32F4xx, STM32F7xx)
#error "SERIAL_DMA is only available for some STM32 MCUs and requires HAL/STM32."
#elif !defined(HAL_UART_MODULE_ENABLED) || defined(HAL_UART_MODULE_ONLY)
#error "SERIAL_DMA requires STM32 platform HAL UART (without HAL_UART_MODULE_ONLY)."
#endif
#endif
/**
* Multiple Stepper Drivers Per Axis
*/
#define GOOD_AXIS_PINS(A) PINS_EXIST(A##_ENABLE, A##_STEP, A##_DIR)
#if HAS_X2_STEPPER && !GOOD_AXIS_PINS(X2)
#error "If X2_DRIVER_TYPE is defined, then X2 ENABLE/STEP/DIR pins are also needed."
#endif
#if HAS_Y2_STEPPER && !GOOD_AXIS_PINS(Y2)
#error "If Y2_DRIVER_TYPE is defined, then Y2 ENABLE/STEP/DIR pins are also needed."
#endif
#if HAS_Z_AXIS
#if NUM_Z_STEPPERS >= 2 && !GOOD_AXIS_PINS(Z2)
#error "If Z2_DRIVER_TYPE is defined, then Z2 ENABLE/STEP/DIR pins are also needed."
#elif NUM_Z_STEPPERS >= 3 && !GOOD_AXIS_PINS(Z3)
#error "If Z3_DRIVER_TYPE is defined, then Z3 ENABLE/STEP/DIR pins are also needed."
#elif NUM_Z_STEPPERS >= 4 && !GOOD_AXIS_PINS(Z4)
#error "If Z4_DRIVER_TYPE is defined, then Z4 ENABLE/STEP/DIR pins are also needed."
#endif
#endif
/**
* Validate bed size
*/
#if !defined(X_BED_SIZE) || !defined(Y_BED_SIZE)
#error "X_BED_SIZE and Y_BED_SIZE are required!"
#else
#if HAS_X_AXIS
static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS) are too narrow to contain X_BED_SIZE.");
#endif
#if HAS_Y_AXIS
static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS) are too narrow to contain Y_BED_SIZE.");
#endif
#endif
/**
* Granular software endstops (Marlin >= 1.1.7)
*/
#if ENABLED(MIN_SOFTWARE_ENDSTOPS) && NONE(MIN_SOFTWARE_ENDSTOP_Z, POLARGRAPH)
#if IS_KINEMATIC
#error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z."
#elif NONE(MIN_SOFTWARE_ENDSTOP_X, MIN_SOFTWARE_ENDSTOP_Y)
#error "MIN_SOFTWARE_ENDSTOPS requires at least one of the MIN_SOFTWARE_ENDSTOP_[XYZ] options."
#endif
#endif
#if ENABLED(MAX_SOFTWARE_ENDSTOPS) && NONE(MAX_SOFTWARE_ENDSTOP_Z, POLARGRAPH)
#if IS_KINEMATIC
#error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z."
#elif NONE(MAX_SOFTWARE_ENDSTOP_X, MAX_SOFTWARE_ENDSTOP_Y)
#error "MAX_SOFTWARE_ENDSTOPS requires at least one of the MAX_SOFTWARE_ENDSTOP_[XYZ] options."
#endif
#endif
#if ALL(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS)
#error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS."
#elif ALL(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN)
#error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN."
#elif ALL(ENDSTOPPULLUP_XMAX, ENDSTOPPULLDOWN_XMAX)
#error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX."
#elif ALL(ENDSTOPPULLUP_YMAX, ENDSTOPPULLDOWN_YMAX)
#error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX."
#elif ALL(ENDSTOPPULLUP_ZMAX, ENDSTOPPULLDOWN_ZMAX)
#error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX."
#elif ALL(ENDSTOPPULLUP_IMAX, ENDSTOPPULLDOWN_IMAX)
#error "Enable only one of ENDSTOPPULLUP_I_MAX or ENDSTOPPULLDOWN_I_MAX."
#elif ALL(ENDSTOPPULLUP_JMAX, ENDSTOPPULLDOWN_JMAX)
#error "Enable only one of ENDSTOPPULLUP_J_MAX or ENDSTOPPULLDOWN_J_MAX."
#elif ALL(ENDSTOPPULLUP_KMAX, ENDSTOPPULLDOWN_KMAX)
#error "Enable only one of ENDSTOPPULLUP_K_MAX or ENDSTOPPULLDOWN_K_MAX."
#elif ALL(ENDSTOPPULLUP_UMAX, ENDSTOPPULLDOWN_UMAX)
#error "Enable only one of ENDSTOPPULLUP_U_MAX or ENDSTOPPULLDOWN_U_MAX."
#elif ALL(ENDSTOPPULLUP_VMAX, ENDSTOPPULLDOWN_VMAX)
#error "Enable only one of ENDSTOPPULLUP_V_MAX or ENDSTOPPULLDOWN_V_MAX."
#elif ALL(ENDSTOPPULLUP_WMAX, ENDSTOPPULLDOWN_WMAX)
#error "Enable only one of ENDSTOPPULLUP_W_MAX or ENDSTOPPULLDOWN_W_MAX."
#elif ALL(ENDSTOPPULLUP_XMIN, ENDSTOPPULLDOWN_XMIN)
#error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN."
#elif ALL(ENDSTOPPULLUP_YMIN, ENDSTOPPULLDOWN_YMIN)
#error "Enable only one of ENDSTOPPULLUP_Y_MIN or ENDSTOPPULLDOWN_Y_MIN."
#elif ALL(ENDSTOPPULLUP_ZMIN, ENDSTOPPULLDOWN_ZMIN)
#error "Enable only one of ENDSTOPPULLUP_Z_MIN or ENDSTOPPULLDOWN_Z_MIN."
#elif ALL(ENDSTOPPULLUP_IMIN, ENDSTOPPULLDOWN_IMIN)
#error "Enable only one of ENDSTOPPULLUP_I_MIN or ENDSTOPPULLDOWN_I_MIN."
#elif ALL(ENDSTOPPULLUP_JMIN, ENDSTOPPULLDOWN_JMIN)
#error "Enable only one of ENDSTOPPULLUP_J_MIN or ENDSTOPPULLDOWN_J_MIN."
#elif ALL(ENDSTOPPULLUP_KMIN, ENDSTOPPULLDOWN_KMIN)
#error "Enable only one of ENDSTOPPULLUP_K_MIN or ENDSTOPPULLDOWN_K_MIN."
#elif ALL(ENDSTOPPULLUP_UMIN, ENDSTOPPULLDOWN_UMIN)
#error "Enable only one of ENDSTOPPULLUP_U_MIN or ENDSTOPPULLDOWN_U_MIN."
#elif ALL(ENDSTOPPULLUP_VMIN, ENDSTOPPULLDOWN_VMIN)
#error "Enable only one of ENDSTOPPULLUP_V_MIN or ENDSTOPPULLDOWN_V_MIN."
#elif ALL(ENDSTOPPULLUP_WMIN, ENDSTOPPULLDOWN_WMIN)
#error "Enable only one of ENDSTOPPULLUP_W_MIN or ENDSTOPPULLDOWN_W_MIN."
#endif
/**
* LCD Info Screen Style
*/
#if LCD_INFO_SCREEN_STYLE > 0
#if HAS_MARLINUI_U8GLIB || LCD_WIDTH < 20 || LCD_HEIGHT < 4
#error "Alternative LCD_INFO_SCREEN_STYLE requires 20x4 Character LCD."
#elif LCD_INFO_SCREEN_STYLE > 2
#error "LCD_INFO_SCREEN_STYLE only has options 0 (Classic), 1 (Průša), and 2 (CNC)."
#endif
#endif
/**
* Progress Bar
*/
#if ENABLED(LCD_PROGRESS_BAR)
#if NONE(HAS_MEDIA, SET_PROGRESS_MANUALLY)
#error "LCD_PROGRESS_BAR requires SDSUPPORT or SET_PROGRESS_MANUALLY."
#elif NONE(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
#error "LCD_PROGRESS_BAR only applies to HD44780 character LCD and TFTGLCD_PANEL_(SPI|I2C)."
#elif HAS_MARLINUI_U8GLIB || IS_DWIN_MARLINUI
#error "LCD_PROGRESS_BAR does not apply to graphical displays."
#elif ENABLED(FILAMENT_LCD_DISPLAY)
#error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both."
#elif PROGRESS_MSG_EXPIRE < 0
#error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0."
#endif
#endif
#if ENABLED(SET_PROGRESS_MANUALLY) && NONE(SET_PROGRESS_PERCENT, SET_REMAINING_TIME, SET_INTERACTION_TIME)
#error "SET_PROGRESS_MANUALLY requires at least one of SET_PROGRESS_PERCENT, SET_REMAINING_TIME, SET_INTERACTION_TIME to be enabled."
#endif
#if HAS_LCDPRINT && HAS_EXTRA_PROGRESS && LCD_HEIGHT < 4
#error "Displays with fewer than 4 rows can't show progress values (e.g., SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME)."
#endif
#if !HAS_MARLINUI_MENU && ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
#error "SD_REPRINT_LAST_SELECTED_FILE currently requires a Marlin-native LCD menu."
#endif
#if ANY(HAS_MARLINUI_MENU, TOUCH_UI_FTDI_EVE, EXTENSIBLE_UI, DWIN_LCD_PROUI) && !defined(MANUAL_FEEDRATE)
#error "MANUAL_FEEDRATE is required for ProUI, MarlinUI, ExtUI, or FTDI EVE Touch UI."
#endif
/**
* Custom Boot and Status screens
*/
#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE, IS_DWIN_MARLINUI)
#error "SHOW_CUSTOM_BOOTSCREEN requires Graphical LCD or TOUCH_UI_FTDI_EVE."
#elif ENABLED(SHOW_CUSTOM_BOOTSCREEN) && DISABLED(SHOW_BOOTSCREEN)
#error "SHOW_CUSTOM_BOOTSCREEN requires SHOW_BOOTSCREEN."
#elif ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && !HAS_MARLINUI_U8GLIB
#error "CUSTOM_STATUS_SCREEN_IMAGE requires a 128x64 DOGM B/W Graphical LCD."
#endif
#if ALL(STATUS_HEAT_PERCENT, STATUS_HEAT_POWER)
#error "Only enable STATUS_HEAT_PERCENT or STATUS_HEAT_POWER, but not both."
#endif
/**
* LCD Lightweight Screen Style
*/
#if ENABLED(LIGHTWEIGHT_UI) && !IS_U8GLIB_ST7920
#error "LIGHTWEIGHT_UI requires a U8GLIB_ST7920-based display."
#endif
/**
* SD Card Settings
*/
#if ALL(HAS_MEDIA, HAS_SD_DETECT, SD_CONNECTION_TYPICAL, ELB_FULL_GRAPHIC_CONTROLLER, HAS_MARLINUI_MENU) && SD_DETECT_STATE == LOW
#error "SD_DETECT_STATE must be set HIGH for SD on the ELB_FULL_GRAPHIC_CONTROLLER."
#endif
#undef SD_CONNECTION_TYPICAL
/**
* SD File Sorting
*/
#if ENABLED(SDCARD_SORT_ALPHA)
#if NONE(EXTENSIBLE_UI, HAS_MARLINUI_MENU, DWIN_CREALITY_LCD, DWIN_CREALITY_LCD_JYERSUI, DWIN_LCD_PROUI)
#error "SDCARD_SORT_ALPHA requires an LCD that supports it. (It doesn't apply to M20, etc.)"
#elif SDSORT_LIMIT > 256
#error "SDSORT_LIMIT must be 256 or smaller."
#elif SDSORT_LIMIT < 10
#error "SDSORT_LIMIT should be greater than 9 to be useful."
#elif ENABLED(SDSORT_DYNAMIC_RAM) && DISABLED(SDSORT_USES_RAM)
#error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)."
#elif ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_USES_RAM)
#error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)."
#elif ENABLED(SDSORT_DYNAMIC_RAM) && DISABLED(SDSORT_CACHE_NAMES)
#error "SDSORT_DYNAMIC_RAM requires SDSORT_CACHE_NAMES."
#endif
#if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM)
#if SDSORT_CACHE_VFATS < 2
#error "SDSORT_CACHE_VFATS must be 2 or greater!"
#elif SDSORT_CACHE_VFATS > VFAT_ENTRIES_LIMIT
#undef SDSORT_CACHE_VFATS
#define SDSORT_CACHE_VFATS VFAT_ENTRIES_LIMIT
#define SDSORT_CACHE_VFATS_WARNING 1
#endif
#endif
#endif
/**
* Custom Event G-code
*/
#if defined(EVENT_GCODE_SD_ABORT) && DISABLED(NOZZLE_PARK_FEATURE)
static_assert(nullptr == strstr(EVENT_GCODE_SD_ABORT, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_ABORT.");
#endif
#if ANY(TC_GCODE_USE_GLOBAL_X, TC_GCODE_USE_GLOBAL_Y, TC_GCODE_USE_GLOBAL_Z) && ENABLED(NO_WORKSPACE_OFFSETS)
#error "TC_GCODE_USE_GLOBAL_* options are incompatible with NO_WORKSPACE_OFFSETS."
#endif
/**
* I2C Position Encoders
*/
#if ENABLED(I2C_POSITION_ENCODERS)
#if !ALL(BABYSTEPPING, BABYSTEP_XY)
#error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY."
#elif DISABLED(EDITABLE_STEPS_PER_UNIT)
#error "EDITABLE_STEPS_PER_UNIT is required for I2C_POSITION_ENCODERS."
#elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5)
#error "I2CPE_ENCODER_CNT must be between 1 and 5."
#endif
#endif
/**
* Babystepping
*/
#if ENABLED(BABYSTEPPING)
#if ENABLED(SCARA)
#error "BABYSTEPPING is not implemented for SCARA yet."
#elif ENABLED(BABYSTEP_XY) && ANY(MARKFORGED_XY, MARKFORGED_YX)
#error "BABYSTEPPING only implemented for Z axis on MarkForged."
#elif ALL(DELTA, BABYSTEP_XY)
#error "BABYSTEPPING only implemented for Z axis on deltabots."
#elif ALL(BABYSTEP_ZPROBE_OFFSET, MESH_BED_LEVELING)
#error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination"
#elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE
#error "BABYSTEP_ZPROBE_OFFSET requires a probe."
#elif ENABLED(BABYSTEP_GFX_OVERLAY) && NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI)
#error "BABYSTEP_GFX_OVERLAY requires a Graphical LCD."
#elif ENABLED(BABYSTEP_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET)
#error "BABYSTEP_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
#elif ENABLED(BABYSTEP_HOTEND_Z_OFFSET) && !HAS_HOTEND_OFFSET
#error "BABYSTEP_HOTEND_Z_OFFSET requires 2 or more HOTENDS."
#elif ALL(BABYSTEP_ALWAYS_AVAILABLE, MOVE_Z_WHEN_IDLE)
#error "BABYSTEP_ALWAYS_AVAILABLE and MOVE_Z_WHEN_IDLE are incompatible."
#elif !defined(BABYSTEP_MULTIPLICATOR_Z)
#error "BABYSTEPPING requires BABYSTEP_MULTIPLICATOR_Z."
#elif ENABLED(BABYSTEP_XY) && !defined(BABYSTEP_MULTIPLICATOR_XY)
#error "BABYSTEP_XY requires BABYSTEP_MULTIPLICATOR_XY."
#elif ENABLED(BABYSTEP_MILLIMETER_UNITS)
static_assert(BABYSTEP_MULTIPLICATOR_Z <= 0.1f, "BABYSTEP_MULTIPLICATOR_Z must be less or equal to 0.1mm.");
#if ENABLED(BABYSTEP_XY)
static_assert(BABYSTEP_MULTIPLICATOR_XY <= 0.25f, "BABYSTEP_MULTIPLICATOR_XY must be less than or equal to 0.25mm.");
#endif
#endif
#endif
/**
* Filament Runout needs one or more pins and either SD Support or Auto print start detection
*/
#if HAS_FILAMENT_SENSOR
#if !PIN_EXISTS(FIL_RUNOUT)
#error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
#elif HAS_PRUSA_MMU2 && NUM_RUNOUT_SENSORS != 1
#error "NUM_RUNOUT_SENSORS must be 1 with MMU2 / MMU2S."
#elif NUM_RUNOUT_SENSORS != 1 && NUM_RUNOUT_SENSORS != E_STEPPERS
#error "NUM_RUNOUT_SENSORS must be either 1 or number of E steppers."
#elif NUM_RUNOUT_SENSORS >= 8 && !PIN_EXISTS(FIL_RUNOUT8)
#error "FIL_RUNOUT8_PIN is required with NUM_RUNOUT_SENSORS >= 8."
#elif NUM_RUNOUT_SENSORS >= 7 && !PIN_EXISTS(FIL_RUNOUT7)
#error "FIL_RUNOUT7_PIN is required with NUM_RUNOUT_SENSORS >= 7."
#elif NUM_RUNOUT_SENSORS >= 6 && !PIN_EXISTS(FIL_RUNOUT6)
#error "FIL_RUNOUT6_PIN is required with NUM_RUNOUT_SENSORS >= 6."
#elif NUM_RUNOUT_SENSORS >= 5 && !PIN_EXISTS(FIL_RUNOUT5)
#error "FIL_RUNOUT5_PIN is required with NUM_RUNOUT_SENSORS >= 5."
#elif NUM_RUNOUT_SENSORS >= 4 && !PIN_EXISTS(FIL_RUNOUT4)
#error "FIL_RUNOUT4_PIN is required with NUM_RUNOUT_SENSORS >= 4."
#elif NUM_RUNOUT_SENSORS >= 3 && !PIN_EXISTS(FIL_RUNOUT3)
#error "FIL_RUNOUT3_PIN is required with NUM_RUNOUT_SENSORS >= 3."
#elif NUM_RUNOUT_SENSORS >= 2 && !PIN_EXISTS(FIL_RUNOUT2)
#error "FIL_RUNOUT2_PIN is required with NUM_RUNOUT_SENSORS >= 2."
#elif ALL(FIL_RUNOUT1_PULLUP, FIL_RUNOUT1_PULLDOWN)
#error "You can't enable FIL_RUNOUT1_PULLUP and FIL_RUNOUT1_PULLDOWN at the same time."
#elif ALL(FIL_RUNOUT2_PULLUP, FIL_RUNOUT2_PULLDOWN)
#error "You can't enable FIL_RUNOUT2_PULLUP and FIL_RUNOUT2_PULLDOWN at the same time."
#elif ALL(FIL_RUNOUT3_PULLUP, FIL_RUNOUT3_PULLDOWN)
#error "You can't enable FIL_RUNOUT3_PULLUP and FIL_RUNOUT3_PULLDOWN at the same time."
#elif ALL(FIL_RUNOUT4_PULLUP, FIL_RUNOUT4_PULLDOWN)
#error "You can't enable FIL_RUNOUT4_PULLUP and FIL_RUNOUT4_PULLDOWN at the same time."
#elif ALL(FIL_RUNOUT5_PULLUP, FIL_RUNOUT5_PULLDOWN)
#error "You can't enable FIL_RUNOUT5_PULLUP and FIL_RUNOUT5_PULLDOWN at the same time."
#elif ALL(FIL_RUNOUT6_PULLUP, FIL_RUNOUT6_PULLDOWN)
#error "You can't enable FIL_RUNOUT6_PULLUP and FIL_RUNOUT6_PULLDOWN at the same time."
#elif ALL(FIL_RUNOUT7_PULLUP, FIL_RUNOUT7_PULLDOWN)
#error "You can't enable FIL_RUNOUT7_PULLUP and FIL_RUNOUT7_PULLDOWN at the same time."
#elif ALL(FIL_RUNOUT8_PULLUP, FIL_RUNOUT8_PULLDOWN)
#error "You can't enable FIL_RUNOUT8_PULLUP and FIL_RUNOUT8_PULLDOWN at the same time."
#elif FILAMENT_RUNOUT_DISTANCE_MM < 0
#error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero."
#elif DISABLED(ADVANCED_PAUSE_FEATURE) && defined(FILAMENT_RUNOUT_SCRIPT)
static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "FILAMENT_RUNOUT_SCRIPT cannot make use of M600 unless ADVANCED_PAUSE_FEATURE is enabled");
#endif
#endif
/**
* Advanced Pause
*/
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if !HAS_RESUME_CONTINUE
#error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
#elif DISABLED(NOZZLE_PARK_FEATURE)
#error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE."
#elif !defined(FILAMENT_UNLOAD_PURGE_FEEDRATE)
#error "ADVANCED_PAUSE_FEATURE requires FILAMENT_UNLOAD_PURGE_FEEDRATE."
#elif ENABLED(EXTRUDER_RUNOUT_PREVENT)
#error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE."
#elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(HAS_MEDIA, IS_NEWPANEL, EMERGENCY_PARSER)
#error "PARK_HEAD_ON_PAUSE requires HAS_MEDIA, EMERGENCY_PARSER, or an LCD controller."
#elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT)
#error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT."
#elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH
#error "FILAMENT_CHANGE_UNLOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
#elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_SLOW_LOAD_LENGTH > EXTRUDE_MAXLENGTH
#error "FILAMENT_CHANGE_SLOW_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
#elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_FAST_LOAD_LENGTH > EXTRUDE_MAXLENGTH
#error "FILAMENT_CHANGE_FAST_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
#endif
#endif
#if ENABLED(NOZZLE_PARK_FEATURE)
constexpr float npp[] = NOZZLE_PARK_POINT;
static_assert(COUNT(npp) == _MIN(NUM_AXES, XYZ), "NOZZLE_PARK_POINT requires coordinates for enabled axes, but only up to X,Y,Z.");
constexpr xyz_pos_t npp_xyz = NOZZLE_PARK_POINT;
static_assert(WITHIN(npp_xyz.x, X_MIN_POS, X_MAX_POS), "NOZZLE_PARK_POINT.X is out of bounds (X_MIN_POS, X_MAX_POS).");
static_assert(TERN1(HAS_Y_AXIS, WITHIN(npp_xyz.y, Y_MIN_POS, Y_MAX_POS)), "NOZZLE_PARK_POINT.Y is out of bounds (Y_MIN_POS, Y_MAX_POS).");
static_assert(TERN1(HAS_Z_AXIS, WITHIN(npp_xyz.z, Z_MIN_POS, Z_MAX_POS)), "NOZZLE_PARK_POINT.Z is out of bounds (Z_MIN_POS, Z_MAX_POS).");
#endif
/**
* Instant Freeze
*/
#if ENABLED(FREEZE_FEATURE) && !(PIN_EXISTS(FREEZE) && defined(FREEZE_STATE))
#error "FREEZE_FEATURE requires both FREEZE_PIN and FREEZE_STATE."
#endif
/**
* Individual axis homing is useless for DELTAS
*/
#if ALL(INDIVIDUAL_AXIS_HOMING_MENU, DELTA)
#error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
#endif
/**
* Multi-Material-Unit 2 / EXTENDABLE_EMU_MMU2 requirements
*/
#if HAS_PRUSA_MMU2
#if !HAS_EXTENDABLE_MMU && EXTRUDERS != 5
#undef SINGLENOZZLE
#error "PRUSA_MMU2(S) requires exactly 5 EXTRUDERS. Please update your Configuration."
#elif HAS_EXTENDABLE_MMU && EXTRUDERS > 15
#error "EXTRUDERS is too large for MMU(S) emulation mode. The maximum value is 15."
#elif DISABLED(NOZZLE_PARK_FEATURE)
#error "PRUSA_MMU2(S) requires NOZZLE_PARK_FEATURE. Enable it to continue."
#elif HAS_PRUSA_MMU2S && DISABLED(FILAMENT_RUNOUT_SENSOR)
#error "PRUSA_MMU2S requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
#elif ENABLED(MMU_EXTRUDER_SENSOR) && DISABLED(FILAMENT_RUNOUT_SENSOR)
#error "MMU_EXTRUDER_SENSOR requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
#elif ENABLED(MMU_EXTRUDER_SENSOR) && !HAS_MARLINUI_MENU
#error "MMU_EXTRUDER_SENSOR requires an LCD supporting MarlinUI."
#elif ENABLED(MMU2_MENUS) && !HAS_MARLINUI_MENU
#error "MMU2_MENUS requires an LCD supporting MarlinUI."
#elif DISABLED(ADVANCED_PAUSE_FEATURE)
static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "MMU2_FILAMENT_RUNOUT_SCRIPT cannot make use of M600 unless ADVANCED_PAUSE_FEATURE is enabled");
#endif
#endif
/**
* Options only for EXTRUDERS > 1
*/
#if HAS_MULTI_EXTRUDER
#ifndef MAX_EXTRUDERS
#if HAS_EXTENDABLE_MMU
#define MAX_EXTRUDERS 15
#else
#define MAX_EXTRUDERS 8
#endif
#endif
static_assert(EXTRUDERS <= MAX_EXTRUDERS, "Marlin supports a maximum of " STRINGIFY(MAX_EXTRUDERS) " EXTRUDERS.");
#undef MAX_EXTRUDERS
#if ENABLED(HEATERS_PARALLEL)
#error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
#endif
#if ENABLED(STATUS_HOTEND_INVERTED) && NONE(STATUS_HOTEND_NUMBERLESS, STATUS_HOTEND_ANIM)
#error "With multiple hotends STATUS_HOTEND_INVERTED requires STATUS_HOTEND_ANIM or STATUS_HOTEND_NUMBERLESS."
#endif
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
#ifndef TOOLCHANGE_FS_LENGTH
#error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_LENGTH."
#elif !defined(TOOLCHANGE_FS_RETRACT_SPEED)
#error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_RETRACT_SPEED."
#elif !defined(TOOLCHANGE_FS_PRIME_SPEED)
#error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_PRIME_SPEED."
#endif
#endif
#if ENABLED(TOOLCHANGE_PARK)
#ifndef TOOLCHANGE_PARK_XY
#error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY."
#elif !defined(TOOLCHANGE_PARK_XY_FEEDRATE)
#error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY_FEEDRATE."
#endif
#endif
#ifndef TOOLCHANGE_ZRAISE
#error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1."
#endif
#elif HAS_PRUSA_MMU1 || HAS_EXTENDABLE_MMU
#error "Multi-Material-Unit requires 2 or more EXTRUDERS."
#elif ENABLED(SINGLENOZZLE)
#error "SINGLENOZZLE requires 2 or more EXTRUDERS."
#if ENABLED(PID_PARAMS_PER_HOTEND)
#error "PID_PARAMS_PER_HOTEND must be disabled when using any SINGLENOZZLE extruder."
#endif
#endif
/**
* A Dual Nozzle carriage with switching servo
*/
#if ALL(SWITCHING_NOZZLE, MECHANICAL_SWITCHING_NOZZLE)
#error "Enable only one of SWITCHING_NOZZLE or MECHANICAL_SWITCHING_NOZZLE."
#elif ENABLED(MECHANICAL_SWITCHING_NOZZLE)
#if EXTRUDERS != 2
#error "MECHANICAL_SWITCHING_NOZZLE requires exactly 2 EXTRUDERS."
#elif ENABLED(DUAL_X_CARRIAGE)
#error "MECHANICAL_SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible."
#elif ENABLED(SINGLENOZZLE)
#error "MECHANICAL_SWITCHING_NOZZLE and SINGLENOZZLE are incompatible."
#elif HAS_PRUSA_MMU2
#error "MECHANICAL_SWITCHING_NOZZLE and PRUSA_MMU2(S) are incompatible."
#elif !defined(EVENT_GCODE_TOOLCHANGE_T0)
#error "MECHANICAL_SWITCHING_NOZZLE requires EVENT_GCODE_TOOLCHANGE_T0."
#elif !defined(EVENT_GCODE_TOOLCHANGE_T1)
#error "MECHANICAL_SWITCHING_NOZZLE requires EVENT_GCODE_TOOLCHANGE_T1."
#endif
#elif ENABLED(SWITCHING_NOZZLE)
#if EXTRUDERS != 2
#error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS."
#elif ENABLED(DUAL_X_CARRIAGE)
#error "SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible."
#elif ENABLED(SINGLENOZZLE)
#error "SWITCHING_NOZZLE and SINGLENOZZLE are incompatible."
#elif HAS_PRUSA_MMU2
#error "SWITCHING_NOZZLE and PRUSA_MMU2(S) are incompatible."
#elif NUM_SERVOS < 1
#error "SWITCHING_NOZZLE requires NUM_SERVOS >= 1."
#elif !defined(SWITCHING_NOZZLE_SERVO_NR)
#error "SWITCHING_NOZZLE requires SWITCHING_NOZZLE_SERVO_NR."
#elif SWITCHING_NOZZLE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
#error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
#elif SWITCHING_NOZZLE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
#error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
#elif SWITCHING_NOZZLE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
#error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
#elif SWITCHING_NOZZLE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
#error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
#endif
#ifdef SWITCHING_NOZZLE_E1_SERVO_NR
#if SWITCHING_NOZZLE_E1_SERVO_NR == SWITCHING_NOZZLE_SERVO_NR
#error "SWITCHING_NOZZLE_E1_SERVO_NR must be different from SWITCHING_NOZZLE_SERVO_NR."
#elif SWITCHING_NOZZLE_E1_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
#error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
#elif SWITCHING_NOZZLE_E1_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
#error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
#elif SWITCHING_NOZZLE_E1_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
#error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
#elif SWITCHING_NOZZLE_E1_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
#error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
#endif
#endif
#endif // SWITCHING_NOZZLE
/**
* Single Stepper Dual Extruder with switching servo
*/
#if ALL(SWITCHING_EXTRUDER, MECHANICAL_SWITCHING_EXTRUDER)
#error "Enable only one of SWITCHING_EXTRUDER or MECHANICAL_SWITCHING_EXTRUDER."
#elif ENABLED(MECHANICAL_SWITCHING_EXTRUDER)
#if EXTRUDERS < 2
#error "MECHANICAL_SWITCHING_EXTRUDER requires EXTRUDERS >= 2."
#elif !defined(EVENT_GCODE_TOOLCHANGE_T0)
#error "MECHANICAL_SWITCHING_EXTRUDER requires EVENT_GCODE_TOOLCHANGE_T0."
#elif !defined(EVENT_GCODE_TOOLCHANGE_T1)
#error "MECHANICAL_SWITCHING_EXTRUDER requires EVENT_GCODE_TOOLCHANGE_T1."
#endif
#elif ENABLED(SWITCHING_EXTRUDER)
#if NUM_SERVOS < 1
#error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1."
#elif !defined(SWITCHING_EXTRUDER_SERVO_NR)
#error "SWITCHING_EXTRUDER requires SWITCHING_EXTRUDER_SERVO_NR."
#elif SWITCHING_EXTRUDER_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
#error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
#elif SWITCHING_EXTRUDER_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
#error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
#elif SWITCHING_EXTRUDER_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
#error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
#elif SWITCHING_EXTRUDER_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
#error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
#endif
#if EXTRUDERS > 3
#if NUM_SERVOS < 2
#error "SWITCHING_EXTRUDER with 4 extruders requires NUM_SERVOS >= 2."
#elif SWITCHING_EXTRUDER_E23_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
#error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
#elif SWITCHING_EXTRUDER_E23_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
#error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
#elif SWITCHING_EXTRUDER_E23_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
#error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
#elif SWITCHING_EXTRUDER_E23_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
#error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
#elif SWITCHING_EXTRUDER_E23_SERVO_NR == SWITCHING_EXTRUDER_SERVO_NR
#error "SWITCHING_EXTRUDER_E23_SERVO_NR should be a different extruder from SWITCHING_EXTRUDER_SERVO_NR."
#endif
#elif EXTRUDERS < 2
#error "SWITCHING_EXTRUDER requires EXTRUDERS >= 2."
#endif
#endif // SWITCHING_EXTRUDER
/**
* Mixing Extruder requirements
*/
#if ENABLED(MIXING_EXTRUDER)
#if HAS_MULTI_EXTRUDER
#error "For MIXING_EXTRUDER set MIXING_STEPPERS > 1 instead of EXTRUDERS > 1."
#elif MIXING_STEPPERS < 2
#error "You must set MIXING_STEPPERS >= 2 for a mixing extruder."
#elif ENABLED(FILAMENT_WIDTH_SENSOR)
#error "MIXING_EXTRUDER is incompatible with FILAMENT_WIDTH_SENSOR. Comment out this line to use it anyway."
#elif HAS_SWITCHING_EXTRUDER
#error "MIXING_EXTRUDER is incompatible with (MECHANICAL_)SWITCHING_EXTRUDER."
#elif ENABLED(SINGLENOZZLE)
#error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE."
#elif ENABLED(DISABLE_OTHER_EXTRUDERS)
#error "MIXING_EXTRUDER is incompatible with DISABLE_OTHER_EXTRUDERS."
#elif HAS_FILAMENT_RUNOUT_DISTANCE
#error "MIXING_EXTRUDER is incompatible with FILAMENT_RUNOUT_DISTANCE_MM."
#endif
#endif
/**
* Dual E Steppers requirements
*/
#if ENABLED(E_DUAL_STEPPER_DRIVERS)
#if EXTRUDERS > 1
#error "E_DUAL_STEPPER_DRIVERS can only be used with EXTRUDERS set to 1."
#elif ENABLED(MIXING_EXTRUDER)
#error "E_DUAL_STEPPER_DRIVERS is incompatible with MIXING_EXTRUDER."
#elif HAS_SWITCHING_EXTRUDER
#error "E_DUAL_STEPPER_DRIVERS is incompatible with (MECHANICAL_)SWITCHING_EXTRUDER."
#endif
#endif
/**
* Linear Advance 1.5 - Check K value range
*/
#if ENABLED(LIN_ADVANCE)
#if DISTINCT_E > 1
constexpr float lak[] = ADVANCE_K;
static_assert(COUNT(lak) <= DISTINCT_E, "The ADVANCE_K array has too many elements (i.e., more than " STRINGIFY(DISTINCT_E) ").");
#define _LIN_ASSERT(N) static_assert(N >= COUNT(lak) || WITHIN(lak[N], 0, 10), "ADVANCE_K values must be from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9).");
REPEAT(DISTINCT_E, _LIN_ASSERT)
#undef _LIN_ASSERT
#else
static_assert(WITHIN(ADVANCE_K, 0, 10), "ADVANCE_K must be from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9).");
#endif
#if ENABLED(DIRECT_STEPPING)
#error "DIRECT_STEPPING is incompatible with LIN_ADVANCE. (Extrusion is controlled externally by the Step Daemon.)"
#endif
#endif
/**
* Nonlinear Extrusion requirements
*/
#if ENABLED(NONLINEAR_EXTRUSION)
#if DISABLED(ADAPTIVE_STEP_SMOOTHING)
#error "ADAPTIVE_STEP_SMOOTHING is required for NONLINEAR_EXTRUSION."
#elif HAS_MULTI_EXTRUDER
#error "NONLINEAR_EXTRUSION doesn't currently support multi-extruder setups."
#elif DISABLED(CPU_32_BIT)
#error "NONLINEAR_EXTRUSION requires a 32-bit CPU."
#endif
#endif
/**
* Special tool-changing options
*/
#if MANY(SINGLENOZZLE, DUAL_X_CARRIAGE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
#error "Please select only one of SINGLENOZZLE, DUAL_X_CARRIAGE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, or ELECTROMAGNETIC_SWITCHING_TOOLHEAD."
#endif
/**
* (Magnetic) Parking Extruder requirements
*/
#if ANY(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER)
#if ENABLED(EXT_SOLENOID)
#error "(MAGNETIC_)PARKING_EXTRUDER and EXT_SOLENOID are incompatible. (Pins are used twice.)"
#elif EXTRUDERS != 2
#error "(MAGNETIC_)PARKING_EXTRUDER requires exactly 2 EXTRUDERS."
#elif !defined(PARKING_EXTRUDER_PARKING_X)
#error "(MAGNETIC_)PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X."
#elif !defined(TOOLCHANGE_ZRAISE)
#error "(MAGNETIC_)PARKING_EXTRUDER requires TOOLCHANGE_ZRAISE."
#elif TOOLCHANGE_ZRAISE < 0
#error "TOOLCHANGE_ZRAISE must be 0 or higher."
#elif ENABLED(PARKING_EXTRUDER)
#if !PINS_EXIST(SOL0, SOL1)
#error "PARKING_EXTRUDER requires SOL0_PIN and SOL1_PIN."
#elif !defined(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE, LOW, HIGH)
#error "PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE must be defined as HIGH or LOW."
#elif !defined(PARKING_EXTRUDER_SOLENOIDS_DELAY) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_DELAY, 0, 2000)
#error "PARKING_EXTRUDER_SOLENOIDS_DELAY must be between 0 and 2000 (ms)."
#endif
#endif
#endif
/**
* Generic Switching Toolhead requirements
*/
#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
constexpr float thpx[] = SWITCHING_TOOLHEAD_X_POS;
static_assert(COUNT(thpx) == EXTRUDERS, "SWITCHING_TOOLHEAD_X_POS must be an array EXTRUDERS long.");
#endif
/**
* Switching Toolhead requirements
*/
#if ENABLED(SWITCHING_TOOLHEAD)
#ifndef SWITCHING_TOOLHEAD_SERVO_NR
#error "SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_SERVO_NR."
#elif EXTRUDERS < 2
#error "SWITCHING_TOOLHEAD requires at least 2 EXTRUDERS."
#elif NUM_SERVOS < (SWITCHING_TOOLHEAD_SERVO_NR - 1)
#if SWITCHING_TOOLHEAD_SERVO_NR == 0
#error "A SWITCHING_TOOLHEAD_SERVO_NR of 0 requires NUM_SERVOS >= 1."
#elif SWITCHING_TOOLHEAD_SERVO_NR == 1
#error "A SWITCHING_TOOLHEAD_SERVO_NR of 1 requires NUM_SERVOS >= 2."
#elif SWITCHING_TOOLHEAD_SERVO_NR == 2
#error "A SWITCHING_TOOLHEAD_SERVO_NR of 2 requires NUM_SERVOS >= 3."
#elif SWITCHING_TOOLHEAD_SERVO_NR == 3
#error "A SWITCHING_TOOLHEAD_SERVO_NR of 3 requires NUM_SERVOS >= 4."
#endif
#elif !defined(TOOLCHANGE_ZRAISE)
#error "SWITCHING_TOOLHEAD requires TOOLCHANGE_ZRAISE."
#elif TOOLCHANGE_ZRAISE < 0
#error "TOOLCHANGE_ZRAISE must be 0 or higher."
#endif
#endif
/**
* Magnetic / Electromagnetic Switching Toolhead requirements
*/
#if ANY(MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
#ifndef SWITCHING_TOOLHEAD_Y_POS
#error "(ELECTRO)?MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_POS"
#elif !defined(SWITCHING_TOOLHEAD_X_POS)
#error "(ELECTRO)?MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_X_POS"
#elif !defined(SWITCHING_TOOLHEAD_Y_CLEAR)
#error "(ELECTRO)?MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_CLEAR."
#endif
#endif
/**
* Electromagnetic Switching Toolhead requirements
*/
#if ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
#if ENABLED(EXT_SOLENOID)
#error "ELECTROMAGNETIC_SWITCHING_TOOLHEAD and EXT_SOLENOID are incompatible. (Pins are used twice.)"
#elif !PIN_EXISTS(SOL0)
#error "ELECTROMAGNETIC_SWITCHING_TOOLHEAD requires SOL0_PIN."
#elif !defined(SWITCHING_TOOLHEAD_Z_HOP)
#error "ELECTROMAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
#endif
#endif
/**
* Part-Cooling Fan Multiplexer requirements
*/
#if HAS_FANMUX && !HAS_FAN0
#error "FAN0_PIN must be defined to use Fan Multiplexing."
#elif PIN_EXISTS(FANMUX1) && !PIN_EXISTS(FANMUX0)
#error "FANMUX0_PIN must be set before FANMUX1_PIN can be set."
#elif PIN_EXISTS(FANMUX2) && !PINS_EXIST(FANMUX0, FANMUX1)
#error "FANMUX0_PIN and FANMUX1_PIN must be set before FANMUX2_PIN can be set."
#endif
// PID Fan Scaling requires a fan
#if defined(PID_FAN_SCALING) && !HAS_FAN
#error "PID_FAN_SCALING needs at least one fan enabled."
#endif
/**
* Limited user-controlled fans
*/
#if NUM_M106_FANS > FAN_COUNT
#error "The selected board doesn't support enough user-controlled fans. Reduce NUM_M106_FANS."
#endif
/**
* Limited number of servos
*/
static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) is too large. The selected board only has " STRINGIFY(NUM_SERVO_PLUGS) " servos.");
/**
* Servo deactivation depends on servo endstops, switching nozzle, or switching extruder
*/
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && NONE(HAS_Z_SERVO_PROBE, POLARGRAPH) && !defined(SWITCHING_NOZZLE_SERVO_NR) && !defined(SWITCHING_EXTRUDER_SERVO_NR) && !defined(SWITCHING_TOOLHEAD_SERVO_NR)
#error "Z_PROBE_SERVO_NR, switching nozzle, switching toolhead, switching extruder, or POLARGRAPH is required for DEACTIVATE_SERVOS_AFTER_MOVE."
#endif
/**
* Required LCD language
*/
#if HAS_MARLINUI_HD44780 && !defined(DISPLAY_CHARSET_HD44780)
#error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller."
#endif
/**
* Extruder temperature control algorithm - There can be only one!
*/
#if ALL(PIDTEMP, MPCTEMP)
#error "Only enable PIDTEMP or MPCTEMP, but not both."
#undef MPCTEMP
#undef MPC_AUTOTUNE
#undef MPC_EDIT_MENU
#undef MPC_AUTOTUNE_MENU
#endif
#if ENABLED(MPC_INCLUDE_FAN)
#if !HAS_FAN
#error "MPC_INCLUDE_FAN requires at least one fan."
#endif
#if FAN_COUNT < HOTENDS
#if COUNT_ENABLED(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) > 1
#error "Enable either MPC_FAN_0_ALL_HOTENDS or MPC_FAN_0_ACTIVE_HOTEND, not both."
#elif NONE(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND)
#error "MPC_INCLUDE_FAN requires MPC_FAN_0_ALL_HOTENDS or MPC_FAN_0_ACTIVE_HOTEND for one fan with multiple hotends."
#endif
#endif
#endif
/**
* Bed Heating Options - PID vs Limit Switching
*/
#if ALL(PIDTEMPBED, BED_LIMIT_SWITCHING)
#error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED."
#endif
// Fan Kickstart power
#if FAN_KICKSTART_TIME && !WITHIN(FAN_KICKSTART_POWER, 64, 255)
#error "FAN_KICKSTART_POWER must be an integer from 64 to 255."
#endif
/**
* Synchronous M106/M107 checks
*/
#if ENABLED(LASER_SYNCHRONOUS_M106_M107)
#if FAN_KICKSTART_TIME
#error "FAN_KICKSTART_TIME must be 0 with LASER_SYNCHRONOUS_M106_M107 (because the laser will always come on at FULL power)."
#elif FAN_MIN_PWM
#error "FAN_MIN_PWM must be 0 with LASER_SYNCHRONOUS_M106_M107 (otherwise the laser will never turn OFF)."
#endif
#endif
/**
* Chamber Heating Options - PID vs Limit Switching
*/
#if ALL(PIDTEMPCHAMBER, CHAMBER_LIMIT_SWITCHING)
#error "To use CHAMBER_LIMIT_SWITCHING you must disable PIDTEMPCHAMBER."
#endif
/**
* AUTOTEMP
*/
#if ENABLED(AUTOTEMP)
#ifndef AUTOTEMP_MIN
#error "AUTOTEMP requires AUTOTEMP_MIN."
#elif !defined(AUTOTEMP_MAX)
#error "AUTOTEMP requires AUTOTEMP_MAX."
#elif !defined(AUTOTEMP_FACTOR)
#error "AUTOTEMP requires AUTOTEMP_FACTOR."
#elif AUTOTEMP_MAX < AUTOTEMP_MIN
#error "AUTOTEMP_MAX must be greater than or equal to AUTOTEMP_MIN."
#endif
#endif
/**
* Features that require a min/max/specific steppers / axes to be enabled.
*/
#if HAS_LEVELING && !HAS_Z_AXIS
#error "Leveling in Marlin requires three or more axes, with Z as the vertical axis."
#elif ENABLED(CNC_WORKSPACE_PLANES) && !HAS_Z_AXIS
#error "CNC_WORKSPACE_PLANES currently requires a Z axis"
#elif ENABLED(DIRECT_STEPPING) && NUM_AXES > XYZ
#error "DIRECT_STEPPING does not currently support more than 3 axes (i.e., XYZ)."
#elif ENABLED(FOAMCUTTER_XYUV) && !(HAS_I_AXIS && HAS_J_AXIS)
#error "FOAMCUTTER_XYUV requires I and J steppers to be enabled."
#elif ENABLED(LINEAR_ADVANCE) && HAS_I_AXIS
#error "LINEAR_ADVANCE does not currently support the inclusion of an I axis."
#endif
/**
* Allow only extra axis codes that do not conflict with G-code parameter names
*/
#if HAS_I_AXIS
#if !defined(I_MIN_POS) || !defined(I_MAX_POS)
#error "I_MIN_POS and I_MAX_POS are required for the I axis."
#elif !defined(I_HOME_DIR)
#error "I_HOME_DIR is required for the I axis."
#elif HAS_I_ENABLE && !defined(I_ENABLE_ON)
#error "I_ENABLE_ON is required for the I stepper."
#elif !defined(INVERT_I_DIR)
#error "INVERT_I_DIR is required for the I stepper."
#endif
#endif
#if HAS_J_AXIS
#if AXIS5_NAME == AXIS4_NAME
#error "AXIS5_NAME must be unique."
#elif ENABLED(AXIS5_ROTATES) && DISABLED(AXIS4_ROTATES)
#error "AXIS5_ROTATES requires AXIS4_ROTATES."
#elif !defined(J_MIN_POS) || !defined(J_MAX_POS)
#error "J_MIN_POS and J_MAX_POS are required for the J axis."
#elif !defined(J_HOME_DIR)
#error "J_HOME_DIR is required for the J axis."
#elif HAS_J_ENABLE && !defined(J_ENABLE_ON)
#error "J_ENABLE_ON is required for the J stepper."
#elif !defined(INVERT_J_DIR)
#error "INVERT_J_DIR is required for the J stepper."
#endif
#endif
#if HAS_K_AXIS
#if AXIS6_NAME == AXIS5_NAME || AXIS6_NAME == AXIS4_NAME
#error "AXIS6_NAME must be unique."
#elif ENABLED(AXIS6_ROTATES) && DISABLED(AXIS5_ROTATES)
#error "AXIS6_ROTATES requires AXIS5_ROTATES."
#elif !defined(K_MIN_POS) || !defined(K_MAX_POS)
#error "K_MIN_POS and K_MAX_POS are required for the K axis."
#elif !defined(K_HOME_DIR)
#error "K_HOME_DIR is required for the K axis."
#elif HAS_K_ENABLE && !defined(K_ENABLE_ON)
#error "K_ENABLE_ON is required for the K stepper."
#elif !defined(INVERT_K_DIR)
#error "INVERT_K_DIR is required for the K stepper."
#endif
#endif
#if HAS_U_AXIS
#if AXIS7_NAME == AXIS6_NAME || AXIS7_NAME == AXIS5_NAME || AXIS7_NAME == AXIS4_NAME
#error "AXIS7_NAME must be unique."
#elif ENABLED(AXIS7_ROTATES) && DISABLED(AXIS6_ROTATES)
#error "AXIS7_ROTATES requires AXIS6_ROTATES."
#elif !defined(U_MIN_POS) || !defined(U_MAX_POS)
#error "U_MIN_POS and U_MAX_POS are required for the U axis."
#elif !defined(U_HOME_DIR)
#error "U_HOME_DIR is required for the U axis."
#elif HAS_U_ENABLE && !defined(U_ENABLE_ON)
#error "U_ENABLE_ON is required for the U stepper."
#elif !defined(INVERT_U_DIR)
#error "INVERT_U_DIR is required for the U stepper."
#endif
#endif
#if HAS_V_AXIS
#if AXIS8_NAME == AXIS7_NAME || AXIS8_NAME == AXIS6_NAME || AXIS8_NAME == AXIS5_NAME || AXIS8_NAME == AXIS4_NAME
#error "AXIS8_NAME must be unique."
#elif ENABLED(AXIS8_ROTATES) && DISABLED(AXIS7_ROTATES)
#error "AXIS8_ROTATES requires AXIS7_ROTATES."
#elif !defined(V_MIN_POS) || !defined(V_MAX_POS)
#error "V_MIN_POS and V_MAX_POS are required for the V axis."
#elif !defined(V_HOME_DIR)
#error "V_HOME_DIR is required for the V axis."
#elif HAS_V_ENABLE && !defined(V_ENABLE_ON)
#error "V_ENABLE_ON is required for the V stepper."
#elif !defined(INVERT_V_DIR)
#error "INVERT_V_DIR is required for the V stepper."
#endif
#endif
#if HAS_W_AXIS
#if AXIS9_NAME == AXIS8_NAME || AXIS9_NAME == AXIS7_NAME || AXIS9_NAME == AXIS6_NAME || AXIS9_NAME == AXIS5_NAME || AXIS9_NAME == AXIS4_NAME
#error "AXIS9_NAME must be unique."
#elif ENABLED(AXIS9_ROTATES) && DISABLED(AXIS8_ROTATES)
#error "AXIS9_ROTATES requires AXIS8_ROTATES."
#elif !defined(W_MIN_POS) || !defined(W_MAX_POS)
#error "W_MIN_POS and W_MAX_POS are required for the W axis."
#elif !defined(W_HOME_DIR)
#error "W_HOME_DIR is required for the W axis."
#elif HAS_W_ENABLE && !defined(W_ENABLE_ON)
#error "W_ENABLE_ON is required for the W stepper."
#elif !defined(INVERT_W_DIR)
#error "INVERT_W_DIR is required for the W stepper."
#endif
#endif
/**
* Kinematics
*/
/**
* Allow only one kinematic type to be defined
*/
#if MANY(DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, MARKFORGED_YX, ARTICULATED_ROBOT_ARM, FOAMCUTTER_XYUV, POLAR)
#error "Please enable only one of DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, MARKFORGED_YX, ARTICULATED_ROBOT_ARM, FOAMCUTTER_XYUV, or POLAR."
#endif
/**
* Delta requirements
*/
#if ENABLED(DELTA)
#if ANY(X_HOME_TO_MIN, Y_HOME_TO_MIN, Z_HOME_TO_MIN)
#error "DELTA kinematics require homing "XYZ" axes to MAX. Set [XYZ]_HOME_DIR to 1."
#elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED
#error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
#elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || HAS_MARLINUI_MENU)
#error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller."
#elif ENABLED(DELTA_CALIBRATION_MENU) && !HAS_MARLINUI_MENU
#error "DELTA_CALIBRATION_MENU requires an LCD Controller."
#elif ABL_USES_GRID
#if ((GRID_MAX_POINTS_X) & 1) == 0 || ((GRID_MAX_POINTS_Y) & 1) == 0
#error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
#elif (GRID_MAX_POINTS_X) < 3
#error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher."
#endif
#endif
#endif
/**
* Junction deviation is incompatible with kinematic systems.
*/
#if HAS_JUNCTION_DEVIATION && IS_KINEMATIC
#error "CLASSIC_JERK is required for the kinematics of DELTA, SCARA, POLAR, etc."
#endif
/**
* Some things should not be used on Belt Printers
*/
#if ALL(BELTPRINTER, HAS_LEVELING)
#error "Bed Leveling is not compatible with BELTPRINTER."
#endif
/**
* Probes
*/
/**
* Allow only one probe option to be defined
*/
#if 1 < 0 \
+ (DISABLED(BLTOUCH) && HAS_Z_SERVO_PROBE) \
+ COUNT_ENABLED(PROBE_MANUALLY, BLTOUCH, BD_SENSOR, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4, MAG_MOUNTED_PROBE, BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2)
#error "Please enable only one probe option: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, BD_SENSOR, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, MAGLEV4, MAG_MOUNTED_PROBE, BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2, or Z Servo."
#endif
#if HAS_BED_PROBE
/**
* Z_PROBE_SLED is incompatible with DELTA
*/
#if ALL(Z_PROBE_SLED, DELTA)
#error "You cannot use Z_PROBE_SLED with DELTA."
#endif
/**
* SOLENOID_PROBE requirements
*/
#if ENABLED(SOLENOID_PROBE)
#if ENABLED(EXT_SOLENOID)
#error "SOLENOID_PROBE is incompatible with EXT_SOLENOID."
#elif !HAS_SOLENOID_1
#error "SOLENOID_PROBE requires SOL1_PIN."
#endif
#endif
/**
* NUM_SERVOS is required for a Z servo probe
*/
#if HAS_Z_SERVO_PROBE
#if !NUM_SERVOS
#error "NUM_SERVOS is required for a Z servo probe (Z_PROBE_SERVO_NR)."
#elif Z_PROBE_SERVO_NR >= NUM_SERVOS
#error "Z_PROBE_SERVO_NR must be smaller than NUM_SERVOS."
#elif Z_PROBE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
#error "SERVO0_PIN must be defined for your servo or BLTOUCH probe."
#elif Z_PROBE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
#error "SERVO1_PIN must be defined for your servo or BLTOUCH probe."
#elif Z_PROBE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
#error "SERVO2_PIN must be defined for your servo or BLTOUCH probe."
#elif Z_PROBE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
#error "SERVO3_PIN must be defined for your servo or BLTOUCH probe."
#endif
#endif
#if ENABLED(BLTOUCH)
// BLTouch can't run in 5V mode with a 3.3V probe pin
#if ENABLED(BLTOUCH_SET_5V_MODE)
#define _5V(P,A,B) WITHIN(P,A,B)
#ifdef STM32F1 // STM32F103 5V-tolerant pins
#define _IS_5V_TOLERANT(P) (_5V(P,PA8,PA15) || _5V(P,PB2,PB15) || _5V(P,PC6,PC12) || _5V(P,PD0,PD15) || _5V(P,PE0,PE15) || _5V(P,PF0,PF5) || _5V(P,PF11,PF15))
#elif defined(ARDUINO_ARCH_SAM)
#define _IS_5V_TOLERANT(P) 0 // Assume no 5V tolerance
#else
#define _IS_5V_TOLERANT(P) 1 // Assume 5V tolerance
#endif
#if USE_Z_MIN_PROBE
#if !_IS_5V_TOLERANT(Z_MIN_PROBE_PIN)
#error "BLTOUCH_SET_5V_MODE is not compatible with the Z_MIN_PROBE_PIN."
#endif
#elif !_IS_5V_TOLERANT(Z_MIN_PIN)
#if !MB(CHITU3D_V6)
#error "BLTOUCH_SET_5V_MODE is not compatible with the Z_MIN_PIN."
#endif
#endif
#undef _IS_5V_TOLERANT
#undef _5V
#elif NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN, ENDSTOPPULLUP_ZMIN_PROBE)
#if USE_Z_MIN_PROBE
#error "BLTOUCH on Z_MIN_PROBE_PIN requires ENDSTOPPULLUP_ZMIN_PROBE, ENDSTOPPULLUPS, or BLTOUCH_SET_5V_MODE."
#else
#error "BLTOUCH on Z_MIN_PIN requires ENDSTOPPULLUP_ZMIN, ENDSTOPPULLUPS, or BLTOUCH_SET_5V_MODE."
#endif
#endif
#if HAS_BLTOUCH_HS_MODE
constexpr char hs[] = STRINGIFY(BLTOUCH_HS_MODE);
static_assert(!(strcmp(hs, "1") && strcmp(hs, "0x1") && strcmp(hs, "true") && strcmp(hs, "0") && strcmp(hs, "0x0") && strcmp(hs, "false")), \
"BLTOUCH_HS_MODE must now be defined as true or false, indicating the default state.");
#ifdef BLTOUCH_HS_EXTRA_CLEARANCE
static_assert(BLTOUCH_HS_EXTRA_CLEARANCE >= 0, "BLTOUCH_HS_MODE requires BLTOUCH_HS_EXTRA_CLEARANCE >= 0.");
#endif
#endif
#if BLTOUCH_DELAY < 200
#error "BLTOUCH_DELAY less than 200 is unsafe and is not supported."
#endif
#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
#error "BLTOUCH requires DEACTIVATE_SERVOS_AFTER_MOVE to be to disabled. Please update your Configuration.h file."
#endif
#if ENABLED(INVERTED_PROBE_STATE)
#if Z_MIN_PROBE_ENDSTOP_HIT_STATE != LOW
#error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_HIT_STATE LOW."
#endif
#elif Z_MIN_PROBE_ENDSTOP_HIT_STATE != HIGH
#error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_HIT_STATE HIGH."
#endif
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#if ENABLED(INVERTED_PROBE_STATE)
#if Z_MIN_ENDSTOP_HIT_STATE != LOW
#error "BLTOUCH requires Z_MIN_ENDSTOP_HIT_STATE LOW."
#endif
#elif Z_MIN_ENDSTOP_HIT_STATE != HIGH
#error "BLTOUCH requires Z_MIN_ENDSTOP_HIT_STATE HIGH."
#endif
#endif
#endif // BLTOUCH
#if ENABLED(RACK_AND_PINION_PROBE) && !(defined(Z_PROBE_DEPLOY_X) && defined(Z_PROBE_RETRACT_X))
#error "RACK_AND_PINION_PROBE requires Z_PROBE_DEPLOY_X and Z_PROBE_RETRACT_X."
#endif
/**
* Touch-MI probe requirements
*/
#if ENABLED(TOUCH_MI_PROBE)
#if DISABLED(Z_SAFE_HOMING)
#error "TOUCH_MI_PROBE requires Z_SAFE_HOMING."
#elif !defined(TOUCH_MI_RETRACT_Z)
#error "TOUCH_MI_PROBE requires TOUCH_MI_RETRACT_Z."
#elif defined(Z_AFTER_PROBING)
#error "TOUCH_MI_PROBE requires Z_AFTER_PROBING to be disabled."
#elif Z_CLEARANCE_FOR_HOMING < 10
#error "TOUCH_MI_PROBE requires Z_CLEARANCE_FOR_HOMING >= 10."
#elif DISABLED(BABYSTEP_ZPROBE_OFFSET)
#error "TOUCH_MI_PROBE requires BABYSTEPPING with BABYSTEP_ZPROBE_OFFSET."
#elif !HAS_RESUME_CONTINUE
#error "TOUCH_MI_PROBE currently requires an LCD controller or EMERGENCY_PARSER."
#endif
#if ENABLED(INVERTED_PROBE_STATE)
#if Z_MIN_PROBE_ENDSTOP_HIT_STATE != LOW
#error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_HIT_STATE LOW."
#endif
#elif Z_MIN_PROBE_ENDSTOP_HIT_STATE != HIGH
#error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_HIT_STATE HIGH."
#endif
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#if ENABLED(INVERTED_PROBE_STATE)
#if Z_MIN_ENDSTOP_HIT_STATE != LOW
#error "TOUCH_MI_PROBE requires Z_MIN_ENDSTOP_HIT_STATE LOW."
#endif
#elif Z_MIN_ENDSTOP_HIT_STATE != HIGH
#error "TOUCH_MI_PROBE requires Z_MIN_ENDSTOP_HIT_STATE HIGH."
#endif
#endif
#endif // TOUCH_MI_PROBE
/**
* Mag mounted probe requirements
*/
#if ALL(MAG_MOUNTED_PROBE, USE_PROBE_FOR_Z_HOMING) && DISABLED(Z_SAFE_HOMING)
#error "MAG_MOUNTED_PROBE requires Z_SAFE_HOMING if it's being used to home Z."
#endif
/**
* MagLev V4 probe requirements
*/
#if ENABLED(MAGLEV4)
#if !PIN_EXISTS(MAGLEV_TRIGGER)
#error "MAGLEV4 requires MAGLEV_TRIGGER_PIN to be defined."
#elif ENABLED(HOMING_Z_WITH_PROBE) && DISABLED(Z_SAFE_HOMING)
#error "MAGLEV4 requires Z_SAFE_HOMING."
#elif MAGLEV_TRIGGER_DELAY != 15
#error "MAGLEV_TRIGGER_DELAY should not be changed. Comment out this line to continue."
#endif
#endif
/**
* BIQU MicroProbe requirements
*/
#if ANY(BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2)
#if DISABLED(PROBE_ENABLE_DISABLE)
#error "BIQU MicroProbe requires PROBE_ENABLE_DISABLE."
#elif !PIN_EXISTS(PROBE_ENABLE)
#error "BIQU MicroProbe requires a PROBE_ENABLE_PIN."
#endif
#if ENABLED(BIQU_MICROPROBE_V1)
#if ENABLED(INVERTED_PROBE_STATE)
#if Z_MIN_PROBE_ENDSTOP_HIT_STATE != LOW
#error "BIQU_MICROPROBE_V1 requires Z_MIN_PROBE_ENDSTOP_HIT_STATE LOW."
#endif
#elif Z_MIN_PROBE_ENDSTOP_HIT_STATE != HIGH
#error "BIQU_MICROPROBE_V1 requires Z_MIN_PROBE_ENDSTOP_HIT_STATE HIGH."
#endif
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#if ENABLED(INVERTED_PROBE_STATE)
#if Z_MIN_ENDSTOP_HIT_STATE != LOW
#error "BIQU_MICROPROBE_V1 requires Z_MIN_ENDSTOP_HIT_STATE LOW."
#endif
#elif Z_MIN_ENDSTOP_HIT_STATE != HIGH
#error "BIQU_MICROPROBE_V1 requires Z_MIN_ENDSTOP_HIT_STATE HIGH."
#endif
#endif
#elif ENABLED(BIQU_MICROPROBE_V2)
#if ENABLED(INVERTED_PROBE_STATE)
#if Z_MIN_PROBE_ENDSTOP_HIT_STATE != HIGH
#error "BIQU_MICROPROBE_V2 requires Z_MIN_PROBE_ENDSTOP_HIT_STATE HIGH."
#endif
#elif Z_MIN_PROBE_ENDSTOP_HIT_STATE != LOW
#error "BIQU_MICROPROBE_V2 requires Z_MIN_PROBE_ENDSTOP_HIT_STATE LOW."
#endif
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#if ENABLED(INVERTED_PROBE_STATE)
#if Z_MIN_ENDSTOP_HIT_STATE != HIGH
#error "BIQU_MICROPROBE_V2 requires Z_MIN_ENDSTOP_HIT_STATE HIGH."
#endif
#elif Z_MIN_ENDSTOP_HIT_STATE != LOW
#error "BIQU_MICROPROBE_V2 requires Z_MIN_ENDSTOP_HIT_STATE LOW."
#endif
#endif
#endif
#endif // BIQU_MICROPROBE_V1 || BIQU_MICROPROBE_V2
/**
* Require pin options and pins to be defined
*/
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#if !USE_Z_MIN
#error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined."
#elif Z_MIN_PROBE_ENDSTOP_HIT_STATE != Z_MIN_ENDSTOP_HIT_STATE
#error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_HIT_STATE to match Z_MIN_PROBE_ENDSTOP_HIT_STATE."
#endif
#elif !PIN_EXISTS(Z_MIN_PROBE)
#error "Z_MIN_PROBE_PIN must be defined if Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN is not enabled."
#endif
/**
* Check for improper PROBING_MARGIN
*/
#if NONE(NOZZLE_AS_PROBE, IS_KINEMATIC)
static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0.");
static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0.");
static_assert(PROBING_MARGIN_FRONT >= 0, "PROBING_MARGIN_FRONT must be >= 0.");
static_assert(PROBING_MARGIN_LEFT >= 0, "PROBING_MARGIN_LEFT must be >= 0.");
static_assert(PROBING_MARGIN_RIGHT >= 0, "PROBING_MARGIN_RIGHT must be >= 0.");
#endif
#define _MARGIN(A) TERN(IS_KINEMATIC, PRINTABLE_RADIUS, ((A##_BED_SIZE) / 2))
static_assert(PROBING_MARGIN < _MARGIN(X), "PROBING_MARGIN is too large.");
static_assert(PROBING_MARGIN_BACK < _MARGIN(Y), "PROBING_MARGIN_BACK is too large.");
static_assert(PROBING_MARGIN_FRONT < _MARGIN(Y), "PROBING_MARGIN_FRONT is too large.");
static_assert(PROBING_MARGIN_LEFT < _MARGIN(X), "PROBING_MARGIN_LEFT is too large.");
static_assert(PROBING_MARGIN_RIGHT < _MARGIN(X), "PROBING_MARGIN_RIGHT is too large.");
#undef _MARGIN
/**
* Check for improper PROBE_OFFSET_[XYZ](MIN|MAX)
*/
#define PROBE_OFFSET_ASSERT(varname, x, min, max) static_assert(WITHIN(x, min, max), varname " must be within " STRINGIFY(min) " and " STRINGIFY(max))
#if HAS_PROBE_XY_OFFSET
PROBE_OFFSET_ASSERT("PROBE_OFFSET_XMIN", PROBE_OFFSET_XMIN, -(X_BED_SIZE), X_BED_SIZE);
PROBE_OFFSET_ASSERT("PROBE_OFFSET_XMAX", PROBE_OFFSET_XMAX, -(X_BED_SIZE), X_BED_SIZE);
PROBE_OFFSET_ASSERT("PROBE_OFFSET_YMIN", PROBE_OFFSET_YMIN, -(Y_BED_SIZE), Y_BED_SIZE);
PROBE_OFFSET_ASSERT("PROBE_OFFSET_YMAX", PROBE_OFFSET_YMAX, -(Y_BED_SIZE), Y_BED_SIZE);
#endif
PROBE_OFFSET_ASSERT("PROBE_OFFSET_ZMIN", PROBE_OFFSET_ZMIN, -(Z_MAX_POS), Z_MAX_POS);
PROBE_OFFSET_ASSERT("PROBE_OFFSET_ZMAX", PROBE_OFFSET_ZMAX, -(Z_MAX_POS), Z_MAX_POS);
/**
* Check for improper NOZZLE_AS_PROBE or NOZZLE_TO_PROBE_OFFSET
*/
constexpr xyz_pos_t sanity_nozzle_to_probe_offset = NOZZLE_TO_PROBE_OFFSET;
#if ENABLED(NOZZLE_AS_PROBE)
static_assert(sanity_nozzle_to_probe_offset.x == 0 && sanity_nozzle_to_probe_offset.y == 0,
"NOZZLE_AS_PROBE requires the XY offsets in NOZZLE_TO_PROBE_OFFSET to both be 0.");
#endif
#if HAS_PROBE_XY_OFFSET
PROBE_OFFSET_ASSERT("NOZZLE_TO_PROBE_OFFSET.x", sanity_nozzle_to_probe_offset.x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX);
PROBE_OFFSET_ASSERT("NOZZLE_TO_PROBE_OFFSET.y", sanity_nozzle_to_probe_offset.y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX);
#endif
PROBE_OFFSET_ASSERT("NOZZLE_TO_PROBE_OFFSET.z", sanity_nozzle_to_probe_offset.z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX);
#undef PROBE_OFFSET_ASSERT
/**
* Make sure Z raise values are set
*/
#ifndef Z_CLEARANCE_DEPLOY_PROBE
#error "Z_CLEARANCE_DEPLOY_PROBE is required for bed probes."
#else
static_assert(Z_CLEARANCE_DEPLOY_PROBE >= 0, "Probes require Z_CLEARANCE_DEPLOY_PROBE >= 0.");
#endif
#ifndef Z_CLEARANCE_BETWEEN_PROBES
#error "Z_CLEARANCE_BETWEEN_PROBES is required for bed probes."
#else
static_assert(Z_CLEARANCE_BETWEEN_PROBES >= 0, "Probes require Z_CLEARANCE_BETWEEN_PROBES >= 0.");
#endif
#ifdef Z_AFTER_PROBING
static_assert(Z_AFTER_PROBING >= 0, "Probes require Z_AFTER_PROBING >= 0.");
#endif
#if MULTIPLE_PROBING > 0 || EXTRA_PROBING > 0
#if MULTIPLE_PROBING == 0
#error "EXTRA_PROBING requires MULTIPLE_PROBING."
#elif MULTIPLE_PROBING < 2
#error "MULTIPLE_PROBING must be 2 or more."
#elif MULTIPLE_PROBING <= EXTRA_PROBING
#error "EXTRA_PROBING must be less than MULTIPLE_PROBING."
#endif
#endif
static_assert(Z_PROBE_LOW_POINT <= 0, "Z_PROBE_LOW_POINT must be less than or equal to 0.");
#if ENABLED(PROBE_ACTIVATION_SWITCH)
#ifndef PROBE_ACTIVATION_SWITCH_STATE
#error "PROBE_ACTIVATION_SWITCH_STATE is required for PROBE_ACTIVATION_SWITCH."
#elif !PIN_EXISTS(PROBE_ACTIVATION_SWITCH)
#error "A PROBE_ACTIVATION_SWITCH_PIN is required for PROBE_ACTIVATION_SWITCH."
#endif
#endif
#else
/**
* Require some kind of probe for bed leveling and probe testing
*/
#if HAS_ABL_NOT_UBL && !PROBE_SELECTED
#error "Auto Bed Leveling requires either PROBE_MANUALLY, SENSORLESS_PROBING, or a real probe."
#endif
#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
#error "Z_MIN_PROBE_REPEATABILITY_TEST requires a real probe."
#endif
#endif
#if ENABLED(LCD_BED_TRAMMING)
#ifndef BED_TRAMMING_INSET_LFRB
#error "LCD_BED_TRAMMING requires BED_TRAMMING_INSET_LFRB values."
#elif ENABLED(BED_TRAMMING_USE_PROBE)
#if !HAS_BED_PROBE
#error "BED_TRAMMING_USE_PROBE requires a real probe."
#elif ENABLED(SENSORLESS_PROBING)
#error "BED_TRAMMING_USE_PROBE is incompatible with SENSORLESS_PROBING."
#endif
#endif
#endif
/**
* Allow only one bed leveling option to be defined
*/
#if MANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING)
#error "Select only one of: MESH_BED_LEVELING, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
#endif
/**
* Bed Leveling Requirements
*/
#if IS_SCARA && ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL)
#error "SCARA machines can only use AUTO_BED_LEVELING_BILINEAR or MESH_BED_LEVELING."
#elif ENABLED(AUTO_BED_LEVELING_LINEAR) && !(WITHIN(GRID_MAX_POINTS_X, 2, 255) && WITHIN(GRID_MAX_POINTS_Y, 2, 255))
#error "GRID_MAX_POINTS_[XY] must be between 2 and 255 with AUTO_BED_LEVELING_LINEAR."
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR) && !(WITHIN(GRID_MAX_POINTS_X, 3, 255) && WITHIN(GRID_MAX_POINTS_Y, 3, 255))
#error "GRID_MAX_POINTS_[XY] must be between 3 and 255 with AUTO_BED_LEVELING_BILINEAR."
#elif ENABLED(AUTO_BED_LEVELING_UBL)
#if ENABLED(POLAR)
#error "AUTO_BED_LEVELING_UBL does not yet support POLAR printers."
#elif DISABLED(EEPROM_SETTINGS)
#error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS."
#elif !WITHIN(GRID_MAX_POINTS_X, 3, 255) || !WITHIN(GRID_MAX_POINTS_Y, 3, 255)
#error "GRID_MAX_POINTS_[XY] must be between 3 and 255."
#elif ALL(UBL_HILBERT_CURVE, DELTA)
#error "UBL_HILBERT_CURVE can only be used with a square / rectangular printable area."
#endif
#elif ENABLED(MESH_BED_LEVELING)
#if ENABLED(DELTA)
#error "MESH_BED_LEVELING is not compatible with DELTA printers."
#elif (GRID_MAX_POINTS_X) > 9 || (GRID_MAX_POINTS_Y) > 9
#error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL."
#endif
#endif
#define _POINT_COUNT (defined(PROBE_PT_1) + defined(PROBE_PT_2) + defined(PROBE_PT_3))
#if _POINT_COUNT != 0 && _POINT_COUNT != 3
#error "For 3-Point Procedures all XY points must be defined (or none for the defaults)."
#endif
#undef _POINT_COUNT
#if ALL(HAS_LEVELING, RESTORE_LEVELING_AFTER_G28, ENABLE_LEVELING_AFTER_G28)
#error "Only enable RESTORE_LEVELING_AFTER_G28 or ENABLE_LEVELING_AFTER_G28, but not both."
#endif
#if ALL(HAS_MESH, CLASSIC_JERK)
static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling.");
#endif
#if HAS_MESH && DGUS_LCD_UI_IA_CREALITY && GRID_MAX_POINTS > 25
#error "DGUS_LCD_UI IA_CREALITY requires a mesh with no more than 25 points as defined by GRID_MAX_POINTS_X/Y."
#endif
#if ENABLED(G26_MESH_VALIDATION)
#if !HAS_EXTRUDERS
#error "G26_MESH_VALIDATION requires at least one extruder."
#elif !HAS_MESH
#error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
#endif
#endif
#if ENABLED(MESH_EDIT_GFX_OVERLAY)
#if DISABLED(AUTO_BED_LEVELING_UBL)
#error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL."
#elif NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI)
#error "MESH_EDIT_GFX_OVERLAY requires a Graphical LCD."
#endif
#endif
#if ENABLED(G29_RETRY_AND_RECOVER) && NONE(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)
#error "G29_RETRY_AND_RECOVER requires AUTO_BED_LEVELING_3POINT, LINEAR, or BILINEAR."
#endif
/**
* LCD_BED_LEVELING requirements
*/
#if ENABLED(LCD_BED_LEVELING)
#if !HAS_MARLINUI_MENU
#error "LCD_BED_LEVELING is not supported by the selected LCD controller."
#elif !(ENABLED(MESH_BED_LEVELING) || HAS_ABL_NOT_UBL)
#error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING."
#elif ENABLED(MESH_EDIT_MENU) && !HAS_MESH
#error "MESH_EDIT_MENU requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
#endif
#endif
#if ALL(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING)
#error "Disable PREHEAT_BEFORE_LEVELING when using PREHEAT_BEFORE_PROBING."
#endif
/**
* Homing checks
*/
#ifndef HOMING_BUMP_MM
#error "Required setting HOMING_BUMP_MM is missing!"
#elif !defined(HOMING_BUMP_DIVISOR)
#error "Required setting HOMING_BUMP_DIVISOR is missing!"
#else
constexpr float hbm[] = HOMING_BUMP_MM, hbd[] = HOMING_BUMP_DIVISOR;
static_assert(COUNT(hbm) == NUM_AXES, "HOMING_BUMP_MM must have " _NUM_AXES_STR "elements (and no others).");
NUM_AXIS_CODE(
static_assert(hbm[X_AXIS] >= 0, "HOMING_BUMP_MM.X must be greater than or equal to 0."),
static_assert(hbm[Y_AXIS] >= 0, "HOMING_BUMP_MM.Y must be greater than or equal to 0."),
static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal to 0."),
static_assert(hbm[I_AXIS] >= 0, "HOMING_BUMP_MM.I must be greater than or equal to 0."),
static_assert(hbm[J_AXIS] >= 0, "HOMING_BUMP_MM.J must be greater than or equal to 0."),
static_assert(hbm[K_AXIS] >= 0, "HOMING_BUMP_MM.K must be greater than or equal to 0."),
static_assert(hbm[U_AXIS] >= 0, "HOMING_BUMP_MM.U must be greater than or equal to 0."),
static_assert(hbm[V_AXIS] >= 0, "HOMING_BUMP_MM.V must be greater than or equal to 0."),
static_assert(hbm[W_AXIS] >= 0, "HOMING_BUMP_MM.W must be greater than or equal to 0.")
);
static_assert(COUNT(hbd) == NUM_AXES, "HOMING_BUMP_DIVISOR must have " _NUM_AXES_STR "elements (and no others).");
NUM_AXIS_CODE(
static_assert(hbd[X_AXIS] >= 1, "HOMING_BUMP_DIVISOR.X must be greater than or equal to 1."),
static_assert(hbd[Y_AXIS] >= 1, "HOMING_BUMP_DIVISOR.Y must be greater than or equal to 1."),
static_assert(hbd[Z_AXIS] >= 1, "HOMING_BUMP_DIVISOR.Z must be greater than or equal to 1."),
static_assert(hbd[I_AXIS] >= 1, "HOMING_BUMP_DIVISOR.I must be greater than or equal to 1."),
static_assert(hbd[J_AXIS] >= 1, "HOMING_BUMP_DIVISOR.J must be greater than or equal to 1."),
static_assert(hbd[K_AXIS] >= 1, "HOMING_BUMP_DIVISOR.K must be greater than or equal to 1."),
static_assert(hbd[U_AXIS] >= 1, "HOMING_BUMP_DIVISOR.U must be greater than or equal to 1."),
static_assert(hbd[V_AXIS] >= 1, "HOMING_BUMP_DIVISOR.V must be greater than or equal to 1."),
static_assert(hbd[W_AXIS] >= 1, "HOMING_BUMP_DIVISOR.W must be greater than or equal to 1.")
);
#endif
#ifdef HOMING_BACKOFF_POST_MM
constexpr float hbp[] = HOMING_BACKOFF_POST_MM;
static_assert(COUNT(hbp) == NUM_AXES, "HOMING_BACKOFF_POST_MM must have " _NUM_AXES_STR "elements (and no others).");
NUM_AXIS_CODE(
static_assert(hbp[X_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.X must be greater than or equal to 0."),
static_assert(hbp[Y_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.Y must be greater than or equal to 0."),
static_assert(hbp[Z_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.Z must be greater than or equal to 0."),
static_assert(hbp[I_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.I must be greater than or equal to 0."),
static_assert(hbp[J_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.J must be greater than or equal to 0."),
static_assert(hbp[K_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.K must be greater than or equal to 0."),
static_assert(hbp[U_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.U must be greater than or equal to 0."),
static_assert(hbp[V_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.V must be greater than or equal to 0."),
static_assert(hbp[W_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.W must be greater than or equal to 0.")
);
#endif
#define COUNT_SENSORLESS COUNT_ENABLED(Z_SENSORLESS, Z2_SENSORLESS, Z3_SENSORLESS, Z4_SENSORLESS)
#if COUNT_SENSORLESS && COUNT_SENSORLESS != NUM_Z_STEPPERS
#error "All Z steppers must have *_STALL_SENSITIVITY defined to use Z sensorless homing."
#endif
#undef COUNT_SENSORLESS
#ifdef SENSORLESS_BACKOFF_MM
constexpr float sbm[] = SENSORLESS_BACKOFF_MM;
static_assert(COUNT(sbm) == NUM_AXES, "SENSORLESS_BACKOFF_MM must have " _NUM_AXES_STR "elements (and no others).");
NUM_AXIS_CODE(
static_assert(sbm[X_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.X must be greater than or equal to 0."),
static_assert(sbm[Y_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.Y must be greater than or equal to 0."),
static_assert(sbm[Z_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.Z must be greater than or equal to 0."),
static_assert(sbm[I_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.I must be greater than or equal to 0."),
static_assert(sbm[J_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.J must be greater than or equal to 0."),
static_assert(sbm[K_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.K must be greater than or equal to 0."),
static_assert(sbm[U_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.U must be greater than or equal to 0."),
static_assert(sbm[V_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.V must be greater than or equal to 0."),
static_assert(sbm[W_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.W must be greater than or equal to 0.")
);
#endif
#if ENABLED(CODEPENDENT_XY_HOMING)
#if ENABLED(QUICK_HOME)
#error "QUICK_HOME is incompatible with CODEPENDENT_XY_HOMING."
#elif IS_KINEMATIC
#error "CODEPENDENT_XY_HOMING requires a Cartesian setup."
#endif
#endif
/**
* Make sure Z_SAFE_HOMING point is reachable
*/
#if ENABLED(Z_SAFE_HOMING)
static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, X_MIN_POS, X_MAX_POS), "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle.");
static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");
#endif
/**
* Make sure Z_CLEARANCE_FOR_HOMING is below Z_MAX_POS
*/
#if HAS_Z_AXIS
static_assert(Z_CLEARANCE_FOR_HOMING <= Z_MAX_POS, "Z_CLEARANCE_FOR_HOMING must be smaller than or equal to Z_MAX_POS.");
#endif
// Check Safe Bed Leveling settings
#if HAS_SAFE_BED_LEVELING
#if defined(SAFE_BED_LEVELING_START_Y) && !defined(SAFE_BED_LEVELING_START_X)
#error "If SAFE_BED_LEVELING_START_Y is defined, SAFE_BED_LEVELING_START_X must also be defined."
#elif defined(SAFE_BED_LEVELING_START_Z) && !defined(SAFE_BED_LEVELING_START_Y)
#error "If SAFE_BED_LEVELING_START_Z is defined, SAFE_BED_LEVELING_START_Y must also be defined."
#elif defined(SAFE_BED_LEVELING_START_I) && !defined(SAFE_BED_LEVELING_START_Z)
#error "If SAFE_BED_LEVELING_START_I is defined, SAFE_BED_LEVELING_START_Z must also be defined."
#elif defined(SAFE_BED_LEVELING_START_J) && !defined(SAFE_BED_LEVELING_START_I)
#error "If SAFE_BED_LEVELING_START_J is defined, SAFE_BED_LEVELING_START_I must also be defined."
#elif defined(SAFE_BED_LEVELING_START_K) && !defined(SAFE_BED_LEVELING_START_J)
#error "If SAFE_BED_LEVELING_START_K is defined, SAFE_BED_LEVELING_START_J must also be defined."
#elif defined(SAFE_BED_LEVELING_START_U) && !defined(SAFE_BED_LEVELING_START_K)
#error "If SAFE_BED_LEVELING_START_U is defined, SAFE_BED_LEVELING_START_K must also be defined."
#elif defined(SAFE_BED_LEVELING_START_V) && !defined(SAFE_BED_LEVELING_START_U)
#error "If SAFE_BED_LEVELING_START_V is defined, SAFE_BED_LEVELING_START_U must also be defined."
#elif defined(SAFE_BED_LEVELING_START_W) && !defined(SAFE_BED_LEVELING_START_V)
#error "If SAFE_BED_LEVELING_START_W is defined, SAFE_BED_LEVELING_START_V must also be defined."
#endif
#endif
/**
* Make sure DISABLE_[XYZ] compatible with selected homing options
*/
#if HAS_DISABLE_MAIN_AXES && ANY(HOME_AFTER_DEACTIVATE, Z_SAFE_HOMING)
#error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
#endif
/**
* Filament Width Sensor
*/
#if ENABLED(FILAMENT_WIDTH_SENSOR)
#if !HAS_FILAMENT_WIDTH_SENSOR
#error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined."
#elif ENABLED(NO_VOLUMETRICS)
#error "FILAMENT_WIDTH_SENSOR requires NO_VOLUMETRICS to be disabled."
#endif
#endif
/**
* System Power Sensor
*/
#if ENABLED(POWER_MONITOR_CURRENT) && !PIN_EXISTS(POWER_MONITOR_CURRENT)
#error "POWER_MONITOR_CURRENT requires a valid POWER_MONITOR_CURRENT_PIN."
#elif ENABLED(POWER_MONITOR_VOLTAGE) && !PIN_EXISTS(POWER_MONITOR_VOLTAGE)
#error "POWER_MONITOR_VOLTAGE requires POWER_MONITOR_VOLTAGE_PIN to be defined."
#elif ALL(POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE) && POWER_MONITOR_CURRENT_PIN == POWER_MONITOR_VOLTAGE_PIN
#error "POWER_MONITOR_CURRENT_PIN and POWER_MONITOR_VOLTAGE_PIN must be different."
#endif
/**
* Volumetric Extruder Limit
*/
#if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT)
#if ENABLED(NO_VOLUMETRICS)
#error "VOLUMETRIC_EXTRUDER_LIMIT requires NO_VOLUMETRICS to be disabled."
#elif MIN_STEPS_PER_SEGMENT > 1
#error "VOLUMETRIC_EXTRUDER_LIMIT is not compatible with MIN_STEPS_PER_SEGMENT greater than 1."
#endif
#endif
/**
* ULTIPANEL encoder
*/
#if IS_ULTIPANEL && NONE(IS_NEWPANEL, SR_LCD_2W_NL) && !PIN_EXISTS(SHIFT_CLK)
#error "ULTIPANEL controllers require some kind of encoder."
#endif
#if ENCODER_PULSES_PER_STEP < 0
#error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead."
#endif
/**
* SAV_3DGLCD display options
*/
#if ENABLED(SAV_3DGLCD)
#if NONE(U8GLIB_SSD1306, U8GLIB_SH1106)
#error "Enable a SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
#elif ALL(U8GLIB_SSD1306, U8GLIB_SH1106)
#error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
#endif
#endif
/**
* Allen Key
* Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
*/
#if ALL(Z_HOME_TO_MIN, Z_PROBE_ALLEN_KEY, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#error "You can't home to a Z min endstop with a Z_PROBE_ALLEN_KEY."
#endif
/**
* Dual X Carriage requirements
*/
#if ENABLED(DUAL_X_CARRIAGE)
#if EXTRUDERS < 2
#error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
#elif ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_YX)
#error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, COREZX, MARKFORGED_YX, or MARKFORGED_XY."
#elif !GOOD_AXIS_PINS(X2)
#error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
#elif !USE_X_MAX
#error "DUAL_X_CARRIAGE requires an X_MAX_PIN in addition to the X_MIN_PIN."
#elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS)
#error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS."
#elif X_HOME_TO_MAX
#error "DUAL_X_CARRIAGE requires X_HOME_DIR -1."
#elif (X2_HOME_POS <= X1_MAX_POS) || (X2_MAX_POS < X1_MAX_POS)
#error "DUAL_X_CARRIAGE will crash if X1 can meet or exceed X2 travel."
#endif
#endif
#undef GOOD_AXIS_PINS
/**
* Make sure auto fan pins don't conflict with the first fan pin
*/
#if HAS_AUTO_FAN
#if PINS_EXIST(E0_AUTO_FAN, FAN0) && E0_AUTO_FAN_PIN == FAN0_PIN
#error "You cannot set E0_AUTO_FAN_PIN equal to FAN0_PIN."
#elif PINS_EXIST(E1_AUTO_FAN, FAN0) && E1_AUTO_FAN_PIN == FAN0_PIN
#error "You cannot set E1_AUTO_FAN_PIN equal to FAN0_PIN."
#elif PINS_EXIST(E2_AUTO_FAN, FAN0) && E2_AUTO_FAN_PIN == FAN0_PIN
#error "You cannot set E2_AUTO_FAN_PIN equal to FAN0_PIN."
#elif PINS_EXIST(E3_AUTO_FAN, FAN0) && E3_AUTO_FAN_PIN == FAN0_PIN
#error "You cannot set E3_AUTO_FAN_PIN equal to FAN0_PIN."
#elif PINS_EXIST(E4_AUTO_FAN, FAN0) && E4_AUTO_FAN_PIN == FAN0_PIN
#error "You cannot set E4_AUTO_FAN_PIN equal to FAN0_PIN."
#elif PINS_EXIST(E5_AUTO_FAN, FAN0) && E5_AUTO_FAN_PIN == FAN0_PIN
#error "You cannot set E5_AUTO_FAN_PIN equal to FAN0_PIN."
#elif PINS_EXIST(E6_AUTO_FAN, FAN0) && E6_AUTO_FAN_PIN == FAN0_PIN
#error "You cannot set E6_AUTO_FAN_PIN equal to FAN0_PIN."
#elif PINS_EXIST(E7_AUTO_FAN, FAN0) && E7_AUTO_FAN_PIN == FAN0_PIN
#error "You cannot set E7_AUTO_FAN_PIN equal to FAN0_PIN."
#endif
#endif
#if HAS_FAN0
#if CONTROLLER_FAN_PIN == FAN0_PIN
#error "You cannot set CONTROLLER_FAN_PIN equal to FAN0_PIN."
#elif ENABLED(FAN_SOFT_PWM_REQUIRED) && DISABLED(FAN_SOFT_PWM)
#error "FAN_SOFT_PWM is required for your board. Enable it to continue."
#endif
#endif
#if ENABLED(USE_CONTROLLER_FAN)
#if !HAS_CONTROLLER_FAN
#error "USE_CONTROLLER_FAN requires a CONTROLLER_FAN_PIN. Define in Configuration_adv.h."
#elif PIN_EXISTS(E0_AUTO_FAN) && E0_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
#error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
#elif PIN_EXISTS(E1_AUTO_FAN) && E1_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
#error "You cannot set E1_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
#elif PIN_EXISTS(E2_AUTO_FAN) && E2_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
#error "You cannot set E2_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
#elif PIN_EXISTS(E3_AUTO_FAN) && E3_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
#error "You cannot set E3_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
#elif PIN_EXISTS(E4_AUTO_FAN) && E4_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
#error "You cannot set E4_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
#elif PIN_EXISTS(E5_AUTO_FAN) && E5_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
#error "You cannot set E5_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
#elif PIN_EXISTS(E6_AUTO_FAN) && E6_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
#error "You cannot set E6_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
#elif PIN_EXISTS(E7_AUTO_FAN) && E7_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
#error "You cannot set E7_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
#endif
#endif
/**
* Make sure FAN_*_PWM values are sensible
*/
#if ANY(HAS_FAN, USE_CONTROLLER_FAN)
#if !WITHIN(FAN_MIN_PWM, 0, 255)
#error "FAN_MIN_PWM must be a value from 0 to 255."
#elif !WITHIN(FAN_MAX_PWM, 0, 255)
#error "FAN_MAX_PWM must be a value from 0 to 255."
#elif FAN_MIN_PWM > FAN_MAX_PWM
#error "FAN_MIN_PWM must be less than or equal to FAN_MAX_PWM."
#elif FAN_OFF_PWM > FAN_MIN_PWM
#error "FAN_OFF_PWM must be less than or equal to FAN_MIN_PWM."
#endif
#endif
#ifdef REDUNDANT_PART_COOLING_FAN
#if FAN_COUNT < 2
#error "REDUNDANT_PART_COOLING_FAN requires a board with at least two PWM fans."
#elif !WITHIN(REDUNDANT_PART_COOLING_FAN, 1, FAN_COUNT - 1)
static_assert(false, "REDUNDANT_PART_COOLING_FAN must be between 1 and " STRINGIFY(DECREMENT(FAN_COUNT)) ".");
#elif !WITHIN(REDUNDANT_PART_COOLING_FAN + NUM_REDUNDANT_FANS - 1, 1, FAN_COUNT - 1)
#error "Not enough fans available for NUM_REDUNDANT_FANS."
#endif
#endif
/**
* Case Light requirements
*/
#if NEED_CASE_LIGHT_PIN
#if !PIN_EXISTS(CASE_LIGHT)
#error "CASE_LIGHT_ENABLE requires CASE_LIGHT_PIN, CASE_LIGHT_USE_NEOPIXEL, or CASE_LIGHT_USE_RGB_LED."
#elif CASE_LIGHT_PIN == FAN0_PIN
#error "CASE_LIGHT_PIN conflicts with FAN0_PIN. Resolve before continuing."
#endif
#endif
/**
* Required custom thermistor settings
*/
#if TEMP_SENSOR_0_IS_CUSTOM && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA))
#error "TEMP_SENSOR_0 1000 requires HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS and HOTEND0_BETA in Configuration_adv.h."
#elif TEMP_SENSOR_1_IS_CUSTOM && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA))
#error "TEMP_SENSOR_1 1000 requires HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS and HOTEND1_BETA in Configuration_adv.h."
#elif TEMP_SENSOR_2_IS_CUSTOM && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA))
#error "TEMP_SENSOR_2 1000 requires HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS and HOTEND2_BETA in Configuration_adv.h."
#elif TEMP_SENSOR_3_IS_CUSTOM && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA))
#error "TEMP_SENSOR_3 1000 requires HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS and HOTEND3_BETA in Configuration_adv.h."
#elif TEMP_SENSOR_4_IS_CUSTOM && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA))
#error "TEMP_SENSOR_4 1000 requires HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS and HOTEND4_BETA in Configuration_adv.h."
#elif TEMP_SENSOR_5_IS_CUSTOM && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA))
#error "TEMP_SENSOR_5 1000 requires HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS and HOTEND5_BETA in Configuration_adv.h."
#elif TEMP_SENSOR_6_IS_CUSTOM && !(defined(HOTEND6_PULLUP_RESISTOR_OHMS) && defined(HOTEND6_RESISTANCE_25C_OHMS) && defined(HOTEND6_BETA))
#error "TEMP_SENSOR_6 1000 requires HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS and HOTEND6_BETA in Configuration_adv.h."
#elif TEMP_SENSOR_7_IS_CUSTOM && !(defined(HOTEND7_PULLUP_RESISTOR_OHMS) && defined(HOTEND7_RESISTANCE_25C_OHMS) && defined(HOTEND7_BETA))
#error "TEMP_SENSOR_7 1000 requires HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS and HOTEND7_BETA in Configuration_adv.h."
#elif TEMP_SENSOR_BED_IS_CUSTOM && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA))
#error "TEMP_SENSOR_BED 1000 requires BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS and BED_BETA in Configuration_adv.h."
#elif TEMP_SENSOR_CHAMBER_IS_CUSTOM && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA))
#error "TEMP_SENSOR_CHAMBER 1000 requires CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS and CHAMBER_BETA in Configuration_adv.h."
#elif TEMP_SENSOR_PROBE_IS_CUSTOM && !(defined(PROBE_PULLUP_RESISTOR_OHMS) && defined(PROBE_RESISTANCE_25C_OHMS) && defined(PROBE_BETA))
#error "TEMP_SENSOR_PROBE 1000 requires PROBE_PULLUP_RESISTOR_OHMS, PROBE_RESISTANCE_25C_OHMS and PROBE_BETA in Configuration_adv.h."
#elif TEMP_SENSOR_BOARD_IS_CUSTOM && !(defined(BOARD_PULLUP_RESISTOR_OHMS) && defined(BOARD_RESISTANCE_25C_OHMS) && defined(BOARD_BETA))
#error "TEMP_SENSOR_BOARD 1000 requires BOARD_PULLUP_RESISTOR_OHMS, BOARD_RESISTANCE_25C_OHMS and BOARD_BETA in Configuration_adv.h."
#elif TEMP_SENSOR_REDUNDANT_IS_CUSTOM && !(defined(REDUNDANT_PULLUP_RESISTOR_OHMS) && defined(REDUNDANT_RESISTANCE_25C_OHMS) && defined(REDUNDANT_BETA))
#error "TEMP_SENSOR_REDUNDANT 1000 requires REDUNDANT_PULLUP_RESISTOR_OHMS, REDUNDANT_RESISTANCE_25C_OHMS and REDUNDANT_BETA in Configuration_adv.h."
#endif
/**
* Required thermistor 66 (Dyze Design / Trianglelab T-D500) settings
* https://docs.dyzedesign.com/hotends.html#_500-%C2%B0c-thermistor
*/
#if ANY_E_SENSOR_IS(66)
#define _BAD_MINTEMP(N) (TEMP_SENSOR(N) == 66 && HEATER_##N##_MINTEMP <= 20)
#if _BAD_MINTEMP(0)
#error "Thermistor 66 requires HEATER_0_MINTEMP > 20."
#elif _BAD_MINTEMP(1)
#error "Thermistor 66 requires HEATER_1_MINTEMP > 20."
#elif _BAD_MINTEMP(2)
#error "Thermistor 66 requires HEATER_2_MINTEMP > 20."
#elif _BAD_MINTEMP(3)
#error "Thermistor 66 requires HEATER_3_MINTEMP > 20."
#elif _BAD_MINTEMP(4)
#error "Thermistor 66 requires HEATER_4_MINTEMP > 20."
#elif _BAD_MINTEMP(5)
#error "Thermistor 66 requires HEATER_5_MINTEMP > 20."
#elif _BAD_MINTEMP(6)
#error "Thermistor 66 requires HEATER_6_MINTEMP > 20."
#elif _BAD_MINTEMP(7)
#error "Thermistor 66 requires HEATER_7_MINTEMP > 20."
#endif
#if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED < 5
#error "Thermistor 66 requires MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED ≥ 5."
#elif PREHEAT_TIME_HOTEND_MS < 15000
#error "Thermistor 66 requires PREHEAT_TIME_HOTEND_MS ≥ 15000, but 30000 or higher is recommended."
#endif
#undef _BAD_MINTEMP
#endif
#if TEMP_SENSOR_BED == 66 && PREHEAT_TIME_BED_MS < 15000
#error "Thermistor 66 requires PREHEAT_TIME_BED_MS ≥ 15000, but 30000 or higher is recommended."
#endif
/**
* Required MAX31865 settings
*/
#if TEMP_SENSOR_0_IS_MAX31865 || (TEMP_SENSOR_REDUNDANT_IS_MAX31865 && REDUNDANT_TEMP_MATCH(SOURCE, E0))
#if !defined(MAX31865_SENSOR_WIRES_0) || !WITHIN(MAX31865_SENSOR_WIRES_0, 2, 4)
#error "MAX31865_SENSOR_WIRES_0 must be defined as an integer between 2 and 4."
#elif !defined(MAX31865_SENSOR_OHMS_0) || !defined(MAX31865_CALIBRATION_OHMS_0)
#error "MAX31865_SENSOR_OHMS_0 and MAX31865_CALIBRATION_OHMS_0 must be set if TEMP_SENSOR_0/TEMP_SENSOR_REDUNDANT is MAX31865."
#endif
#endif
#if TEMP_SENSOR_1_IS_MAX31865 || (TEMP_SENSOR_REDUNDANT_IS_MAX31865 && REDUNDANT_TEMP_MATCH(SOURCE, E1))
#if !defined(MAX31865_SENSOR_WIRES_1) || !WITHIN(MAX31865_SENSOR_WIRES_1, 2, 4)
#error "MAX31865_SENSOR_WIRES_1 must be defined as an integer between 2 and 4."
#elif !defined(MAX31865_SENSOR_OHMS_1) || !defined(MAX31865_CALIBRATION_OHMS_1)
#error "MAX31865_SENSOR_OHMS_1 and MAX31865_CALIBRATION_OHMS_1 must be set if TEMP_SENSOR_1/TEMP_SENSOR_REDUNDANT is MAX31865."
#endif
#endif
#if TEMP_SENSOR_2_IS_MAX31865 || (TEMP_SENSOR_REDUNDANT_IS_MAX31865 && REDUNDANT_TEMP_MATCH(SOURCE, E2))
#if !defined(MAX31865_SENSOR_WIRES_2) || !WITHIN(MAX31865_SENSOR_WIRES_2, 2, 4)
#error "MAX31865_SENSOR_WIRES_2 must be defined as an integer between 2 and 4."
#elif !defined(MAX31865_SENSOR_OHMS_2) || !defined(MAX31865_CALIBRATION_OHMS_2)
#error "MAX31865_SENSOR_OHMS_2 and MAX31865_CALIBRATION_OHMS_2 must be set if TEMP_SENSOR_2/TEMP_SENSOR_REDUNDANT is MAX31865."
#endif
#endif
/**
* Redundant temperature sensor config
*/
#if HAS_TEMP_REDUNDANT
#ifndef TEMP_SENSOR_REDUNDANT_SOURCE
#error "TEMP_SENSOR_REDUNDANT requires TEMP_SENSOR_REDUNDANT_SOURCE."
#elif !defined(TEMP_SENSOR_REDUNDANT_TARGET)
#error "TEMP_SENSOR_REDUNDANT requires TEMP_SENSOR_REDUNDANT_TARGET."
#elif REDUNDANT_TEMP_MATCH(SOURCE, TEMP_SENSOR_REDUNDANT_TARGET)
#error "TEMP_SENSOR_REDUNDANT_SOURCE can't be the same as TEMP_SENSOR_REDUNDANT_TARGET."
#elif HAS_MULTI_HOTEND && TEMP_SENSOR_REDUNDANT_SOURCE < HOTENDS
#error "TEMP_SENSOR_REDUNDANT_SOURCE must be after the last used hotend TEMP_SENSOR."
#endif
#if REDUNDANT_TEMP_MATCH(SOURCE, E0) && HAS_HOTEND
#error "TEMP_SENSOR_REDUNDANT_SOURCE can't be E0 if a hotend is used. E0 always uses TEMP_SENSOR_0."
#elif REDUNDANT_TEMP_MATCH(SOURCE, COOLER) && HAS_TEMP_COOLER
#error "TEMP_SENSOR_REDUNDANT_SOURCE can't be COOLER. TEMP_SENSOR_COOLER is in use."
#elif REDUNDANT_TEMP_MATCH(SOURCE, PROBE) && HAS_TEMP_PROBE
#error "TEMP_SENSOR_REDUNDANT_SOURCE can't be PROBE. TEMP_SENSOR_PROBE is in use."
#elif REDUNDANT_TEMP_MATCH(SOURCE, BOARD) && HAS_TEMP_BOARD
#error "TEMP_SENSOR_REDUNDANT_SOURCE can't be BOARD. TEMP_SENSOR_BOARD is in use."
#elif REDUNDANT_TEMP_MATCH(SOURCE, SOC)
#error "TEMP_SENSOR_REDUNDANT_SOURCE can't be SOC."
#elif REDUNDANT_TEMP_MATCH(SOURCE, CHAMBER) && HAS_TEMP_CHAMBER
#error "TEMP_SENSOR_REDUNDANT_SOURCE can't be CHAMBER. TEMP_SENSOR_CHAMBER is in use."
#elif REDUNDANT_TEMP_MATCH(SOURCE, BED) && HAS_TEMP_BED
#error "TEMP_SENSOR_REDUNDANT_SOURCE can't be BED. TEMP_SENSOR_BED is in use."
#endif
#if REDUNDANT_TEMP_MATCH(TARGET, E0) && !PIN_EXISTS(TEMP_0)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E0 without TEMP_0_PIN defined."
#elif REDUNDANT_TEMP_MATCH(TARGET, E1) && !PIN_EXISTS(TEMP_1)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E1 without TEMP_1_PIN defined."
#elif REDUNDANT_TEMP_MATCH(TARGET, E2) && !PIN_EXISTS(TEMP_2)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E2 without TEMP_2_PIN defined."
#elif REDUNDANT_TEMP_MATCH(TARGET, E3) && !PIN_EXISTS(TEMP_3)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E3 without TEMP_3_PIN defined."
#elif REDUNDANT_TEMP_MATCH(TARGET, E4) && !PIN_EXISTS(TEMP_4)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E4 without TEMP_4_PIN defined."
#elif REDUNDANT_TEMP_MATCH(TARGET, E5) && !PIN_EXISTS(TEMP_5)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E5 without TEMP_5_PIN defined."
#elif REDUNDANT_TEMP_MATCH(TARGET, E6) && !PIN_EXISTS(TEMP_6)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E6 without TEMP_6_PIN defined."
#elif REDUNDANT_TEMP_MATCH(TARGET, E7) && !PIN_EXISTS(TEMP_7)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E7 without TEMP_7_PIN defined."
#elif REDUNDANT_TEMP_MATCH(TARGET, BED) && !PIN_EXISTS(TEMP_BED)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be BED without TEMP_BED_PIN defined."
#elif REDUNDANT_TEMP_MATCH(TARGET, CHAMBER) && !PIN_EXISTS(TEMP_CHAMBER)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be CHAMBER without TEMP_CHAMBER_PIN defined."
#elif REDUNDANT_TEMP_MATCH(TARGET, BOARD) && !PIN_EXISTS(TEMP_BOARD)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be BOARD without TEMP_BOARD_PIN defined."
#elif REDUNDANT_TEMP_MATCH(TARGET, SOC)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be SOC."
#elif REDUNDANT_TEMP_MATCH(TARGET, PROBE) && !PIN_EXISTS(TEMP_PROBE)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be PROBE without TEMP_PROBE_PIN defined."
#elif REDUNDANT_TEMP_MATCH(TARGET, COOLER) && !PIN_EXISTS(TEMP_COOLER)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be COOLER without TEMP_COOLER_PIN defined."
#endif
#if TEMP_SENSOR_IS_MAX_TC(REDUNDANT) && REDUNDANT_TEMP_MATCH(SOURCE, E0) && !PIN_EXISTS(TEMP_0_CS)
#error "TEMP_SENSOR_REDUNDANT MAX Thermocouple with TEMP_SENSOR_REDUNDANT_SOURCE E0 requires TEMP_0_CS_PIN."
#elif TEMP_SENSOR_IS_MAX_TC(REDUNDANT) && REDUNDANT_TEMP_MATCH(SOURCE, E1) && !PIN_EXISTS(TEMP_1_CS)
#error "TEMP_SENSOR_REDUNDANT MAX Thermocouple with TEMP_SENSOR_REDUNDANT_SOURCE E1 requires TEMP_1_CS_PIN."
#elif TEMP_SENSOR_IS_MAX_TC(REDUNDANT) && REDUNDANT_TEMP_MATCH(SOURCE, E2) && !PIN_EXISTS(TEMP_2_CS)
#error "TEMP_SENSOR_REDUNDANT MAX Thermocouple with TEMP_SENSOR_REDUNDANT_SOURCE E2 requires TEMP_2_CS_PIN."
#endif
#endif
/**
* Pins and Sensor IDs must be set for each heater
*/
#if HAS_HOTEND
#if !HAS_HEATER_0
#error "HEATER_0_PIN not defined for this board."
#elif TEMP_SENSOR_IS_MAX_TC(0) && !PIN_EXISTS(TEMP_0_CS)
#error "TEMP_SENSOR_0 MAX thermocouple requires TEMP_0_CS_PIN."
#elif TEMP_SENSOR_0 == 100
#error "TEMP_SENSOR_0 can't use Soc temperature sensor."
#elif TEMP_SENSOR_0 == 0
#error "TEMP_SENSOR_0 is required with 1 or more HOTENDS."
#elif !ANY_PIN(TEMP_0, TEMP_0_CS) && !TEMP_SENSOR_0_IS_DUMMY
#error "TEMP_0_PIN or TEMP_0_CS_PIN not defined for this board."
#endif
#if ANY(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1
#error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin."
#endif
#if HAS_MULTI_HOTEND
#if TEMP_SENSOR_IS_MAX_TC(1) && !PIN_EXISTS(TEMP_1_CS)
#error "TEMP_SENSOR_1 MAX thermocouple requires TEMP_1_CS_PIN."
#elif TEMP_SENSOR_1 == 100
#error "TEMP_SENSOR_1 can't use Soc temperature sensor."
#elif TEMP_SENSOR_1 == 0
#error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
#elif !ANY_PIN(TEMP_1, TEMP_1_CS) && !TEMP_SENSOR_1_IS_DUMMY
#error "TEMP_1_PIN or TEMP_1_CS_PIN not defined for this board."
#endif
#if HOTENDS > 2
#if TEMP_SENSOR_IS_MAX_TC(2) && !PIN_EXISTS(TEMP_2_CS)
#error "TEMP_SENSOR_2 MAX thermocouple requires TEMP_2_CS_PIN."
#elif TEMP_SENSOR_2 == 100
#error "TEMP_SENSOR_2 can't use Soc temperature sensor."
#elif TEMP_SENSOR_2 == 0
#error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
#elif !HAS_HEATER_2
#error "HEATER_2_PIN not defined for this board."
#elif !ANY_PIN(TEMP_2, TEMP_2_CS) && !TEMP_SENSOR_2_IS_DUMMY
#error "TEMP_2_PIN or TEMP_2_CS_PIN not defined for this board."
#endif
#if HOTENDS > 3
#if TEMP_SENSOR_3 == 100
#error "TEMP_SENSOR_3 can't use Soc temperature sensor."
#elif TEMP_SENSOR_3 == 0
#error "TEMP_SENSOR_3 is required with 4 or more HOTENDS."
#elif !HAS_HEATER_3
#error "HEATER_3_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_3) && !TEMP_SENSOR_3_IS_DUMMY
#error "TEMP_3_PIN not defined for this board."
#endif
#if HOTENDS > 4
#if TEMP_SENSOR_4 == 100
#error "TEMP_SENSOR_4 can't use Soc temperature sensor."
#elif TEMP_SENSOR_4 == 0
#error "TEMP_SENSOR_4 is required with 5 or more HOTENDS."
#elif !HAS_HEATER_4
#error "HEATER_4_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_4) && !TEMP_SENSOR_4_IS_DUMMY
#error "TEMP_4_PIN not defined for this board."
#endif
#if HOTENDS > 5
#if TEMP_SENSOR_5 == 100
#error "TEMP_SENSOR_5 can't use Soc temperature sensor."
#elif TEMP_SENSOR_5 == 0
#error "TEMP_SENSOR_5 is required with 6 HOTENDS."
#elif !HAS_HEATER_5
#error "HEATER_5_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_5) && !TEMP_SENSOR_5_IS_DUMMY
#error "TEMP_5_PIN not defined for this board."
#endif
#if HOTENDS > 6
#if TEMP_SENSOR_6 == 100
#error "TEMP_SENSOR_6 can't use Soc temperature sensor."
#elif TEMP_SENSOR_6 == 0
#error "TEMP_SENSOR_6 is required with 6 HOTENDS."
#elif !HAS_HEATER_6
#error "HEATER_6_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_6) && !TEMP_SENSOR_6_IS_DUMMY
#error "TEMP_6_PIN not defined for this board."
#endif
#if HOTENDS > 7
#if TEMP_SENSOR_7 == 100
#error "TEMP_SENSOR_7 can't use Soc temperature sensor."
#elif TEMP_SENSOR_7 == 0
#error "TEMP_SENSOR_7 is required with 7 HOTENDS."
#elif !HAS_HEATER_7
#error "HEATER_7_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_7) && !TEMP_SENSOR_7_IS_DUMMY
#error "TEMP_7_PIN not defined for this board."
#endif
#endif // HOTENDS > 7
#endif // HOTENDS > 6
#endif // HOTENDS > 5
#endif // HOTENDS > 4
#endif // HOTENDS > 3
#endif // HOTENDS > 2
#endif // HAS_MULTI_HOTEND
#endif // HAS_HOTEND
#if DO_TOOLCHANGE_FOR_PROBING && PROBING_TOOL >= EXTRUDERS
#error "PROBING_TOOL must be a valid tool index."
#endif
/**
* Pins must be set for temp sensors, with some other feature requirements.
*/
#if TEMP_SENSOR_BED == 100
#error "TEMP_SENSOR_BED can't use Soc temperature sensor."
#endif
#if TEMP_SENSOR_CHAMBER
#if TEMP_SENSOR_CHAMBER == 100
#error "TEMP_SENSOR_CHAMBER can't use Soc temperature sensor."
#elif !PIN_EXISTS(TEMP_CHAMBER)
#error "TEMP_SENSOR_CHAMBER requires TEMP_CHAMBER_PIN."
#endif
#endif
#if TEMP_SENSOR_COOLER
#if TEMP_SENSOR_COOLER == 100
#error "TEMP_SENSOR_COOLER can't use Soc temperature sensor."
#elif !PIN_EXISTS(TEMP_COOLER)
#error "TEMP_SENSOR_COOLER requires TEMP_COOLER_PIN."
#elif DISABLED(LASER_FEATURE)
#error "TEMP_SENSOR_COOLER requires LASER_FEATURE."
#endif
#endif
#if TEMP_SENSOR_PROBE
#if TEMP_SENSOR_PROBE == 100
#error "TEMP_SENSOR_PROBE can't use Soc temperature sensor."
#elif !PIN_EXISTS(TEMP_PROBE)
#error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN."
#elif DISABLED(FIX_MOUNTED_PROBE)
#error "TEMP_SENSOR_PROBE shouldn't be set without FIX_MOUNTED_PROBE."
#endif
#endif
#if TEMP_SENSOR_BOARD
#if TEMP_SENSOR_BOARD == 100
#error "TEMP_SENSOR_BOARD can't use Soc temperature sensor."
#elif !PIN_EXISTS(TEMP_BOARD)
#error "TEMP_SENSOR_BOARD requires TEMP_BOARD_PIN."
#elif ENABLED(THERMAL_PROTECTION_BOARD) && (!defined(BOARD_MINTEMP) || !defined(BOARD_MAXTEMP))
#error "THERMAL_PROTECTION_BOARD requires BOARD_MINTEMP and BOARD_MAXTEMP."
#endif
#elif CONTROLLER_FAN_MIN_BOARD_TEMP
#error "CONTROLLER_FAN_MIN_BOARD_TEMP requires TEMP_SENSOR_BOARD."
#endif
#if TEMP_SENSOR_SOC
#if TEMP_SENSOR_SOC != 100
#error "TEMP_SENSOR_SOC requires TEMP_SENSOR_SOC 100."
#elif !PIN_EXISTS(TEMP_SOC)
#error "TEMP_SENSOR_SOC requires TEMP_SOC_PIN."
#elif ENABLED(THERMAL_PROTECTION_SOC) && !defined(SOC_MAXTEMP)
#error "THERMAL_PROTECTION_SOC requires SOC_MAXTEMP."
#endif
#elif CONTROLLER_FAN_MIN_SOC_TEMP
#error "CONTROLLER_FAN_MIN_SOC_TEMP requires TEMP_SENSOR_SOC."
#endif
#if ENABLED(LASER_COOLANT_FLOW_METER) && !(PIN_EXISTS(FLOWMETER) && ENABLED(LASER_FEATURE))
#error "LASER_COOLANT_FLOW_METER requires FLOWMETER_PIN and LASER_FEATURE."
#endif
#if ENABLED(CHAMBER_FAN) && !(defined(CHAMBER_FAN_MODE) && WITHIN(CHAMBER_FAN_MODE, 0, 3))
#error "CHAMBER_FAN_MODE must be between 0 and 3."
#endif
#if ENABLED(CHAMBER_VENT)
#ifndef CHAMBER_VENT_SERVO_NR
#error "CHAMBER_VENT_SERVO_NR is required for CHAMBER SERVO."
#elif !NUM_SERVOS
#error "NUM_SERVOS is required for a Heated Chamber vent servo (CHAMBER_VENT_SERVO_NR)."
#elif CHAMBER_VENT_SERVO_NR >= NUM_SERVOS
#error "CHAMBER_VENT_SERVO_NR must be smaller than NUM_SERVOS."
#elif HAS_Z_SERVO_PROBE && CHAMBER_VENT_SERVO_NR == Z_PROBE_SERVO_NR
#error "CHAMBER SERVO is already used by BLTOUCH."
#elif CHAMBER_VENT_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
#error "SERVO0_PIN must be defined for your Heated Chamber vent servo."
#elif CHAMBER_VENT_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
#error "SERVO1_PIN must be defined for your Heated Chamber vent servo."
#elif CHAMBER_VENT_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
#error "SERVO2_PIN must be defined for your Heated Chamber vent servo."
#elif CHAMBER_VENT_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
#error "SERVO3_PIN must be defined for your Heated Chamber vent servo."
#endif
#endif
/**
* Temperature status LEDs
*/
#if ENABLED(TEMP_STAT_LEDS) && !ANY_PIN(STAT_LED_RED, STAT_LED_BLUE)
#error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both."
#endif
/**
* FYSETC/MKS/BTT/BEEZ Mini Panel Requirements
*/
#if ANY(FYSETC_242_OLED_12864, FYSETC_MINI_12864_2_1)
#ifndef NEO_RGB
#define NEO_RGB 123
#define FAUX_RGB 1
#endif
#if defined(NEOPIXEL_TYPE) && NEOPIXEL_TYPE != NEO_RGB
#error "Your FYSETC/MKS/BTT/BEEZ Mini Panel requires NEOPIXEL_TYPE to be NEO_RGB."
#elif defined(NEOPIXEL_PIXELS) && NEOPIXEL_PIXELS < 3
#error "Your FYSETC/MKS/BTT/BEEZ Mini Panel requires NEOPIXEL_PIXELS >= 3."
#endif
#if FAUX_RGB
#undef NEO_RGB
#undef FAUX_RGB
#endif
#elif ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED)
#error "Your FYSETC Mini Panel requires RGB_LED."
#endif
/**
* LED Control Menu requirements
*/
#if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS
#error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9533, PCA9632, or NEOPIXEL_LED."
#endif
/**
* Basic multi hotend duplication mode
*/
#if ENABLED(MULTI_NOZZLE_DUPLICATION)
#if ENABLED(SINGLENOZZLE)
#error "MULTI_NOZZLE_DUPLICATION is incompatible with SINGLENOZZLE."
#elif ENABLED(DUAL_X_CARRIAGE)
#error "MULTI_NOZZLE_DUPLICATION is incompatible with DUAL_X_CARRIAGE."
#elif ENABLED(MIXING_EXTRUDER)
#error "MULTI_NOZZLE_DUPLICATION is incompatible with MIXING_EXTRUDER."
#elif HAS_SWITCHING_EXTRUDER
#error "MULTI_NOZZLE_DUPLICATION is incompatible with (MECHANICAL_)SWITCHING_EXTRUDER."
#elif HOTENDS < 2
#error "MULTI_NOZZLE_DUPLICATION requires 2 or more hotends."
#endif
#endif
/**
* Test Extruder Stepper Pins
*/
#if HAS_EXTRUDERS
#if ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && !PINS_EXIST(E0_STEP, E0_DIR))
#error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PINS_EXIST(E0_STEP, E0_DIR) || !HAS_E0_ENABLE))
#error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
#elif HOTENDS && TEMP_SENSOR_0 == 0
#error "TEMP_SENSOR_0 is required if there are any hotends."
#endif
#endif
#if E_STEPPERS > 0 && !(PINS_EXIST(E0_STEP, E0_DIR) && HAS_E0_ENABLE)
#error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 1 && !(PINS_EXIST(E1_STEP, E1_DIR) && HAS_E1_ENABLE)
#error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 2 && !(PINS_EXIST(E2_STEP, E2_DIR) && HAS_E2_ENABLE)
#error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 3 && !(PINS_EXIST(E3_STEP, E3_DIR) && HAS_E3_ENABLE)
#error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 4 && !(PINS_EXIST(E4_STEP, E4_DIR) && HAS_E4_ENABLE)
#error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 5 && !(PINS_EXIST(E5_STEP, E5_DIR) && HAS_E5_ENABLE)
#error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 6 && !(PINS_EXIST(E6_STEP, E6_DIR) && HAS_E6_ENABLE)
#error "E6_STEP_PIN, E6_DIR_PIN, or E6_ENABLE_PIN not defined for this board."
#endif
#if E_STEPPERS > 7 && !(PINS_EXIST(E7_STEP, E7_DIR) && HAS_E7_ENABLE)
#error "E7_STEP_PIN, E7_DIR_PIN, or E7_ENABLE_PIN not defined for this board."
#endif
/**
* Endstop Tests
*/
#if !IS_SCARA
// Delta and Cartesian require some kind of endstop
#if X_HOME_TO_MIN && !HAS_X_MIN_STATE
#error "X_MIN_PIN, X_STOP_PIN, or X_SPI_SENSORLESS is required for X axis homing."
#elif X_HOME_TO_MAX && !HAS_X_MAX_STATE
#error "X_MAX_PIN, X_STOP_PIN, or X_SPI_SENSORLESS is required for X axis homing."
#elif Y_HOME_TO_MIN && !HAS_Y_MIN_STATE
#error "Y_MIN_PIN, Y_STOP_PIN, or Y_SPI_SENSORLESS is required for Y axis homing."
#elif Y_HOME_TO_MAX && !HAS_Y_MAX_STATE
#error "Y_MAX_PIN, Y_STOP_PIN, or Y_SPI_SENSORLESS is required for Y axis homing."
#elif Z_HOME_TO_MIN && NONE(HAS_Z_MIN_STATE, USE_PROBE_FOR_Z_HOMING)
#error "Z_MIN_PIN, Z_STOP_PIN, Z_SPI_SENSORLESS, or USE_PROBE_FOR_Z_HOMING is required for Z axis homing."
#elif Z_HOME_TO_MAX && !HAS_Z_MAX_STATE
#error "Z_MAX_PIN, Z_STOP_PIN, or Z_SPI_SENSORLESS is required for Z axis homing."
#elif I_HOME_TO_MIN && !HAS_I_MIN_STATE
#error "I_MIN_PIN, I_STOP_PIN, or I_SPI_SENSORLESS is required for I axis homing."
#elif I_HOME_TO_MAX && !HAS_I_MAX_STATE
#error "I_MAX_PIN, I_STOP_PIN, or I_SPI_SENSORLESS is required for I axis homing."
#elif J_HOME_TO_MIN && !HAS_J_MIN_STATE
#error "J_MIN_PIN, J_STOP_PIN, or J_SPI_SENSORLESS is required for J axis homing."
#elif J_HOME_TO_MAX && !HAS_J_MAX_STATE
#error "J_MAX_PIN, J_STOP_PIN, or J_SPI_SENSORLESS is required for J axis homing."
#elif K_HOME_TO_MIN && !HAS_K_MIN_STATE
#error "K_MIN_PIN, K_STOP_PIN, or K_SPI_SENSORLESS is required for K axis homing."
#elif K_HOME_TO_MAX && !HAS_K_MAX_STATE
#error "K_MAX_PIN, K_STOP_PIN, or K_SPI_SENSORLESS is required for K axis homing."
#elif U_HOME_TO_MIN && !HAS_U_MIN_STATE
#error "U_MIN_PIN, U_STOP_PIN, or U_SPI_SENSORLESS is required for U axis homing."
#elif U_HOME_TO_MAX && !HAS_U_MAX_STATE
#error "U_MAX_PIN, U_STOP_PIN, or U_SPI_SENSORLESS is required for U axis homing."
#elif V_HOME_TO_MIN && !HAS_V_MIN_STATE
#error "V_MIN_PIN, V_STOP_PIN, or V_SPI_SENSORLESS is required for V axis homing."
#elif V_HOME_TO_MAX && !HAS_V_MAX_STATE
#error "V_MAX_PIN, V_STOP_PIN, or V_SPI_SENSORLESS is required for V axis homing."
#elif W_HOME_TO_MIN && !HAS_W_MIN_STATE
#error "W_MIN_PIN, W_STOP_PIN, or W_SPI_SENSORLESS is required for W axis homing."
#elif W_HOME_TO_MAX && !HAS_W_MAX_STATE
#error "W_MAX_PIN, W_STOP_PIN, or W_SPI_SENSORLESS is required for W axis homing."
#endif
#endif
// Z homing with probe requirements
#if ALL(HOMING_Z_WITH_PROBE, Z_MULTI_ENDSTOPS)
#error "Z_MULTI_ENDSTOPS is incompatible with USE_PROBE_FOR_Z_HOMING (i.e., Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)."
#elif ALL(USE_PROBE_FOR_Z_HOMING, Z_HOME_TO_MAX)
#error "Z_HOME_DIR must be -1 when homing Z with the probe."
#elif ALL(USE_PROBE_FOR_Z_HOMING, HOME_Z_FIRST)
#error "HOME_Z_FIRST can't be used when homing Z with a probe."
#endif
#if Z_HOME_TO_MAX && defined(Z_AFTER_HOMING) && DISABLED(ALLOW_Z_AFTER_HOMING)
#error "Z_AFTER_HOMING shouldn't be used with Z max homing to keep 'G28 Z' safe for end-of-print usage. Define ALLOW_Z_AFTER_HOMING to allow this at your own risk."
#endif
// Dual/multiple endstops requirements
#if ENABLED(X_DUAL_ENDSTOPS)
#if ENABLED(DELTA)
#error "X_DUAL_ENDSTOPS is not compatible with DELTA."
#elif !HAS_X2_STATE
#error "Some kind of X2 Endstop must be defined for X_DUAL_ENDSTOPS."
#elif X_SPI_SENSORLESS && !AXIS_HAS_SPI(X2)
#error "All X Stepper Drivers must be SPI-capable to use SPI Endstops on X."
#endif
#endif
#if ENABLED(Y_DUAL_ENDSTOPS)
#if ENABLED(DELTA)
#error "Y_DUAL_ENDSTOPS is not compatible with DELTA."
#elif !HAS_Y2_STATE
#error "Some kind of Y2 Endstop must be defined for Y_DUAL_ENDSTOPS."
#elif Y_SPI_SENSORLESS && !AXIS_HAS_SPI(Y2)
#error "All Y Stepper Drivers must be SPI-capable to use SPI Endstops on Y."
#endif
#endif
#if ENABLED(Z_MULTI_ENDSTOPS)
#if ENABLED(DELTA)
#error "Z_MULTI_ENDSTOPS is not compatible with DELTA."
#elif !HAS_Z2_STATE
#error "Some kind of Z2 Endstop must be defined for Z_MULTI_ENDSTOPS."
#elif NUM_Z_STEPPERS >= 3 && !HAS_Z3_STATE
#error "Some kind of Z3 Endstop must be defined for Z_MULTI_ENDSTOPS and Z3_DRIVER_TYPE."
#elif NUM_Z_STEPPERS >= 4 && !HAS_Z4_STATE
#error "Some kind of Z4 Endstop must be defined for Z_MULTI_ENDSTOPS and Z4_DRIVER_TYPE."
#elif Z_SPI_SENSORLESS && !(AXIS_HAS_SPI(Z2) && (NUM_Z_STEPPERS < 3 || AXIS_HAS_SPI(Z3)) && (NUM_Z_STEPPERS < 4 || AXIS_HAS_SPI(Z4)))
#error "All Z Stepper Drivers must be SPI-capable to use SPI Endstops on Z."
#endif
#endif
#if defined(ENDSTOP_NOISE_THRESHOLD) && !WITHIN(ENDSTOP_NOISE_THRESHOLD, 2, 7)
#error "ENDSTOP_NOISE_THRESHOLD must be an integer from 2 to 7."
#endif
/**
* Emergency Command Parser
*/
#if ENABLED(EMERGENCY_PARSER) && defined(__AVR__) && defined(USBCON)
#error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)."
#endif
/**
* Software Reset options
*/
#if ENABLED(SOFT_RESET_VIA_SERIAL) && DISABLED(EMERGENCY_PARSER)
#error "EMERGENCY_PARSER is required to activate SOFT_RESET_VIA_SERIAL."
#endif
#if ENABLED(SOFT_RESET_ON_KILL) && !BUTTON_EXISTS(ENC)
#error "An encoder button is required or SOFT_RESET_ON_KILL will reset the printer without notice!"
#endif
// Reset reason for AVR
#if ENABLED(OPTIBOOT_RESET_REASON) && !defined(__AVR__)
#error "OPTIBOOT_RESET_REASON only applies to AVR."
#endif
/**
* I2C bus
*/
#if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0
#if I2C_SLAVE_ADDRESS < 8
#error "I2C_SLAVE_ADDRESS can't be less than 8. (Addresses 0 - 7 are reserved.)"
#elif I2C_SLAVE_ADDRESS > 127
#error "I2C_SLAVE_ADDRESS can't be over 127. (Only 7 bits allowed.)"
#endif
#endif
/**
* G35 Assisted Tramming
*/
#if ENABLED(ASSISTED_TRAMMING) && !HAS_BED_PROBE
#error "ASSISTED_TRAMMING requires a bed probe."
#endif
/**
* G38 Probe Target
*/
#if ENABLED(G38_PROBE_TARGET)
#if !HAS_BED_PROBE
#error "G38_PROBE_TARGET requires a bed probe."
#elif !IS_CARTESIAN
#error "G38_PROBE_TARGET requires a Cartesian machine."
#endif
#endif
/**
* RGB_LED Requirements
*/
#define _RGB_TEST (PINS_EXIST(RGB_LED_R, RGB_LED_G, RGB_LED_B))
#if ENABLED(PRINTER_EVENT_LEDS) && !HAS_COLOR_LEDS
#error "PRINTER_EVENT_LEDS requires BLINKM, PCA9533, PCA9632, RGB_LED, RGBW_LED or NEOPIXEL_LED."
#elif ENABLED(RGB_LED)
#if !_RGB_TEST
#error "RGB_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, and RGB_LED_B_PIN."
#elif ENABLED(RGBW_LED)
#error "Please enable only one of RGB_LED and RGBW_LED."
#endif
#elif ENABLED(RGBW_LED)
#if !(_RGB_TEST && PIN_EXISTS(RGB_LED_W))
#error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN."
#endif
#endif
#undef _RGB_TEST
// NeoPixel requirements
#if ENABLED(NEOPIXEL_LED)
#if !PIN_EXISTS(NEOPIXEL) || NEOPIXEL_PIXELS == 0
#error "NEOPIXEL_LED requires NEOPIXEL_PIN and NEOPIXEL_PIXELS."
#elif ENABLED(NEOPIXEL2_SEPARATE) && !(defined(NEOPIXEL2_TYPE) && PIN_EXISTS(NEOPIXEL2) && NEOPIXEL2_PIXELS > 0)
#error "NEOPIXEL2_SEPARATE requires NEOPIXEL2_TYPE, NEOPIXEL2_PIN and NEOPIXEL2_PIXELS."
#elif ENABLED(NEO2_COLOR_PRESETS) && DISABLED(NEOPIXEL2_SEPARATE)
#error "NEO2_COLOR_PRESETS requires NEOPIXEL2_SEPARATE to be enabled."
#endif
#endif
#if DISABLED(NO_COMPILE_TIME_PWM)
#define _TEST_PWM(P) PWM_PIN(P)
#else
#define _TEST_PWM(P) 1 // pass
#endif
/**
* Auto Fan check for PWM pins
*/
#if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255
#define AF_ASSERT(N) OPTCODE(HAS_AUTO_FAN_##N, static_assert(_TEST_PWM(E##N##_AUTO_FAN_PIN), "E" STRINGIFY(N) "_AUTO_FAN_PIN is not a PWM pin. Set EXTRUDER_AUTO_FAN_SPEED to 255."))
REPEAT(8, AF_ASSERT)
#undef AF_ASSERT
#endif
/**
* Fan check
*/
#if HAS_FANCHECK
#if ALL(E0_FAN_TACHO_PULLUP, E0_FAN_TACHO_PULLDOWN)
#error "Enable only one of E0_FAN_TACHO_PULLUP or E0_FAN_TACHO_PULLDOWN."
#elif ALL(E1_FAN_TACHO_PULLUP, E1_FAN_TACHO_PULLDOWN)
#error "Enable only one of E1_FAN_TACHO_PULLUP or E1_FAN_TACHO_PULLDOWN."
#elif ALL(E2_FAN_TACHO_PULLUP, E2_FAN_TACHO_PULLDOWN)
#error "Enable only one of E2_FAN_TACHO_PULLUP or E2_FAN_TACHO_PULLDOWN."
#elif ALL(E3_FAN_TACHO_PULLUP, E3_FAN_TACHO_PULLDOWN)
#error "Enable only one of E3_FAN_TACHO_PULLUP or E3_FAN_TACHO_PULLDOWN."
#elif ALL(E4_FAN_TACHO_PULLUP, E4_FAN_TACHO_PULLDOWN)
#error "Enable only one of E4_FAN_TACHO_PULLUP or E4_FAN_TACHO_PULLDOWN."
#elif ALL(E5_FAN_TACHO_PULLUP, E5_FAN_TACHO_PULLDOWN)
#error "Enable only one of E5_FAN_TACHO_PULLUP or E5_FAN_TACHO_PULLDOWN."
#elif ALL(E6_FAN_TACHO_PULLUP, E6_FAN_TACHO_PULLDOWN)
#error "Enable only one of E6_FAN_TACHO_PULLUP or E6_FAN_TACHO_PULLDOWN."
#elif ALL(E7_FAN_TACHO_PULLUP, E7_FAN_TACHO_PULLDOWN)
#error "Enable only one of E7_FAN_TACHO_PULLUP or E7_FAN_TACHO_PULLDOWN."
#endif
#elif ENABLED(AUTO_REPORT_FANS)
#error "AUTO_REPORT_FANS requires one or more fans with a tachometer pin."
#endif
/**
* Make sure only one EEPROM type is enabled
*/
#if ENABLED(EEPROM_SETTINGS)
#if 1 < 0 \
+ ENABLED(I2C_EEPROM) \
+ ENABLED(SPI_EEPROM) \
+ ENABLED(QSPI_EEPROM) \
+ ENABLED(SDCARD_EEPROM_EMULATION) \
+ ENABLED(FLASH_EEPROM_EMULATION) \
+ ENABLED(SRAM_EEPROM_EMULATION) \
+ ENABLED(IIC_BL24CXX_EEPROM)
#error "Please select only one method of EEPROM Persistent Storage."
#endif
#endif
/**
* Make sure features that need to write to the SD card can
*/
#if ENABLED(SDCARD_READONLY)
#if ENABLED(POWER_LOSS_RECOVERY)
#error "Either disable SDCARD_READONLY or disable POWER_LOSS_RECOVERY."
#elif ENABLED(BINARY_FILE_TRANSFER)
#error "Either disable SDCARD_READONLY or disable BINARY_FILE_TRANSFER."
#elif ENABLED(SDCARD_EEPROM_EMULATION)
#error "Either disable SDCARD_READONLY or disable SDCARD_EEPROM_EMULATION."
#endif
#endif
#if ENABLED(SD_IGNORE_AT_STARTUP)
#if ENABLED(POWER_LOSS_RECOVERY)
#error "SD_IGNORE_AT_STARTUP is incompatible with POWER_LOSS_RECOVERY."
#elif ENABLED(SDCARD_EEPROM_EMULATION)
#error "SD_IGNORE_AT_STARTUP is incompatible with SDCARD_EEPROM_EMULATION."
#endif
#endif
/**
* Make sure only one display is enabled
*/
#if 1 < 0 \
+ ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
+ ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \
+ (ENABLED(U8GLIB_SSD1306) && DISABLED(IS_U8GLIB_SSD1306)) \
+ (ENABLED(MINIPANEL) && NONE(MKS_MINI_12864, ENDER2_STOCKDISPLAY)) \
+ (ENABLED(MKS_MINI_12864) && NONE(MKS_LCD12864A, MKS_LCD12864B)) \
+ (ENABLED(FYSETC_MINI_12864_2_1) && NONE(MKS_MINI_12864_V3, BTT_MINI_12864, BEEZ_MINI_12864)) \
+ COUNT_ENABLED(MKS_MINI_12864_V3, BTT_MINI_12864, BEEZ_MINI_12864) \
+ (ENABLED(EXTENSIBLE_UI) && DISABLED(IS_EXTUI)) \
+ (DISABLED(IS_LEGACY_TFT) && ENABLED(TFT_GENERIC)) \
+ (ENABLED(IS_LEGACY_TFT) && COUNT_ENABLED(TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI)) \
+ COUNT_ENABLED(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_TFT35, ANYCUBIC_LCD_VYPER) \
+ DGUS_UI_IS(ORIGIN) + DGUS_UI_IS(FYSETC) + DGUS_UI_IS(HIPRECY) + DGUS_UI_IS(MKS) + DGUS_UI_IS(RELOADED) + DGUS_UI_IS(IA_CREALITY) \
+ COUNT_ENABLED(ENDER2_STOCKDISPLAY, CR10_STOCKDISPLAY) \
+ COUNT_ENABLED(DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_PORTRAIT, DWIN_MARLINUI_LANDSCAPE) \
+ COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_GENERIC_12864_1_1) \
+ COUNT_ENABLED(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) \
+ COUNT_ENABLED(MKS_12864OLED, MKS_12864OLED_SSD1306) \
+ COUNT_ENABLED(MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, \
MKS_ROBIN_TFT_V1_1R, ANET_ET4_TFT28, ANET_ET5_TFT35, BIQU_BX_TFT70, BTT_TFT35_SPI_V1_0) \
+ COUNT_ENABLED(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C) \
+ COUNT_ENABLED(VIKI2, miniVIKI) \
+ ENABLED(WYH_L12864) \
+ COUNT_ENABLED(ZONESTAR_12864LCD, ZONESTAR_12864OLED, ZONESTAR_12864OLED_SSD1306) \
+ COUNT_ENABLED(ANET_FULL_GRAPHICS_LCD, CTC_A10S_A13) \
+ ENABLED(AZSMZ_12864) \
+ ENABLED(BQ_LCD_SMART_CONTROLLER) \
+ ENABLED(CARTESIO_UI) \
+ ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
+ ENABLED(FF_INTERFACEBOARD) \
+ ENABLED(FYSETC_242_OLED_12864) \
+ ENABLED(G3D_PANEL) \
+ ENABLED(LCD_FOR_MELZI) \
+ ENABLED(LCD_I2C_PANELOLU2) \
+ ENABLED(LCD_I2C_VIKI) \
+ ENABLED(LCM1602) \
+ ENABLED(LONGER_LK_TFT28) \
+ ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
+ ENABLED(MAKRPANEL) \
+ ENABLED(MALYAN_LCD) \
+ ENABLED(NEXTION_TFT) \
+ ENABLED(MKS_LCD12864A) \
+ ENABLED(MKS_LCD12864B) \
+ ENABLED(OLED_PANEL_TINYBOY2) \
+ ENABLED(OVERLORD_OLED) \
+ ENABLED(PANEL_ONE) \
+ ENABLED(RA_CONTROL_PANEL) \
+ ENABLED(RADDS_DISPLAY) \
+ ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \
+ ENABLED(RIGIDBOT_PANEL) \
+ ENABLED(SAV_3DGLCD) \
+ ENABLED(SAV_3DLCD) \
+ ENABLED(SILVER_GATE_GLCD_CONTROLLER) \
+ ENABLED(TFT_TRONXY_X5SA) \
+ ENABLED(TOUCH_UI_FTDI_EVE) \
+ ENABLED(U8GLIB_SH1106_EINSTART) \
+ ENABLED(ULTI_CONTROLLER) \
+ ENABLED(ULTIMAKERCONTROLLER) \
+ ENABLED(ULTIPANEL) \
+ ENABLED(ULTRA_LCD) \
+ ENABLED(YHCB2004) \
+ ENABLED(ZONESTAR_LCD) \
+ ENABLED(K3D_FULL_GRAPHIC_SMART_CONTROLLER) \
+ ENABLED(K3D_242_OLED_CONTROLLER)
#error "Please select only one LCD controller option."
#endif
#undef IS_U8GLIB_SSD1306
#undef IS_EXTUI
#if ANY(TFT_GENERIC, MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, \
TFT_TRONXY_X5SA, ANYCUBIC_TFT35, ANYCUBIC_TFT35, LONGER_LK_TFT28, ANET_ET4_TFT28, ANET_ET5_TFT35, BIQU_BX_TFT70, BTT_TFT35_SPI_V1_0)
#if NONE(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
#error "TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI is required for your TFT. Please enable one."
#elif MANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
#error "Please select only one of TFT_COLOR_UI, TFT_CLASSIC_UI, or TFT_LVGL_UI."
#endif
#elif ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
#error "TFT_(COLOR|CLASSIC|LVGL)_UI requires a TFT display to be enabled."
#endif
#if ENABLED(TFT_GENERIC) && NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
#error "TFT_GENERIC requires either TFT_INTERFACE_FSMC or TFT_INTERFACE_SPI interface."
#elif ALL(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
#error "Please enable only one of TFT_INTERFACE_FSMC or TFT_INTERFACE_SPI."
#endif
#if defined(LCD_SCREEN_ROTATE) && LCD_SCREEN_ROTATE != 0 && LCD_SCREEN_ROTATE != 90 && LCD_SCREEN_ROTATE != 180 && LCD_SCREEN_ROTATE != 270
#error "LCD_SCREEN_ROTATE must be 0, 90, 180, or 270."
#endif
#if MANY(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320, TFT_RES_1024x600)
#error "Please select only one of TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320, or TFT_RES_1024x600."
#endif
#if ENABLED(TFT_LVGL_UI)
#if DISABLED(TFT_RES_480x320)
#error "TFT_LVGL_UI requires TFT_RES_480x320."
#elif !HAS_MEDIA
#error "TFT_LVGL_UI requires SDSUPPORT."
#endif
#endif
#if defined(GRAPHICAL_TFT_UPSCALE) && !WITHIN(GRAPHICAL_TFT_UPSCALE, 2, 8)
#error "GRAPHICAL_TFT_UPSCALE must be between 2 and 8."
#endif
#if ALL(CHIRON_TFT_STANDARD, CHIRON_TFT_NEW)
#error "Please select only one of CHIRON_TFT_STANDARD or CHIRON_TFT_NEW."
#endif
#if ENABLED(ANYCUBIC_LCD_CHIRON)
#ifndef BEEPER_PIN
#error "ANYCUBIC_LCD_CHIRON requires BEEPER_PIN"
#elif !HAS_MEDIA
#error "ANYCUBIC_LCD_CHIRON requires SDSUPPORT"
#elif TEMP_SENSOR_BED == 0
#error "ANYCUBIC_LCD_CHIRON requires heatbed (TEMP_SENSOR_BED)"
#elif NONE(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING)
#error "ANYCUBIC_LCD_CHIRON requires one of: AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL or MESH_BED_LEVELING"
#elif DISABLED(BABYSTEPPING)
#error "ANYCUBIC_LCD_CHIRON requires BABYSTEPPING"
#endif
#endif
#if ENABLED(ANYCUBIC_LCD_VYPER)
static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_2), "zh_CN") == 0, "LCD_LANGUAGE_2 must be set to zh_CN for ANYCUBIC_LCD_VYPER.");
#endif
#if ENABLED(NO_LCD_SDCARD) && SD_CONNECTION_IS(LCD)
#error "SDCARD_CONNECTION cannot be set to LCD for the enabled display. No available SD card reader."
#endif
/**
* Ender-3 V2 controller has some limitations
*/
#if ENABLED(DWIN_CREALITY_LCD)
#if !HAS_MEDIA
#error "DWIN_CREALITY_LCD requires SDSUPPORT to be enabled."
#elif ANY(PID_EDIT_MENU, PID_AUTOTUNE_MENU)
#error "DWIN_CREALITY_LCD does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU."
#elif ANY(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU)
#error "DWIN_CREALITY_LCD does not support MPC_EDIT_MENU or MPC_AUTOTUNE_MENU."
#elif ENABLED(LCD_BED_TRAMMING)
#error "DWIN_CREALITY_LCD does not support LCD_BED_TRAMMING."
#elif ALL(LCD_BED_LEVELING, PROBE_MANUALLY)
#error "DWIN_CREALITY_LCD does not support LCD_BED_LEVELING with PROBE_MANUALLY."
#endif
#elif ENABLED(DWIN_LCD_PROUI)
#if !HAS_MEDIA
#error "DWIN_LCD_PROUI requires SDSUPPORT to be enabled."
#elif ALL(LCD_BED_LEVELING, PROBE_MANUALLY)
#error "DWIN_LCD_PROUI does not support LCD_BED_LEVELING with PROBE_MANUALLY."
#endif
#endif
#if HAS_BACKLIGHT_TIMEOUT
#if !HAS_ENCODER_ACTION && DISABLED(HAS_DWIN_E3V2)
#error "LCD_BACKLIGHT_TIMEOUT_MINS requires an LCD with encoder or keypad."
#elif HAS_DISPLAY_SLEEP
#error "LCD_BACKLIGHT_TIMEOUT_MINS and DISPLAY_SLEEP_MINUTES are not currently supported at the same time."
#elif ENABLED(NEOPIXEL_BKGD_INDEX_FIRST)
#if PIN_EXISTS(LCD_BACKLIGHT)
#error "LCD_BACKLIGHT_PIN and NEOPIXEL_BKGD_INDEX_FIRST are not supported at the same time."
#elif ENABLED(NEOPIXEL_BKGD_ALWAYS_ON)
#error "LCD_BACKLIGHT_TIMEOUT is not compatible with NEOPIXEL_BKGD_ALWAYS_ON."
#endif
#elif !PIN_EXISTS(LCD_BACKLIGHT) && DISABLED(HAS_DWIN_E3V2)
#error "LCD_BACKLIGHT_TIMEOUT_MINS requires LCD_BACKLIGHT_PIN, NEOPIXEL_BKGD_INDEX_FIRST, or an Ender-3 V2 DWIN LCD."
#endif
#elif HAS_DISPLAY_SLEEP
#if NONE(TOUCH_SCREEN, HAS_MARLINUI_U8GLIB) || ANY(IS_U8GLIB_LM6059_AF, IS_U8GLIB_ST7565_64128, REPRAPWORLD_GRAPHICAL_LCD, FYSETC_MINI_12864, CR10_STOCKDISPLAY, MINIPANEL)
#error "DISPLAY_SLEEP_MINUTES is not supported by your display."
#undef HAS_DISPLAY_SLEEP
#elif !WITHIN(DISPLAY_SLEEP_MINUTES, 0, 255)
#error "DISPLAY_SLEEP_MINUTES must be between 0 and 255."
#elif DISABLED(EDITABLE_DISPLAY_TIMEOUT) && DISPLAY_SLEEP_MINUTES == 0
#error "DISPLAY_SLEEP_MINUTES must be greater than 0 with EDITABLE_DISPLAY_TIMEOUT disabled."
#endif
#endif
// Startup Tune requirements
#ifdef STARTUP_TUNE
#if ANY(ANYCUBIC_LCD_CHIRON, ANYCUBIC_LCD_VYPER)
#error "STARTUP_TUNE should be disabled with ANYCUBIC_LCD_CHIRON or ANYCUBIC_LCD_VYPER."
#elif !(ALL(HAS_BEEPER, SPEAKER) || USE_MARLINUI_BUZZER)
#error "STARTUP_TUNE requires a BEEPER_PIN with SPEAKER or USE_MARLINUI_BUZZER."
#undef STARTUP_TUNE
#endif
#endif
/**
* Some boards forbid the use of -1 Native USB
*/
#if ENABLED(BOARD_NO_NATIVE_USB)
#undef BOARD_NO_NATIVE_USB
#if SERIAL_PORT == -1
#error "SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set SERIAL_PORT to a valid value for your board."
#elif SERIAL_PORT_2 == -1
#error "SERIAL_PORT_2 is set to -1, but the MOTHERBOARD has no native USB support. Set SERIAL_PORT_2 to a valid value for your board."
#elif MMU2_SERIAL_PORT == -1
#error "MMU2_SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set MMU2_SERIAL_PORT to a valid value for your board."
#elif LCD_SERIAL_PORT == -1
#error "LCD_SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set LCD_SERIAL_PORT to a valid value for your board."
#endif
#endif
/**
* MMU2 require a dedicated serial port
*/
#ifdef MMU2_SERIAL_PORT
#if MMU2_SERIAL_PORT == SERIAL_PORT
#error "MMU2_SERIAL_PORT cannot be the same as SERIAL_PORT."
#elif defined(SERIAL_PORT_2) && MMU2_SERIAL_PORT == SERIAL_PORT_2
#error "MMU2_SERIAL_PORT cannot be the same as SERIAL_PORT_2."
#elif defined(LCD_SERIAL_PORT) && MMU2_SERIAL_PORT == LCD_SERIAL_PORT
#error "MMU2_SERIAL_PORT cannot be the same as LCD_SERIAL_PORT."
#endif
#endif
/**
* Serial displays require a dedicated serial port
*/
#ifdef LCD_SERIAL_PORT
#if LCD_SERIAL_PORT == SERIAL_PORT
#error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT."
#elif defined(SERIAL_PORT_2) && LCD_SERIAL_PORT == SERIAL_PORT_2
#error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT_2."
#endif
#else
#if HAS_DGUS_LCD
#error "The DGUS LCD requires LCD_SERIAL_PORT to be defined."
#elif ANY(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_LCD_VYPER)
#error "ANYCUBIC_LCD_* requires LCD_SERIAL_PORT to be defined."
#elif ENABLED(MALYAN_LCD)
#error "MALYAN_LCD requires LCD_SERIAL_PORT to be defined."
#elif ENABLED(NEXTION_LCD)
#error "NEXTION_LCD requires LCD_SERIAL_PORT to be defined."
#endif
#endif
/**
* Check existing CS pins against enabled TMC SPI drivers.
*/
#define INVALID_TMC_SPI(ST) (AXIS_HAS_SPI(ST) && !PIN_EXISTS(ST##_CS))
#if INVALID_TMC_SPI(X)
#error "An SPI driven TMC driver on X requires X_CS_PIN."
#elif INVALID_TMC_SPI(X2)
#error "An SPI driven TMC driver on X2 requires X2_CS_PIN."
#elif INVALID_TMC_SPI(Y)
#error "An SPI driven TMC driver on Y requires Y_CS_PIN."
#elif INVALID_TMC_SPI(Y2)
#error "An SPI driven TMC driver on Y2 requires Y2_CS_PIN."
#elif INVALID_TMC_SPI(Z)
#error "An SPI driven TMC driver on Z requires Z_CS_PIN."
#elif INVALID_TMC_SPI(Z2)
#error "An SPI driven TMC driver on Z2 requires Z2_CS_PIN."
#elif INVALID_TMC_SPI(Z3)
#error "An SPI driven TMC driver on Z3 requires Z3_CS_PIN."
#elif INVALID_TMC_SPI(Z4)
#error "An SPI driven TMC driver on Z4 requires Z4_CS_PIN."
#elif INVALID_TMC_SPI(E0)
#error "An SPI driven TMC driver on E0 requires E0_CS_PIN."
#elif INVALID_TMC_SPI(E1)
#error "An SPI driven TMC driver on E1 requires E1_CS_PIN."
#elif INVALID_TMC_SPI(E2)
#error "An SPI driven TMC driver on E2 requires E2_CS_PIN."
#elif INVALID_TMC_SPI(E3)
#error "An SPI driven TMC driver on E3 requires E3_CS_PIN."
#elif INVALID_TMC_SPI(E4)
#error "An SPI driven TMC driver on E4 requires E4_CS_PIN."
#elif INVALID_TMC_SPI(E5)
#error "An SPI driven TMC driver on E5 requires E5_CS_PIN."
#elif INVALID_TMC_SPI(E6)
#error "An SPI driven TMC driver on E6 requires E6_CS_PIN."
#elif INVALID_TMC_SPI(E7)
#error "An SPI driven TMC driver on E7 requires E7_CS_PIN."
#elif INVALID_TMC_SPI(I)
#error "An SPI driven TMC on I requires I_CS_PIN."
#elif INVALID_TMC_SPI(J)
#error "An SPI driven TMC on J requires J_CS_PIN."
#elif INVALID_TMC_SPI(K)
#error "An SPI driven TMC on K requires K_CS_PIN."
#elif INVALID_TMC_SPI(U)
#error "An SPI driven TMC on U requires U_CS_PIN."
#elif INVALID_TMC_SPI(V)
#error "An SPI driven TMC on V requires V_CS_PIN."
#elif INVALID_TMC_SPI(W)
#error "An SPI driven TMC on W requires W_CS_PIN."
#endif
#undef INVALID_TMC_SPI
/**
* Check existing RX/TX pins against enable TMC UART drivers.
*/
#define INVALID_TMC_UART(ST) (AXIS_HAS_UART(ST) && !(defined(ST##_HARDWARE_SERIAL) || (PINS_EXIST(ST##_SERIAL_RX, ST##_SERIAL_TX))))
#if INVALID_TMC_UART(X)
#error "TMC2208 or TMC2209 on X requires X_HARDWARE_SERIAL or X_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(X2)
#error "TMC2208 or TMC2209 on X2 requires X2_HARDWARE_SERIAL or X2_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(Y)
#error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(Y2)
#error "TMC2208 or TMC2209 on Y2 requires Y2_HARDWARE_SERIAL or Y2_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(Z)
#error "TMC2208 or TMC2209 on Z requires Z_HARDWARE_SERIAL or Z_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(Z2)
#error "TMC2208 or TMC2209 on Z2 requires Z2_HARDWARE_SERIAL or Z2_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(Z3)
#error "TMC2208 or TMC2209 on Z3 requires Z3_HARDWARE_SERIAL or Z3_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(Z4)
#error "TMC2208 or TMC2209 on Z4 requires Z4_HARDWARE_SERIAL or Z4_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(E0)
#error "TMC2208 or TMC2209 on E0 requires E0_HARDWARE_SERIAL or E0_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(E1)
#error "TMC2208 or TMC2209 on E1 requires E1_HARDWARE_SERIAL or E1_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(E2)
#error "TMC2208 or TMC2209 on E2 requires E2_HARDWARE_SERIAL or E2_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(E3)
#error "TMC2208 or TMC2209 on E3 requires E3_HARDWARE_SERIAL or E3_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(E4)
#error "TMC2208 or TMC2209 on E4 requires E4_HARDWARE_SERIAL or E4_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(E5)
#error "TMC2208 or TMC2209 on E5 requires E5_HARDWARE_SERIAL or E5_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(E6)
#error "TMC2208 or TMC2209 on E6 requires E6_HARDWARE_SERIAL or E6_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(E7)
#error "TMC2208 or TMC2209 on E7 requires E7_HARDWARE_SERIAL or E7_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(I)
#error "TMC2208 or TMC2209 on I requires I_HARDWARE_SERIAL or I_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(J)
#error "TMC2208 or TMC2209 on J requires J_HARDWARE_SERIAL or J_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(K)
#error "TMC2208 or TMC2209 on K requires K_HARDWARE_SERIAL or K_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(U)
#error "TMC2208 or TMC2209 on U requires U_HARDWARE_SERIAL or U_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(V)
#error "TMC2208 or TMC2209 on V requires V_HARDWARE_SERIAL or V_SERIAL_(RX|TX)_PIN."
#elif INVALID_TMC_UART(W)
#error "TMC2208 or TMC2209 on W requires W_HARDWARE_SERIAL or W_SERIAL_(RX|TX)_PIN."
#endif
#undef INVALID_TMC_UART
/**
* TMC2209 slave address values
*/
#define INVALID_TMC_ADDRESS(ST) static_assert(0 <= ST##_SLAVE_ADDRESS && ST##_SLAVE_ADDRESS <= 3, "TMC2209 slave address must be 0, 1, 2 or 3")
#if AXIS_DRIVER_TYPE_X(TMC2209)
INVALID_TMC_ADDRESS(X);
#elif AXIS_DRIVER_TYPE_X2(TMC2209)
INVALID_TMC_ADDRESS(X2);
#elif AXIS_DRIVER_TYPE_Y(TMC2209)
INVALID_TMC_ADDRESS(Y);
#elif AXIS_DRIVER_TYPE_Y2(TMC2209)
INVALID_TMC_ADDRESS(Y2);
#elif AXIS_DRIVER_TYPE_Z(TMC2209)
INVALID_TMC_ADDRESS(Z);
#elif AXIS_DRIVER_TYPE_Z2(TMC2209)
INVALID_TMC_ADDRESS(Z2);
#elif AXIS_DRIVER_TYPE_Z3(TMC2209)
INVALID_TMC_ADDRESS(Z3);
#elif AXIS_DRIVER_TYPE_Z4(TMC2209)
INVALID_TMC_ADDRESS(Z4);
#elif AXIS_DRIVER_TYPE_I(TMC2209)
INVALID_TMC_ADDRESS(I);
#elif AXIS_DRIVER_TYPE_J(TMC2209)
INVALID_TMC_ADDRESS(J);
#elif AXIS_DRIVER_TYPE_K(TMC2209)
INVALID_TMC_ADDRESS(K);
#elif AXIS_DRIVER_TYPE_U(TMC2209)
INVALID_TMC_ADDRESS(U);
#elif AXIS_DRIVER_TYPE_V(TMC2209)
INVALID_TMC_ADDRESS(V);
#elif AXIS_DRIVER_TYPE_W(TMC2209)
INVALID_TMC_ADDRESS(W);
#elif AXIS_DRIVER_TYPE_E0(TMC2209)
INVALID_TMC_ADDRESS(E0);
#elif AXIS_DRIVER_TYPE_E1(TMC2209)
INVALID_TMC_ADDRESS(E1);
#elif AXIS_DRIVER_TYPE_E2(TMC2209)
INVALID_TMC_ADDRESS(E2);
#elif AXIS_DRIVER_TYPE_E3(TMC2209)
INVALID_TMC_ADDRESS(E3);
#elif AXIS_DRIVER_TYPE_E4(TMC2209)
INVALID_TMC_ADDRESS(E4);
#elif AXIS_DRIVER_TYPE_E5(TMC2209)
INVALID_TMC_ADDRESS(E5);
#elif AXIS_DRIVER_TYPE_E6(TMC2209)
INVALID_TMC_ADDRESS(E6);
#elif AXIS_DRIVER_TYPE_E7(TMC2209)
INVALID_TMC_ADDRESS(E7);
#endif
#undef INVALID_TMC_ADDRESS
#define _TMC_MICROSTEP_IS_VALID(MS) (MS == 0 || MS == 2 || MS == 4 || MS == 8 || MS == 16 || MS == 32 || MS == 64 || MS == 128 || MS == 256)
#define TMC_MICROSTEP_IS_VALID(M) (!AXIS_IS_TMC(M) || _TMC_MICROSTEP_IS_VALID(M##_MICROSTEPS))
#define INVALID_TMC_MS(ST) static_assert(0, "Invalid " STRINGIFY(ST) "_MICROSTEPS. Valid values are 0, 2, 4, 8, 16, 32, 64, 128, and 256.")
#if !TMC_MICROSTEP_IS_VALID(X)
INVALID_TMC_MS(X);
#elif !TMC_MICROSTEP_IS_VALID(Y)
INVALID_TMC_MS(Y)
#elif !TMC_MICROSTEP_IS_VALID(Z)
INVALID_TMC_MS(Z)
#elif !TMC_MICROSTEP_IS_VALID(X2)
INVALID_TMC_MS(X2);
#elif !TMC_MICROSTEP_IS_VALID(Y2)
INVALID_TMC_MS(Y2)
#elif !TMC_MICROSTEP_IS_VALID(Z2)
INVALID_TMC_MS(Z2)
#elif !TMC_MICROSTEP_IS_VALID(Z3)
INVALID_TMC_MS(Z3)
#elif !TMC_MICROSTEP_IS_VALID(Z4)
INVALID_TMC_MS(Z4)
#elif !TMC_MICROSTEP_IS_VALID(E0)
INVALID_TMC_MS(E0)
#elif !TMC_MICROSTEP_IS_VALID(E1)
INVALID_TMC_MS(E1)
#elif !TMC_MICROSTEP_IS_VALID(E2)
INVALID_TMC_MS(E2)
#elif !TMC_MICROSTEP_IS_VALID(E3)
INVALID_TMC_MS(E3)
#elif !TMC_MICROSTEP_IS_VALID(E4)
INVALID_TMC_MS(E4)
#elif !TMC_MICROSTEP_IS_VALID(E5)
INVALID_TMC_MS(E5)
#elif !TMC_MICROSTEP_IS_VALID(E6)
INVALID_TMC_MS(E6)
#elif !TMC_MICROSTEP_IS_VALID(E7)
INVALID_TMC_MS(E7)
#elif !TMC_MICROSTEP_IS_VALID(I)
INVALID_TMC_MS(I)
#elif !TMC_MICROSTEP_IS_VALID(J)
INVALID_TMC_MS(J)
#elif !TMC_MICROSTEP_IS_VALID(K)
INVALID_TMC_MS(K)
#elif !TMC_MICROSTEP_IS_VALID(U)
INVALID_TMC_MS(U)
#elif !TMC_MICROSTEP_IS_VALID(V)
INVALID_TMC_MS(V)
#elif !TMC_MICROSTEP_IS_VALID(W)
INVALID_TMC_MS(W)
#endif
#undef INVALID_TMC_MS
#undef TMC_MICROSTEP_IS_VALID
#undef _TMC_MICROSTEP_IS_VALID
#if ENABLED(DELTA) && (ENABLED(STEALTHCHOP_XY) != ENABLED(STEALTHCHOP_Z))
#error "STEALTHCHOP_XY and STEALTHCHOP_Z must be the same on DELTA."
#endif
// H-Bot kinematic axes can't use homing phases
#if ANY(IS_CORE, MARKFORGED_XY, MARKFORGED_YX) && defined(TMC_HOME_PHASE)
constexpr float _phases[] = TMC_HOME_PHASE, _vphase[9] = TMC_HOME_PHASE;
constexpr int _nphase = COUNT(_phases);
static_assert(_nphase == NUM_AXES, "TMC_HOME_PHASE must have exactly " _NUM_AXES_STR " elements.");
static_assert(_nphase < 0 || _vphase[0] == -1 || NORMAL_AXIS == 0, "TMC_HOME_PHASE.x must be -1 for the selected kinematics.");
static_assert(_nphase < 1 || _vphase[1] == -1 || NORMAL_AXIS == 1, "TMC_HOME_PHASE.y must be -1 for the selected kinematics.");
static_assert(_nphase < 2 || _vphase[2] == -1 || NORMAL_AXIS == 2, "TMC_HOME_PHASE.z must be -1 for the selected kinematics.");
static_assert(_nphase < 0 || WITHIN(_vphase[0], -1, 1023), "TMC_HOME_PHASE.x must be between -1 and 1023.");
static_assert(_nphase < 1 || WITHIN(_vphase[1], -1, 1023), "TMC_HOME_PHASE.y must be between -1 and 1023.");
static_assert(_nphase < 2 || WITHIN(_vphase[2], -1, 1023), "TMC_HOME_PHASE.z must be between -1 and 1023.");
static_assert(_nphase < 3 || WITHIN(_vphase[3], -1, 1023), "TMC_HOME_PHASE.i must be between -1 and 1023.");
static_assert(_nphase < 4 || WITHIN(_vphase[4], -1, 1023), "TMC_HOME_PHASE.j must be between -1 and 1023.");
static_assert(_nphase < 5 || WITHIN(_vphase[5], -1, 1023), "TMC_HOME_PHASE.k must be between -1 and 1023.");
static_assert(_nphase < 6 || WITHIN(_vphase[6], -1, 1023), "TMC_HOME_PHASE.u must be between -1 and 1023.");
static_assert(_nphase < 7 || WITHIN(_vphase[7], -1, 1023), "TMC_HOME_PHASE.v must be between -1 and 1023.");
static_assert(_nphase < 8 || WITHIN(_vphase[8], -1, 1023), "TMC_HOME_PHASE.w must be between -1 and 1023.");
#endif
#if ENABLED(SENSORLESS_HOMING)
// Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop
// is necessary in order to reset the stallGuard indication between the initial movement of all three
// towers to +Z and the individual homing of each tower. This restriction can be removed once a means of
// clearing the stallGuard activated status is found.
#if NONE(SPI_ENDSTOPS, ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS)
#if X_SENSORLESS && X_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_XMIN)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMIN (or ENDSTOPPULLUPS) for X MIN homing."
#elif X_SENSORLESS && X_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_XMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMAX (or ENDSTOPPULLUPS) for X MAX homing."
#elif Y_SENSORLESS && Y_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_YMIN)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMIN (or ENDSTOPPULLUPS) for Y MIN homing."
#elif Y_SENSORLESS && Y_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_YMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMAX (or ENDSTOPPULLUPS) for Y MAX homing."
#elif Z_SENSORLESS && Z_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_ZMIN)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) for Z MIN homing."
#elif Z_SENSORLESS && Z_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_ZMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) for Z MAX homing."
#elif I_SENSORLESS && I_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_IMIN)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_IMIN (or ENDSTOPPULLUPS) for I MIN homing."
#elif I_SENSORLESS && I_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_IMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_IMAX (or ENDSTOPPULLUPS) for I MAX homing."
#elif J_SENSORLESS && J_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_JMIN)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_JMIN (or ENDSTOPPULLUPS) for J MIN homing."
#elif J_SENSORLESS && J_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_JMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_JMAX (or ENDSTOPPULLUPS) for J MAX homing."
#elif K_SENSORLESS && K_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_KMIN)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMIN (or ENDSTOPPULLUPS) for K MIN homing."
#elif K_SENSORLESS && K_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_KMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMAX (or ENDSTOPPULLUPS) for K MAX homing."
#elif U_SENSORLESS && U_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_UMIN)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_UMIN (or ENDSTOPPULLUPS) for U MIN homing."
#elif U_SENSORLESS && U_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_UMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_UMAX (or ENDSTOPPULLUPS) for U MAX homing."
#elif V_SENSORLESS && V_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_VMIN)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_VMIN (or ENDSTOPPULLUPS) for V MIN homing."
#elif V_SENSORLESS && V_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_VMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_VMAX (or ENDSTOPPULLUPS) for V MAX homing."
#elif W_SENSORLESS && W_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_WMIN)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_WMIN (or ENDSTOPPULLUPS) for W MIN homing."
#elif W_SENSORLESS && W_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_WMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_WMAX (or ENDSTOPPULLUPS) for W MAX homing."
#endif
#endif
#if ENABLED(SPI_ENDSTOPS)
#if !ANY_AXIS_HAS(SPI)
#error "SPI_ENDSTOPS requires stepper drivers with SPI support."
#endif
#else // !SPI_ENDSTOPS
// Stall detection DIAG = HIGH : TMC2209
// Stall detection DIAG = LOW : TMC2130/TMC2160/TMC2660/TMC5130/TMC5160
#if X_SENSORLESS
#define _HIT_STATE AXIS_DRIVER_TYPE(X,TMC2209)
#if X_HOME_TO_MIN && X_MIN_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_HIT_STATE HIGH for X MIN homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_HIT_STATE LOW for X MIN homing."
#endif
#elif X_HOME_TO_MAX && X_MAX_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_HIT_STATE HIGH for X MAX homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_HIT_STATE LOW for X MAX homing."
#endif
#endif
#undef _HIT_STATE
#endif
#if Y_SENSORLESS
#define _HIT_STATE AXIS_DRIVER_TYPE(Y,TMC2209)
#if Y_HOME_TO_MIN && Y_MIN_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_HIT_STATE HIGH for Y MIN homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_HIT_STATE LOW for Y MIN homing."
#endif
#elif Y_HOME_TO_MAX && Y_MAX_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_HIT_STATE HIGH for Y MAX homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_HIT_STATE LOW for Y MAX homing."
#endif
#endif
#undef _HIT_STATE
#endif
#if Z_SENSORLESS
#define _HIT_STATE AXIS_DRIVER_TYPE(Z,TMC2209)
#if Z_HOME_TO_MIN && Z_MIN_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_HIT_STATE HIGH for Z MIN homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_HIT_STATE LOW for Z MIN homing."
#endif
#elif Z_HOME_TO_MAX && Z_MAX_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_HIT_STATE HIGH for Z MAX homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_HIT_STATE LOW for Z MAX homing."
#endif
#endif
#undef _HIT_STATE
#endif
#if I_SENSORLESS
#define _HIT_STATE AXIS_DRIVER_TYPE(I,TMC2209)
#if I_HOME_TO_MIN && I_MIN_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires I_MIN_ENDSTOP_HIT_STATE HIGH for I MIN homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires I_MIN_ENDSTOP_HIT_STATE LOW for I MIN homing."
#endif
#elif I_HOME_TO_MAX && I_MAX_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires I_MAX_ENDSTOP_HIT_STATE HIGH for I MAX homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires I_MAX_ENDSTOP_HIT_STATE LOW for I MAX homing."
#endif
#endif
#undef _HIT_STATE
#endif
#if J_SENSORLESS
#define _HIT_STATE AXIS_DRIVER_TYPE(J,TMC2209)
#if J_HOME_TO_MIN && J_MIN_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires J_MIN_ENDSTOP_HIT_STATE HIGH for J MIN homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires J_MIN_ENDSTOP_HIT_STATE LOW for J MIN homing."
#endif
#elif J_HOME_TO_MAX && J_MAX_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires J_MAX_ENDSTOP_HIT_STATE HIGH for J MAX homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires J_MAX_ENDSTOP_HIT_STATE LOW for J MAX homing."
#endif
#endif
#undef _HIT_STATE
#endif
#if K_SENSORLESS
#define _HIT_STATE AXIS_DRIVER_TYPE(K,TMC2209)
#if K_HOME_TO_MIN && K_MIN_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires K_MIN_ENDSTOP_HIT_STATE HIGH for K MIN homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires K_MIN_ENDSTOP_HIT_STATE LOW for K MIN homing."
#endif
#elif K_HOME_TO_MAX && K_MAX_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires K_MAX_ENDSTOP_HIT_STATE HIGH for K MAX homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires K_MAX_ENDSTOP_HIT_STATE LOW for K MAX homing."
#endif
#endif
#undef _HIT_STATE
#endif
#if U_SENSORLESS
#define _HIT_STATE AXIS_DRIVER_TYPE(U,TMC2209)
#if U_HOME_TO_MIN && U_MIN_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires U_MIN_ENDSTOP_HIT_STATE HIGH for U MIN homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires U_MIN_ENDSTOP_HIT_STATE LOW for U MIN homing."
#endif
#elif U_HOME_TO_MAX && U_MAX_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires U_MAX_ENDSTOP_HIT_STATE HIGH for U MAX homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires U_MAX_ENDSTOP_HIT_STATE LOW for U MAX homing."
#endif
#endif
#undef _HIT_STATE
#endif
#if V_SENSORLESS
#define _HIT_STATE AXIS_DRIVER_TYPE(V,TMC2209)
#if V_HOME_TO_MIN && V_MIN_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires V_MIN_ENDSTOP_HIT_STATE HIGH for V MIN homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires V_MIN_ENDSTOP_HIT_STATE LOW for V MIN homing."
#endif
#elif V_HOME_TO_MAX && V_MAX_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires V_MAX_ENDSTOP_HIT_STATE HIGH for V MAX homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires V_MAX_ENDSTOP_HIT_STATE LOW for V MAX homing."
#endif
#endif
#undef _HIT_STATE
#endif
#if W_SENSORLESS
#define _HIT_STATE AXIS_DRIVER_TYPE(W,TMC2209)
#if W_HOME_TO_MIN && W_MIN_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires W_MIN_ENDSTOP_HIT_STATE HIGH for W MIN homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires W_MIN_ENDSTOP_HIT_STATE LOW for W MIN homing."
#endif
#elif W_HOME_TO_MAX && W_MAX_ENDSTOP_HIT_STATE != _HIT_STATE
#if _HIT_STATE
#error "SENSORLESS_HOMING requires W_MAX_ENDSTOP_HIT_STATE HIGH for W MAX homing with TMC2209."
#else
#error "SENSORLESS_HOMING requires W_MAX_ENDSTOP_HIT_STATE LOW for W MAX homing."
#endif
#endif
#undef _HIT_STATE
#endif
#endif // !SPI_ENDSTOPS
#if ENABLED(DELTA) && !ALL(STEALTHCHOP_XY, STEALTHCHOP_Z)
#error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z."
#elif ENDSTOP_NOISE_THRESHOLD
#error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_THRESHOLD."
#elif !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS || I_SENSORLESS || J_SENSORLESS || K_SENSORLESS || U_SENSORLESS || V_SENSORLESS || W_SENSORLESS)
#error "SENSORLESS_HOMING requires a TMC stepper driver with StallGuard on X, Y, Z, I, J, K, U, V, or W axes."
#endif
#endif // SENSORLESS_HOMING
// Sensorless probing requirements
#if ENABLED(SENSORLESS_PROBING)
#if ENABLED(DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS)
#error "SENSORLESS_PROBING for DELTA requires TMC stepper drivers with StallGuard on X, Y, and Z axes."
#elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#error "SENSORLESS_PROBING cannot be used with Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN."
#elif ENABLED(USE_PROBE_FOR_Z_HOMING)
#error "SENSORLESS_PROBING cannot be used with USE_PROBE_FOR_Z_HOMING."
#elif !Z_SENSORLESS
#error "SENSORLESS_PROBING requires a TMC stepper driver with StallGuard on Z."
#endif
#endif
// Sensorless homing is required for both combined steppers in an H-bot
#if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS
#error "CoreXY requires both X and Y to use sensorless homing if either one does."
#elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS && !HOMING_Z_WITH_PROBE
#error "CoreXZ requires both X and Z to use sensorless homing if either one does."
#elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS && !HOMING_Z_WITH_PROBE
#error "CoreYZ requires both Y and Z to use sensorless homing if either one does."
#elif ANY(MARKFORGED_XY, MARKFORGED_YX) && X_SENSORLESS != Y_SENSORLESS
#error "MARKFORGED requires both X and Y to use sensorless homing if either one does."
#endif
// TMC Hybrid Threshold
#if ENABLED(HYBRID_THRESHOLD)
#if !STEALTHCHOP_ENABLED
#error "Enable STEALTHCHOP_(XY|Z|E) to use HYBRID_THRESHOLD."
#elif defined(X_HYBRID_THRESHOLD) && X_HYBRID_THRESHOLD == 0
#error "X_HYBRID_THRESHOLD must be greater than 0."
#elif defined(X2_HYBRID_THRESHOLD) && X2_HYBRID_THRESHOLD == 0
#error "X2_HYBRID_THRESHOLD must be greater than 0."
#elif defined(Y_HYBRID_THRESHOLD) && Y_HYBRID_THRESHOLD == 0
#error "Y_HYBRID_THRESHOLD must be greater than 0."
#elif defined(Y2_HYBRID_THRESHOLD) && Y2_HYBRID_THRESHOLD == 0
#error "Y2_HYBRID_THRESHOLD must be greater than 0."
#elif defined(Z_HYBRID_THRESHOLD) && Z_HYBRID_THRESHOLD == 0
#error "Z_HYBRID_THRESHOLD must be greater than 0."
#elif defined(Z2_HYBRID_THRESHOLD) && Z2_HYBRID_THRESHOLD == 0
#error "Z2_HYBRID_THRESHOLD must be greater than 0."
#elif defined(Z3_HYBRID_THRESHOLD) && Z3_HYBRID_THRESHOLD == 0
#error "Z3_HYBRID_THRESHOLD must be greater than 0."
#elif defined(Z4_HYBRID_THRESHOLD) && Z4_HYBRID_THRESHOLD == 0
#error "Z4_HYBRID_THRESHOLD must be greater than 0."
#elif defined(I_HYBRID_THRESHOLD) && I_HYBRID_THRESHOLD == 0
#error "I_HYBRID_THRESHOLD must be greater than 0."
#elif defined(J_HYBRID_THRESHOLD) && J_HYBRID_THRESHOLD == 0
#error "J_HYBRID_THRESHOLD must be greater than 0."
#elif defined(K_HYBRID_THRESHOLD) && K_HYBRID_THRESHOLD == 0
#error "K_HYBRID_THRESHOLD must be greater than 0."
#elif defined(U_HYBRID_THRESHOLD) && U_HYBRID_THRESHOLD == 0
#error "U_HYBRID_THRESHOLD must be greater than 0."
#elif defined(V_HYBRID_THRESHOLD) && V_HYBRID_THRESHOLD == 0
#error "V_HYBRID_THRESHOLD must be greater than 0."
#elif defined(W_HYBRID_THRESHOLD) && W_HYBRID_THRESHOLD == 0
#error "W_HYBRID_THRESHOLD must be greater than 0."
#elif defined(E0_HYBRID_THRESHOLD) && E0_HYBRID_THRESHOLD == 0
#error "E0_HYBRID_THRESHOLD must be greater than 0."
#elif defined(E1_HYBRID_THRESHOLD) && E1_HYBRID_THRESHOLD == 0
#error "E1_HYBRID_THRESHOLD must be greater than 0."
#elif defined(E2_HYBRID_THRESHOLD) && E2_HYBRID_THRESHOLD == 0
#error "E2_HYBRID_THRESHOLD must be greater than 0."
#elif defined(E3_HYBRID_THRESHOLD) && E3_HYBRID_THRESHOLD == 0
#error "E3_HYBRID_THRESHOLD must be greater than 0."
#elif defined(E4_HYBRID_THRESHOLD) && E4_HYBRID_THRESHOLD == 0
#error "E4_HYBRID_THRESHOLD must be greater than 0."
#elif defined(E5_HYBRID_THRESHOLD) && E5_HYBRID_THRESHOLD == 0
#error "E5_HYBRID_THRESHOLD must be greater than 0."
#elif defined(E6_HYBRID_THRESHOLD) && E6_HYBRID_THRESHOLD == 0
#error "E6_HYBRID_THRESHOLD must be greater than 0."
#elif defined(E7_HYBRID_THRESHOLD) && E7_HYBRID_THRESHOLD == 0
#error "E7_HYBRID_THRESHOLD must be greater than 0."
#endif
#endif // HYBRID_THRESHOLD
// Other TMC feature requirements
#if ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD
#error "SENSORLESS_HOMING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers."
#elif ENABLED(SENSORLESS_PROBING) && !HAS_STALLGUARD
#error "SENSORLESS_PROBING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers."
#elif STEALTHCHOP_ENABLED && !HAS_STEALTHCHOP
#error "STEALTHCHOP requires TMC2130, TMC2160, TMC2208, TMC2209, or TMC5160 stepper drivers."
#endif
/**
* TMC SPI Chaining
*/
#define IN_CHAIN(A) A##_CHAIN_POS > 0
#if IN_CHAIN(X) || IN_CHAIN(Y) || IN_CHAIN(Z) || IN_CHAIN(I) || IN_CHAIN(J) || IN_CHAIN(K) || IN_CHAIN(U) || IN_CHAIN(V) || IN_CHAIN(W) \
|| IN_CHAIN(X2) || IN_CHAIN(Y2) || IN_CHAIN(Z2) || IN_CHAIN(Z3) || IN_CHAIN(Z4) \
|| IN_CHAIN(E0) || IN_CHAIN(E1) || IN_CHAIN(E2) || IN_CHAIN(E3) || IN_CHAIN(E4) || IN_CHAIN(E5) || IN_CHAIN(E6) || IN_CHAIN(E7)
#define BAD_CHAIN(A) (IN_CHAIN(A) && !PIN_EXISTS(A##_CS))
#if BAD_CHAIN(X) || BAD_CHAIN(Y) || BAD_CHAIN(Z) || BAD_CHAIN(I) || BAD_CHAIN(J) || BAD_CHAIN(K) || BAD_CHAIN(U) || BAD_CHAIN(V) || BAD_CHAIN(W) \
|| BAD_CHAIN(X2) || BAD_CHAIN(Y2) || BAD_CHAIN(Z2) || BAD_CHAIN(Z3) || BAD_CHAIN(Z4) \
|| BAD_CHAIN(E0) || BAD_CHAIN(E1) || BAD_CHAIN(E2) || BAD_CHAIN(E3) || BAD_CHAIN(E4) || BAD_CHAIN(E5) || BAD_CHAIN(E6) || BAD_CHAIN(E7)
#error "All chained TMC drivers need a CS pin."
#else
#if IN_CHAIN(X)
#define CS_COMPARE X_CS_PIN
#elif IN_CHAIN(Y)
#define CS_COMPARE Y_CS_PIN
#elif IN_CHAIN(Z)
#define CS_COMPARE Z_CS_PIN
#elif IN_CHAIN(X2)
#define CS_COMPARE X2_CS_PIN
#elif IN_CHAIN(Y2)
#define CS_COMPARE Y2_CS_PIN
#elif IN_CHAIN(Z2)
#define CS_COMPARE Z2_CS_PIN
#elif IN_CHAIN(Z3)
#define CS_COMPARE Z3_CS_PIN
#elif IN_CHAIN(I)
#define CS_COMPARE I_CS_PIN
#elif IN_CHAIN(J)
#define CS_COMPARE J_CS_PIN
#elif IN_CHAIN(K)
#define CS_COMPARE K_CS_PIN
#elif IN_CHAIN(U)
#define CS_COMPARE U_CS_PIN
#elif IN_CHAIN(V)
#define CS_COMPARE V_CS_PIN
#elif IN_CHAIN(W)
#define CS_COMPARE W_CS_PIN
#elif IN_CHAIN(E0)
#define CS_COMPARE E0_CS_PIN
#elif IN_CHAIN(E1)
#define CS_COMPARE E1_CS_PIN
#elif IN_CHAIN(E2)
#define CS_COMPARE E2_CS_PIN
#elif IN_CHAIN(E3)
#define CS_COMPARE E3_CS_PIN
#elif IN_CHAIN(E4)
#define CS_COMPARE E4_CS_PIN
#elif IN_CHAIN(E5)
#define CS_COMPARE E5_CS_PIN
#elif IN_CHAIN(E6)
#define CS_COMPARE E6_CS_PIN
#elif IN_CHAIN(E7)
#define CS_COMPARE E7_CS_PIN
#endif
#define BAD_CS_PIN(A) (IN_CHAIN(A) && A##_CS_PIN != CS_COMPARE)
#if BAD_CS_PIN(X) || BAD_CS_PIN(Y) || BAD_CS_PIN(Z) || BAD_CS_PIN(I) || BAD_CS_PIN(J) || BAD_CS_PIN(K) || BAD_CS_PIN(U) || BAD_CS_PIN(V) || BAD_CS_PIN(W) \
|| BAD_CS_PIN(X2) || BAD_CS_PIN(Y2) || BAD_CS_PIN(Z2) || BAD_CS_PIN(Z3) || BAD_CS_PIN(Z4) \
|| BAD_CS_PIN(E0) || BAD_CS_PIN(E1) || BAD_CS_PIN(E2) || BAD_CS_PIN(E3) || BAD_CS_PIN(E4) || BAD_CS_PIN(E5) || BAD_CS_PIN(E6) || BAD_CS_PIN(E7)
#error "All chained TMC drivers must use the same CS pin."
#endif
#undef BAD_CS_PIN
#undef CS_COMPARE
#endif
#undef BAD_CHAIN
#endif
#undef IN_CHAIN
/**
* Digipot requirement
*/
#if HAS_MOTOR_CURRENT_I2C
#if ALL(DIGIPOT_MCP4018, DIGIPOT_MCP4451)
#error "Enable only one of DIGIPOT_MCP4018 or DIGIPOT_MCP4451."
#elif !MB(MKS_SBASE, AZTEEG_X5_GT, AZTEEG_X5_MINI, AZTEEG_X5_MINI_WIFI) \
&& (!defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1))
#error "DIGIPOT_MCP4018/4451 requires DIGIPOTS_I2C_SDA_* pins to be defined."
#endif
#endif
/**
* Check per-axis initializers for errors
*/
#define __PLUS_TEST(I,A) && (sanity_arr_##A[_MIN(I,signed(COUNT(sanity_arr_##A)-1))] > 0)
#define _PLUS_TEST(A) (1 REPEAT2(14,__PLUS_TEST,A))
#if HAS_MULTI_EXTRUDER
#define _EXTRA_NOTE " (Did you forget to enable DISTINCT_E_FACTORS?)"
#else
#define _EXTRA_NOTE " (Should be " STRINGIFY(NUM_AXES) "+" STRINGIFY(E_STEPPERS) ")"
#endif
constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT;
static_assert(COUNT(sanity_arr_1) >= LOGICAL_AXES, "DEFAULT_AXIS_STEPS_PER_UNIT requires " _LOGICAL_AXES_STR "elements.");
static_assert(COUNT(sanity_arr_1) <= DISTINCT_AXES, "DEFAULT_AXIS_STEPS_PER_UNIT has too many elements." _EXTRA_NOTE);
static_assert(_PLUS_TEST(1), "DEFAULT_AXIS_STEPS_PER_UNIT values must be positive.");
constexpr float sanity_arr_2[] = DEFAULT_MAX_FEEDRATE;
static_assert(COUNT(sanity_arr_2) >= LOGICAL_AXES, "DEFAULT_MAX_FEEDRATE requires " _LOGICAL_AXES_STR "elements.");
static_assert(COUNT(sanity_arr_2) <= DISTINCT_AXES, "DEFAULT_MAX_FEEDRATE has too many elements." _EXTRA_NOTE);
static_assert(_PLUS_TEST(2), "DEFAULT_MAX_FEEDRATE values must be positive.");
constexpr float sanity_arr_3[] = DEFAULT_MAX_ACCELERATION;
static_assert(COUNT(sanity_arr_3) >= LOGICAL_AXES, "DEFAULT_MAX_ACCELERATION requires " _LOGICAL_AXES_STR "elements.");
static_assert(COUNT(sanity_arr_3) <= DISTINCT_AXES, "DEFAULT_MAX_ACCELERATION has too many elements." _EXTRA_NOTE);
static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive.");
#if NUM_AXES
constexpr float sanity_arr_4[] = HOMING_FEEDRATE_MM_M;
static_assert(COUNT(sanity_arr_4) == NUM_AXES, "HOMING_FEEDRATE_MM_M requires " _NUM_AXES_STR "elements (and no others).");
static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
#endif
#ifdef MAX_ACCEL_EDIT_VALUES
constexpr float sanity_arr_5[] = MAX_ACCEL_EDIT_VALUES;
static_assert(COUNT(sanity_arr_5) >= LOGICAL_AXES, "MAX_ACCEL_EDIT_VALUES requires " _LOGICAL_AXES_STR "elements.");
static_assert(COUNT(sanity_arr_5) <= LOGICAL_AXES, "MAX_ACCEL_EDIT_VALUES has too many elements. " _LOGICAL_AXES_STR "elements only.");
static_assert(_PLUS_TEST(5), "MAX_ACCEL_EDIT_VALUES values must be positive.");
#endif
#ifdef MAX_FEEDRATE_EDIT_VALUES
constexpr float sanity_arr_6[] = MAX_FEEDRATE_EDIT_VALUES;
static_assert(COUNT(sanity_arr_6) >= LOGICAL_AXES, "MAX_FEEDRATE_EDIT_VALUES requires " _LOGICAL_AXES_STR "elements.");
static_assert(COUNT(sanity_arr_6) <= LOGICAL_AXES, "MAX_FEEDRATE_EDIT_VALUES has too many elements. " _LOGICAL_AXES_STR "elements only.");
static_assert(_PLUS_TEST(6), "MAX_FEEDRATE_EDIT_VALUES values must be positive.");
#endif
#ifdef MAX_JERK_EDIT_VALUES
constexpr float sanity_arr_7[] = MAX_JERK_EDIT_VALUES;
static_assert(COUNT(sanity_arr_7) >= LOGICAL_AXES, "MAX_JERK_EDIT_VALUES requires " _LOGICAL_AXES_STR "elements.");
static_assert(COUNT(sanity_arr_7) <= LOGICAL_AXES, "MAX_JERK_EDIT_VALUES has too many elements. " _LOGICAL_AXES_STR "elements only.");
static_assert(_PLUS_TEST(7), "MAX_JERK_EDIT_VALUES values must be positive.");
#endif
#ifdef MANUAL_FEEDRATE
constexpr float sanity_arr_8[] = MANUAL_FEEDRATE;
static_assert(COUNT(sanity_arr_8) >= LOGICAL_AXES, "MANUAL_FEEDRATE requires " _LOGICAL_AXES_STR "elements.");
static_assert(COUNT(sanity_arr_8) <= LOGICAL_AXES, "MANUAL_FEEDRATE has too many elements. " _LOGICAL_AXES_STR "elements only.");
static_assert(_PLUS_TEST(8), "MANUAL_FEEDRATE values must be positive.");
#endif
#undef __PLUS_TEST
#undef _PLUS_TEST
#undef _EXTRA_NOTE
#if ALL(CNC_COORDINATE_SYSTEMS, NO_WORKSPACE_OFFSETS)
#error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS."
#endif
#if !BLOCK_BUFFER_SIZE
#error "BLOCK_BUFFER_SIZE must be non-zero."
#elif BLOCK_BUFFER_SIZE > 64
#error "A very large BLOCK_BUFFER_SIZE is not needed and takes longer to drain the buffer on pause / cancel."
#endif
#if ENABLED(LED_CONTROL_MENU) && NONE(HAS_MARLINUI_MENU, DWIN_LCD_PROUI)
#error "LED_CONTROL_MENU requires an LCD controller that implements the menu."
#endif
#if ENABLED(CUSTOM_MENU_MAIN) && NONE(HAS_MARLINUI_MENU, TOUCH_UI_FTDI_EVE, TFT_LVGL_UI)
#error "CUSTOM_MENU_MAIN requires an LCD controller that implements the menu."
#endif
#if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED)
#error "CASE_LIGHT_USE_NEOPIXEL requires NEOPIXEL_LED."
#endif
#if ENABLED(SKEW_CORRECTION)
#if !defined(XY_SKEW_FACTOR) && !(defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD))
#error "SKEW_CORRECTION requires XY_SKEW_FACTOR or XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD."
#endif
#if ENABLED(SKEW_CORRECTION_FOR_Z)
#if !defined(XZ_SKEW_FACTOR) && !(defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD))
#error "SKEW_CORRECTION requires XZ_SKEW_FACTOR or XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD."
#endif
#if !defined(YZ_SKEW_FACTOR) && !(defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD))
#error "SKEW_CORRECTION requires YZ_SKEW_FACTOR or YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD."
#endif
#endif
#endif
#if ALL(X_AXIS_TWIST_COMPENSATION, NOZZLE_AS_PROBE)
#error "X_AXIS_TWIST_COMPENSATION is incompatible with NOZZLE_AS_PROBE."
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
#if ENABLED(BACKUP_POWER_SUPPLY) && !PIN_EXISTS(POWER_LOSS)
#error "BACKUP_POWER_SUPPLY requires a POWER_LOSS_PIN."
#elif ALL(POWER_LOSS_PULLUP, POWER_LOSS_PULLDOWN)
#error "You can't enable POWER_LOSS_PULLUP and POWER_LOSS_PULLDOWN at the same time."
#elif ENABLED(POWER_LOSS_RECOVER_ZHOME) && Z_HOME_TO_MAX
#error "POWER_LOSS_RECOVER_ZHOME is not needed on a machine that homes to ZMAX."
#elif ALL(IS_CARTESIAN, POWER_LOSS_RECOVER_ZHOME) && Z_HOME_TO_MIN && !defined(POWER_LOSS_ZHOME_POS)
#error "POWER_LOSS_RECOVER_ZHOME requires POWER_LOSS_ZHOME_POS for a Cartesian that homes to ZMIN."
#endif
#endif
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
#if NUM_Z_STEPPERS <= 1
#error "Z_STEPPER_AUTO_ALIGN requires more than one Z stepper."
#elif !HAS_BED_PROBE
#error "Z_STEPPER_AUTO_ALIGN requires a Z-bed probe."
#elif HAS_Z_STEPPER_ALIGN_STEPPER_XY
static_assert(WITHIN(Z_STEPPER_ALIGN_AMP, 0.5, 2.0), "Z_STEPPER_ALIGN_AMP must be between 0.5 and 2.0.");
#if NUM_Z_STEPPERS < 3
#error "Z_STEPPER_ALIGN_STEPPER_XY requires 3 or 4 Z steppers."
#endif
#endif
static_assert(WITHIN(Z_STEPPER_ALIGN_ACC, 0.001, 1.0), "Z_STEPPER_ALIGN_ACC needs to be between 0.001 and 1.0");
#endif
#if ENABLED(MECHANICAL_GANTRY_CALIBRATION)
#if NONE(HAS_MOTOR_CURRENT_DAC, HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC, HAS_TRINAMIC_CONFIG, HAS_MOTOR_CURRENT_PWM)
#error "Adjustable current drivers are highly recommended to prevent damage. Comment out this line to continue anyway."
#elif !defined(GANTRY_CALIBRATION_CURRENT)
#error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_CURRENT to be set."
#elif !defined(GANTRY_CALIBRATION_EXTRA_HEIGHT)
#error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_EXTRA_HEIGHT to be set."
#elif !defined(GANTRY_CALIBRATION_FEEDRATE)
#error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_FEEDRATE to be set."
#elif ENABLED(Z_MULTI_ENDSTOPS)
#error "Sorry! MECHANICAL_GANTRY_CALIBRATION cannot be used with Z_MULTI_ENDSTOPS."
#elif ENABLED(Z_STEPPER_AUTO_ALIGN)
#error "Sorry! MECHANICAL_GANTRY_CALIBRATION cannot be used with Z_STEPPER_AUTO_ALIGN."
#endif
#if defined(GANTRY_CALIBRATION_SAFE_POSITION) && !defined(GANTRY_CALIBRATION_XY_PARK_FEEDRATE)
#error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
#endif
#endif
#if ENABLED(PRINTCOUNTER) && DISABLED(EEPROM_SETTINGS)
#error "PRINTCOUNTER requires EEPROM_SETTINGS."
#endif
#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && !PINS_EXIST(USB_CS, USB_INTR) && DISABLED(USE_OTG_USB_HOST)
#error "USB_CS_PIN and USB_INTR_PIN are required for USB_FLASH_DRIVE_SUPPORT."
#endif
#if ENABLED(USE_OTG_USB_HOST) && !defined(HAS_OTG_USB_HOST_SUPPORT)
#error "The current board does not support USE_OTG_USB_HOST."
#endif
#if ENABLED(SD_FIRMWARE_UPDATE) && !defined(__AVR_ATmega2560__)
#error "SD_FIRMWARE_UPDATE requires an ATmega2560-based (Arduino Mega) board."
#endif
#if ENABLED(GCODE_MACROS) && !WITHIN(GCODE_MACROS_SLOTS, 1, 10)
#error "GCODE_MACROS_SLOTS must be a number from 1 to 10."
#endif
#if ENABLED(BACKLASH_COMPENSATION)
#ifndef BACKLASH_DISTANCE_MM
#error "BACKLASH_COMPENSATION requires BACKLASH_DISTANCE_MM."
#elif !defined(BACKLASH_CORRECTION)
#error "BACKLASH_COMPENSATION requires BACKLASH_CORRECTION."
#elif ANY(MARKFORGED_XY, MARKFORGED_YX)
constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM;
static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2],
"BACKLASH_COMPENSATION can only apply to " STRINGIFY(NORMAL_AXIS) " on a MarkForged system.");
#elif IS_CORE
constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM;
#ifndef CORE_BACKLASH
static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2],
"BACKLASH_COMPENSATION can only apply to " STRINGIFY(NORMAL_AXIS) " with your CORE system.");
#endif
#endif
#endif
#if ENABLED(GRADIENT_MIX) && MIXING_VIRTUAL_TOOLS < 2
#error "GRADIENT_MIX requires 2 or more MIXING_VIRTUAL_TOOLS."
#endif
/**
* Photo G-code requirements
*/
#if ENABLED(PHOTO_GCODE)
#if (PIN_EXISTS(CHDK) + PIN_EXISTS(PHOTOGRAPH) + defined(PHOTO_SWITCH_POSITION)) > 1
#error "Please define only one of CHDK_PIN, PHOTOGRAPH_PIN, or PHOTO_SWITCH_POSITION."
#elif defined(PHOTO_SWITCH_POSITION) && !defined(PHOTO_POSITION)
#error "PHOTO_SWITCH_POSITION requires PHOTO_POSITION."
#elif PIN_EXISTS(CHDK) && defined(CHDK_DELAY)
#error "CHDK_DELAY has been replaced by PHOTO_SWITCH_MS."
#elif PIN_EXISTS(CHDK) && !defined(PHOTO_SWITCH_MS)
#error "PHOTO_SWITCH_MS is required with CHDK_PIN."
#elif defined(PHOTO_RETRACT_MM)
static_assert(PHOTO_RETRACT_MM + 0 >= 0, "PHOTO_RETRACT_MM must be >= 0.");
#endif
#endif
/**
* Advanced PRINTCOUNTER settings
*/
#if ENABLED(PRINTCOUNTER)
#if defined(SERVICE_INTERVAL_1) != defined(SERVICE_NAME_1)
#error "Both SERVICE_NAME_1 and SERVICE_INTERVAL_1 are required."
#elif defined(SERVICE_INTERVAL_2) != defined(SERVICE_NAME_2)
#error "Both SERVICE_NAME_2 and SERVICE_INTERVAL_2 are required."
#elif defined(SERVICE_INTERVAL_3) != defined(SERVICE_NAME_3)
#error "Both SERVICE_NAME_3 and SERVICE_INTERVAL_3 are required."
#endif
#endif
/**
* Require soft endstops for certain setups
*/
#if !ALL(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
#if ENABLED(DUAL_X_CARRIAGE)
#error "DUAL_X_CARRIAGE requires both MIN_ and MAX_SOFTWARE_ENDSTOPS."
#elif HAS_HOTEND_OFFSET
#error "Multi-hotends with offset requires both MIN_ and MAX_SOFTWARE_ENDSTOPS."
#endif
#endif
/**
* Validate MKS_PWC
*/
#if ENABLED(MKS_PWC) && PSU_ACTIVE_STATE != HIGH
#error "MKS_PWC requires PSU_ACTIVE_STATE to be set HIGH."
#endif
/**
* Ensure this option is set intentionally
*/
#if ENABLED(PSU_CONTROL)
#ifndef PSU_ACTIVE_STATE
#error "PSU_CONTROL requires PSU_ACTIVE_STATE to be defined as 'HIGH' or 'LOW'."
#elif !PIN_EXISTS(PS_ON)
#error "PSU_CONTROL requires PS_ON_PIN."
#elif POWER_OFF_DELAY < 0
#error "POWER_OFF_DELAY must be a positive value."
#elif ENABLED(POWER_OFF_WAIT_FOR_COOLDOWN) && !(defined(AUTO_POWER_E_TEMP) || defined(AUTO_POWER_CHAMBER_TEMP) || defined(AUTO_POWER_COOLER_TEMP))
#error "POWER_OFF_WAIT_FOR_COOLDOWN requires AUTO_POWER_E_TEMP, AUTO_POWER_CHAMBER_TEMP, and/or AUTO_POWER_COOLER_TEMP."
#elif ENABLED(PSU_OFF_REDUNDANT) && !PIN_EXISTS(PS_ON1)
#error "PSU_OFF_REDUNDANT requires PS_ON1_PIN."
#endif
#endif
#if HAS_CUTTER
#ifndef CUTTER_POWER_UNIT
#error "CUTTER_POWER_UNIT is required with a spindle or laser."
#elif !CUTTER_UNIT_IS(PWM255) && !CUTTER_UNIT_IS(PERCENT) && !CUTTER_UNIT_IS(RPM) && !CUTTER_UNIT_IS(SERVO)
#error "CUTTER_POWER_UNIT must be PWM255, PERCENT, RPM, or SERVO."
#endif
#if ENABLED(LASER_FEATURE)
#if ENABLED(SPINDLE_CHANGE_DIR)
#error "SPINDLE_CHANGE_DIR and LASER_FEATURE are incompatible."
#elif ENABLED(LASER_MOVE_G0_OFF)
#error "LASER_MOVE_G0_OFF is no longer required, G0 and G28 cannot apply power."
#elif ENABLED(LASER_MOVE_G28_OFF)
#error "LASER_MOVE_G0_OFF is no longer required, G0 and G28 cannot apply power."
#elif ENABLED(LASER_MOVE_POWER)
#error "LASER_MOVE_POWER is no longer applicable."
#endif
#if ENABLED(LASER_POWER_TRAP)
#if DISABLED(SPINDLE_LASER_USE_PWM)
#error "LASER_POWER_TRAP requires SPINDLE_LASER_USE_PWM to function."
#endif
#endif
#else
#if SPINDLE_LASER_POWERUP_DELAY < 1
#error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0."
#elif SPINDLE_LASER_POWERDOWN_DELAY < 1
#error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0."
#endif
#endif
#define _PIN_CONFLICT(P) (PIN_EXISTS(P) && P##_PIN == SPINDLE_LASER_PWM_PIN)
#if ALL(SPINDLE_FEATURE, LASER_FEATURE)
#error "Enable only one of SPINDLE_FEATURE or LASER_FEATURE."
#elif NONE(SPINDLE_SERVO, SPINDLE_LASER_USE_PWM) && !PIN_EXISTS(SPINDLE_LASER_ENA)
#error "(SPINDLE|LASER)_FEATURE requires SPINDLE_LASER_ENA_PIN, SPINDLE_LASER_USE_PWM, or SPINDLE_SERVO to control the power."
#elif ENABLED(SPINDLE_CHANGE_DIR) && !PIN_EXISTS(SPINDLE_DIR)
#error "SPINDLE_DIR_PIN is required for SPINDLE_CHANGE_DIR."
#elif ENABLED(SPINDLE_LASER_USE_PWM)
#if !defined(SPINDLE_LASER_PWM_PIN) || SPINDLE_LASER_PWM_PIN < 0
#error "SPINDLE_LASER_PWM_PIN is required for SPINDLE_LASER_USE_PWM."
#elif !_TEST_PWM(SPINDLE_LASER_PWM_PIN)
#error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin."
#elif !defined(SPINDLE_LASER_PWM_INVERT)
#error "SPINDLE_LASER_PWM_INVERT is required for (SPINDLE|LASER)_FEATURE."
#elif !(defined(SPEED_POWER_MIN) && defined(SPEED_POWER_MAX) && defined(SPEED_POWER_STARTUP))
#error "SPINDLE_LASER_USE_PWM equation constant(s) missing."
#elif _PIN_CONFLICT(X_MIN)
#error "SPINDLE_LASER_PWM_PIN conflicts with X_MIN_PIN."
#elif _PIN_CONFLICT(X_MAX)
#error "SPINDLE_LASER_PWM_PIN conflicts with X_MAX_PIN."
#elif _PIN_CONFLICT(Z_STEP)
#error "SPINDLE_LASER_PWM_PIN conflicts with Z_STEP_PIN."
#elif _PIN_CONFLICT(CASE_LIGHT)
#error "SPINDLE_LASER_PWM_PIN conflicts with CASE_LIGHT_PIN."
#elif _PIN_CONFLICT(E0_AUTO_FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with E0_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(E1_AUTO_FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with E1_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(E2_AUTO_FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with E2_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(E3_AUTO_FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with E3_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(E4_AUTO_FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with E4_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(E5_AUTO_FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with E5_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(E6_AUTO_FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with E6_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(E7_AUTO_FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with E7_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(FAN0)
#error "SPINDLE_LASER_PWM_PIN conflicts with FAN0_PIN."
#elif _PIN_CONFLICT(FAN1)
#error "SPINDLE_LASER_PWM_PIN conflicts with FAN1_PIN."
#elif _PIN_CONFLICT(FAN2)
#error "SPINDLE_LASER_PWM_PIN conflicts with FAN2_PIN."
#elif _PIN_CONFLICT(FAN3)
#error "SPINDLE_LASER_PWM_PIN conflicts with FAN3_PIN."
#elif _PIN_CONFLICT(FAN4)
#error "SPINDLE_LASER_PWM_PIN conflicts with FAN4_PIN."
#elif _PIN_CONFLICT(FAN5)
#error "SPINDLE_LASER_PWM_PIN conflicts with FAN5_PIN."
#elif _PIN_CONFLICT(FAN6)
#error "SPINDLE_LASER_PWM_PIN conflicts with FAN6_PIN."
#elif _PIN_CONFLICT(FAN7)
#error "SPINDLE_LASER_PWM_PIN conflicts with FAN7_PIN."
#elif _PIN_CONFLICT(CONTROLLERFAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with CONTROLLERFAN_PIN."
#elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_XY)
#error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_XY."
#elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_Z)
#error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_Z."
#elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_E)
#error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_E."
#endif
#endif
#undef _PIN_CONFLICT
#ifdef LASER_SAFETY_TIMEOUT_MS
static_assert(LASER_SAFETY_TIMEOUT_MS < (DEFAULT_STEPPER_TIMEOUT_SEC) * 1000UL, "LASER_SAFETY_TIMEOUT_MS must be less than DEFAULT_STEPPER_TIMEOUT_SEC (" STRINGIFY(DEFAULT_STEPPER_TIMEOUT_SEC) " seconds)");
#endif
#endif
#if ENABLED(COOLANT_CONTROL)
#if NONE(COOLANT_MIST, COOLANT_FLOOD)
#error "COOLANT_CONTROL requires either COOLANT_MIST or COOLANT_FLOOD."
#elif ENABLED(COOLANT_MIST) && !PIN_EXISTS(COOLANT_MIST)
#error "COOLANT_MIST requires COOLANT_MIST_PIN to be defined."
#elif ENABLED(COOLANT_FLOOD) && !PIN_EXISTS(COOLANT_FLOOD)
#error "COOLANT_FLOOD requires COOLANT_FLOOD_PIN to be defined."
#endif
#endif
#if HAS_ADC_BUTTONS && defined(ADC_BUTTON_DEBOUNCE_DELAY) && ADC_BUTTON_DEBOUNCE_DELAY < 16
#error "ADC_BUTTON_DEBOUNCE_DELAY must be greater than 16."
#endif
/**
* Check to make sure MONITOR_DRIVER_STATUS isn't enabled
* on boards where TMC drivers share the SPI bus with SD.
*/
#if HAS_TMC_SPI && ALL(MONITOR_DRIVER_STATUS, HAS_MEDIA, USES_SHARED_SPI)
#error "MONITOR_DRIVER_STATUS and SDSUPPORT cannot be used together on boards with shared SPI."
#endif
// Although it just toggles STEP, EDGE_STEPPING requires HIGH state for logic
#if ENABLED(EDGE_STEPPING)
#if AXIS_HAS_DEDGE(X) && STEP_STATE_X != HIGH
#error "STEP_STATE_X must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(Y) && STEP_STATE_Y != HIGH
#error "STEP_STATE_Y must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(Z) && STEP_STATE_Z != HIGH
#error "STEP_STATE_Z must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(I) && STEP_STATE_I != HIGH
#error "STEP_STATE_I must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(J) && STEP_STATE_J != HIGH
#error "STEP_STATE_J must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(K) && STEP_STATE_K != HIGH
#error "STEP_STATE_K must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(U) && STEP_STATE_U != HIGH
#error "STEP_STATE_U must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(V) && STEP_STATE_V != HIGH
#error "STEP_STATE_V must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(W) && STEP_STATE_W != HIGH
#error "STEP_STATE_W must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(E0) && STEP_STATE_E != HIGH
#error "STEP_STATE_E must be HIGH for EDGE_STEPPING."
#endif
#endif
// G60/G61 Position Save
#if SAVED_POSITIONS > 256
#error "SAVED_POSITIONS must be an integer from 0 to 256."
#endif
/**
* Touch Screen Calibration
*/
#if !MB(SIMULATED) && ENABLED(TFT_TOUCH_DEVICE_XPT2046) && DISABLED(TOUCH_SCREEN_CALIBRATION) \
&& !(defined(TOUCH_CALIBRATION_X) && defined(TOUCH_CALIBRATION_Y) && defined(TOUCH_OFFSET_X) && defined(TOUCH_OFFSET_Y))
#error "TOUCH_CALIBRATION_[XY] and TOUCH_OFFSET_[XY] are required for resistive touch screens with TOUCH_SCREEN_CALIBRATION disabled."
#endif
// GT911 Capacitive touch screen such as BIQU_BX_TFT70
#if ALL(TFT_TOUCH_DEVICE_GT911, TOUCH_SCREEN_CALIBRATION)
#error "TOUCH_SCREEN_CALIBRATION is not supported by the selected LCD controller."
#endif
/**
* Sanity check WiFi options
*/
#if ALL(WIFISUPPORT, ESP3D_WIFISUPPORT)
#error "Enable only one of WIFISUPPORT or ESP3D_WIFISUPPORT."
#elif ENABLED(ESP3D_WIFISUPPORT) && DISABLED(ARDUINO_ARCH_ESP32)
#error "ESP3D_WIFISUPPORT requires an ESP32 motherboard."
#elif ALL(ARDUINO_ARCH_ESP32, WIFISUPPORT)
#if !(defined(WIFI_SSID) && defined(WIFI_PWD))
#error "ESP32 motherboard with WIFISUPPORT requires WIFI_SSID and WIFI_PWD."
#endif
#elif ENABLED(WIFI_CUSTOM_COMMAND) && NONE(ESP3D_WIFISUPPORT, WIFISUPPORT)
#error "WIFI_CUSTOM_COMMAND requires an ESP32 motherboard and WIFISUPPORT."
#elif ENABLED(OTASUPPORT) && NONE(ESP3D_WIFISUPPORT, WIFISUPPORT)
#error "OTASUPPORT requires an ESP32 motherboard and WIFISUPPORT."
#elif (defined(WIFI_SSID) || defined(WIFI_PWD)) && NONE(ESP3D_WIFISUPPORT, WIFISUPPORT)
#error "WIFI_SSID and WIFI_PWD only apply to ESP32 motherboard with WIFISUPPORT."
#endif
/**
* Sanity Check for Password Feature
*/
#if ENABLED(PASSWORD_FEATURE)
#if NONE(HAS_MARLINUI_MENU, PASSWORD_UNLOCK_GCODE, PASSWORD_CHANGE_GCODE)
#error "Without PASSWORD_UNLOCK_GCODE, PASSWORD_CHANGE_GCODE, or a supported LCD there's no way to unlock the printer or set a password."
#elif DISABLED(EEPROM_SETTINGS)
#warning "PASSWORD_FEATURE settings will be lost on power-off without EEPROM_SETTINGS."
#endif
#endif
/**
* Sanity Check for MEATPACK and BINARY_FILE_TRANSFER Features
*/
#if ALL(HAS_MEATPACK, BINARY_FILE_TRANSFER)
#error "Either enable MEATPACK_ON_SERIAL_PORT_* or BINARY_FILE_TRANSFER, not both."
#endif
/**
* Sanity Check for Slim LCD Menus and Probe Offset Wizard
*/
#if ALL(SLIM_LCD_MENUS, PROBE_OFFSET_WIZARD)
#error "SLIM_LCD_MENUS disables 'Advanced Settings > Probe Offsets > PROBE_OFFSET_WIZARD.'"
#endif
/**
* Sanity check for unique start and stop values in NOZZLE_CLEAN_FEATURE
*/
#if ENABLED(NOZZLE_CLEAN_FEATURE)
constexpr xyz_pos_t start_xyz[8] = NOZZLE_CLEAN_START_POINT,
end_xyz[8] = NOZZLE_CLEAN_END_POINT;
#define _CLEAN_ASSERT(N) static_assert(N >= HOTENDS || end_xyz[N].x != start_xyz[N].x || TERN(NOZZLE_CLEAN_NO_Y, false, end_xyz[N].y != start_xyz[N].y), \
"NOZZLE_CLEAN Start and End must be made different on HOTEND " STRINGIFY(N))
_CLEAN_ASSERT(0); _CLEAN_ASSERT(1);
_CLEAN_ASSERT(2); _CLEAN_ASSERT(3);
_CLEAN_ASSERT(4); _CLEAN_ASSERT(5);
_CLEAN_ASSERT(6); _CLEAN_ASSERT(7);
#undef _CLEAN_ASSERT
#endif
/**
* Sanity check nozzle cleaning pattern settings
*/
#if ENABLED(NOZZLE_CLEAN_FEATURE)
#if NONE(NOZZLE_CLEAN_PATTERN_LINE, NOZZLE_CLEAN_PATTERN_ZIGZAG, NOZZLE_CLEAN_PATTERN_CIRCLE)
#error "NOZZLE_CLEAN_FEATURE requires at least one of NOZZLE_CLEAN_PATTERN_LINE, NOZZLE_CLEAN_PATTERN_ZIGZAG, and/or NOZZLE_CLEAN_PATTERN_CIRCLE."
#elif NOZZLE_CLEAN_DEFAULT_PATTERN == 0 && DISABLED(NOZZLE_CLEAN_PATTERN_LINE)
#error "NOZZLE_CLEAN_DEFAULT_PATTERN 0 (LINE) is not available. Enable NOZZLE_CLEAN_PATTERN_LINE or set a different NOZZLE_CLEAN_DEFAULT_PATTERN."
#elif NOZZLE_CLEAN_DEFAULT_PATTERN == 1 && DISABLED(NOZZLE_CLEAN_PATTERN_ZIGZAG)
#error "NOZZLE_CLEAN_DEFAULT_PATTERN 1 (ZIGZAG) is not available. Enable NOZZLE_CLEAN_PATTERN_ZIGZAG or set a different NOZZLE_CLEAN_DEFAULT_PATTERN."
#elif NOZZLE_CLEAN_DEFAULT_PATTERN == 2 && DISABLED(NOZZLE_CLEAN_PATTERN_CIRCLE)
#error "NOZZLE_CLEAN_DEFAULT_PATTERN 2 (CIRCLE) is not available. Enable NOZZLE_CLEAN_PATTERN_CIRCLE or set a different NOZZLE_CLEAN_DEFAULT_PATTERN."
#endif
#endif
/**
* Sanity check for MIXING_EXTRUDER & DISTINCT_E_FACTORS these are not compatible
*/
#if ALL(MIXING_EXTRUDER, DISTINCT_E_FACTORS)
#error "MIXING_EXTRUDER can't be used with DISTINCT_E_FACTORS. But you may use SINGLENOZZLE with DISTINCT_E_FACTORS."
#endif
/**
* Sanity check for valid stepper driver types
*/
#define _BAD_DRIVER(A) (defined(A##_DRIVER_TYPE) && !_DRIVER_ID(A##_DRIVER_TYPE))
#if _BAD_DRIVER(X)
#error "X_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(Y)
#error "Y_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(Z)
#error "Z_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(I)
#error "I_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(J)
#error "J_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(K)
#error "K_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(U)
#error "U_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(V)
#error "V_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(W)
#error "W_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(X2)
#error "X2_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(Y2)
#error "Y2_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(Z2)
#error "Z2_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(Z3)
#error "Z3_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(Z4)
#error "Z4_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(E0)
#error "E0_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(E1)
#error "E1_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(E2)
#error "E2_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(E3)
#error "E3_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(E4)
#error "E4_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(E5)
#error "E5_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(E6)
#error "E6_DRIVER_TYPE is not recognized."
#endif
#if _BAD_DRIVER(E7)
#error "E7_DRIVER_TYPE is not recognized."
#endif
#undef _BAD_DRIVER
/**
* Require certain features for DGUS_LCD_UI RELOADED.
*/
#if DGUS_UI_IS(RELOADED)
#if BUFSIZE < 4
#error "DGUS_LCD_UI RELOADED requires a BUFSIZE of at least 4."
#elif HOTENDS < 1
#error "DGUS_LCD_UI RELOADED requires at least 1 hotend."
#elif EXTRUDERS < 1
#error "DGUS_LCD_UI RELOADED requires at least 1 extruder."
#elif !HAS_HEATED_BED
#error "DGUS_LCD_UI RELOADED requires a heated bed."
#elif FAN_COUNT < 1
#error "DGUS_LCD_UI RELOADED requires a fan."
#elif !HAS_BED_PROBE
#error "DGUS_LCD_UI RELOADED requires a bed probe."
#elif !HAS_MESH
#error "DGUS_LCD_UI RELOADED requires mesh leveling."
#elif DISABLED(LCD_BED_TRAMMING)
#error "DGUS_LCD_UI RELOADED requires LCD_BED_TRAMMING."
#elif DISABLED(BABYSTEP_ALWAYS_AVAILABLE)
#error "DGUS_LCD_UI RELOADED requires BABYSTEP_ALWAYS_AVAILABLE."
#elif DISABLED(BABYSTEP_ZPROBE_OFFSET)
#error "DGUS_LCD_UI RELOADED requires BABYSTEP_ZPROBE_OFFSET."
#elif ENABLED(HOME_AFTER_DEACTIVATE)
#error "DGUS_LCD_UI RELOADED requires HOME_AFTER_DEACTIVATE to be disabled."
#elif ENABLED(AUTO_BED_LEVELING_UBL) && DISABLED(UBL_SAVE_ACTIVE_ON_M500)
#warning "Without UBL_SAVE_ACTIVE_ON_M500, your mesh will not be saved when using the touchscreen."
#endif
#endif
/**
* Require certain features for DGUS_LCD_UI IA_CREALITY.
*/
#if DGUS_UI_IS(IA_CREALITY)
#if DISABLED(ADVANCED_PAUSE_FEATURE)
#error "DGUS_LCD_UI IA_CREALITY requires ADVANCED_PAUSE_FEATURE."
#elif DISABLED(LCD_BED_TRAMMING)
#error "DGUS_LCD_UI IA_CREALITY requires LCD_BED_TRAMMING."
#elif DISABLED(CLASSIC_JERK)
#error "DGUS_LCD_UI IA_CREALITY requires CLASSIC_JERK."
#elif DISABLED(BABYSTEPPING)
#error "DGUS_LCD_UI IA_CREALITY requires BABYSTEPPING."
#elif NUM_RUNOUT_SENSORS > 1
#error "DGUS_LCD_UI IA_CREALITY requires NUM_RUNOUT_SENSORS < 2."
#elif NONE(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING)
#error "DGUS_LCD_UI IA_CREALITY requires AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, or MESH_BED_LEVELING."
#endif
#endif
/**
* Require certain features for DGUS_LCD_UI E3S1PRO.
*/
#if DGUS_UI_IS(E3S1PRO)
#if BUFSIZE < 4
#error "DGUS_LCD_UI E3S1PRO requires a BUFSIZE of at least 4."
#elif !(HOTENDS == 1)
#error "DGUS_LCD_UI E3S1PRO requires 1 hotend."
#elif !(EXTRUDERS == 1)
#error "DGUS_LCD_UI E3S1PRO requires at least 1 extruder."
#elif !HAS_HEATED_BED
#error "DGUS_LCD_UI E3S1PRO requires a heated bed."
#elif FAN_COUNT < 1
#error "DGUS_LCD_UI E3S1PRO requires a fan."
#elif !HAS_BED_PROBE
#error "DGUS_LCD_UI E3S1PRO requires a bed probe."
#elif !HAS_MESH
#error "DGUS_LCD_UI E3S1PRO requires mesh leveling."
#elif !HAS_MEDIA
#error "DGUS_LCD_UI E3S1PRO requires SDSUPPORT."
#elif DISABLED(POWER_LOSS_RECOVERY)
#error "DGUS_LCD_UI E3S1PRO requires POWER_LOSS_RECOVERY."
#elif DISABLED(LCD_BED_TRAMMING)
#error "DGUS_LCD_UI E3S1PRO requires LCD_BED_TRAMMING."
#elif DISABLED(BABYSTEP_ALWAYS_AVAILABLE)
#error "DGUS_LCD_UI E3S1PRO requires BABYSTEP_ALWAYS_AVAILABLE."
#elif DISABLED(BABYSTEP_ZPROBE_OFFSET)
#error "DGUS_LCD_UI E3S1PRO requires BABYSTEP_ZPROBE_OFFSET."
#elif !defined(PREHEAT_1_TEMP_HOTEND) || !defined(PREHEAT_2_TEMP_HOTEND)
#error "DGUS_LCD_UI E3S1PRO requires 2 preheating presets."
#elif ENABLED(AUTO_BED_LEVELING_UBL) && DISABLED(UBL_SAVE_ACTIVE_ON_M500)
#warning "Without UBL_SAVE_ACTIVE_ON_M500, your mesh will not be saved when using the touchscreen."
#endif
#endif
// JTAG support in the HAL
#if ENABLED(DISABLE_DEBUG) && !defined(JTAGSWD_DISABLE)
#error "DISABLE_DEBUG is not supported for the selected MCU/Board."
#elif ENABLED(DISABLE_JTAG) && !defined(JTAG_DISABLE)
#error "DISABLE_JTAG is not supported for the selected MCU/Board."
#endif
// Check requirements for upload.py
#if ENABLED(XFER_BUILD) && !ALL(SDSUPPORT, BINARY_FILE_TRANSFER, CUSTOM_FIRMWARE_UPLOAD)
#error "SDSUPPORT, BINARY_FILE_TRANSFER, and CUSTOM_FIRMWARE_UPLOAD are required for custom upload."
#endif
/**
* Input Shaping requirements
*/
#if HAS_ZV_SHAPING
#if ENABLED(DELTA)
#error "Input Shaping is not compatible with DELTA kinematics."
#elif ENABLED(SCARA)
#error "Input Shaping is not compatible with SCARA kinematics."
#elif ENABLED(TPARA)
#error "Input Shaping is not compatible with TPARA kinematics."
#elif ENABLED(POLAR)
#error "Input Shaping is not compatible with POLAR kinematics."
#elif ENABLED(POLARGRAPH)
#error "Input Shaping is not compatible with POLARGRAPH kinematics."
#elif ENABLED(DIRECT_STEPPING)
#error "Input Shaping is not compatible with DIRECT_STEPPING."
#elif ALL(INPUT_SHAPING_X, CORE_IS_XZ)
#error "INPUT_SHAPING_X is not supported with COREXZ."
#elif ALL(INPUT_SHAPING_Y, CORE_IS_YZ)
#error "INPUT_SHAPING_Y is not supported with COREYZ."
#elif ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
#if !ALL(INPUT_SHAPING_X, INPUT_SHAPING_Y)
#error "INPUT_SHAPING_X and INPUT_SHAPING_Y must both be enabled for COREXY, COREYX, or MARKFORGED_*."
#else
static_assert(SHAPING_FREQ_X == SHAPING_FREQ_Y, "SHAPING_FREQ_X and SHAPING_FREQ_Y must be the same for COREXY / COREYX / MARKFORGED_*.");
static_assert(SHAPING_ZETA_X == SHAPING_ZETA_Y, "SHAPING_ZETA_X and SHAPING_ZETA_Y must be the same for COREXY / COREYX / MARKFORGED_*.");
#endif
#endif
#ifdef SHAPING_MIN_FREQ
static_assert((SHAPING_MIN_FREQ) > 0, "SHAPING_MIN_FREQ must be > 0.");
#else
TERN_(INPUT_SHAPING_X, static_assert((SHAPING_FREQ_X) > 0, "SHAPING_FREQ_X must be > 0 or SHAPING_MIN_FREQ must be set."));
TERN_(INPUT_SHAPING_Y, static_assert((SHAPING_FREQ_Y) > 0, "SHAPING_FREQ_Y must be > 0 or SHAPING_MIN_FREQ must be set."));
#endif
#ifdef __AVR__
#if ENABLED(INPUT_SHAPING_X)
#if F_CPU > 16000000
static_assert((SHAPING_FREQ_X) == 0 || (SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (20) for AVR 20MHz.");
#else
static_assert((SHAPING_FREQ_X) == 0 || (SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (16) for AVR 16MHz.");
#endif
#endif
#if ENABLED(INPUT_SHAPING_Y)
#if F_CPU > 16000000
static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (20) for AVR 20MHz.");
#else
static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (16) for AVR 16MHz.");
#endif
#endif
#endif
#endif
/**
* Fixed-Time Motion limitations
*/
#if ENABLED(FT_MOTION)
#if ENABLED(MIXING_EXTRUDER)
#error "FT_MOTION does not currently support MIXING_EXTRUDER."
#elif DISABLED(FTM_UNIFIED_BWS)
#error "FT_MOTION requires FTM_UNIFIED_BWS to be enabled because FBS is not yet implemented."
#endif
#endif
// Multi-Stepping Limit
static_assert(WITHIN(MULTISTEPPING_LIMIT, 1, 128) && IS_POWER_OF_2(MULTISTEPPING_LIMIT), "MULTISTEPPING_LIMIT must be 1, 2, 4, 8, 16, 32, 64, or 128.");
// One Click Print
#if ENABLED(ONE_CLICK_PRINT)
#if !HAS_MEDIA
#error "SD Card or Flash Drive is required for ONE_CLICK_PRINT."
#elif ENABLED(BROWSE_MEDIA_ON_INSERT)
#error "ONE_CLICK_PRINT is incompatible with BROWSE_MEDIA_ON_INSERT."
#elif DISABLED(NO_SD_AUTOSTART)
#error "NO_SD_AUTOSTART must be enabled for ONE_CLICK_PRINT."
#elif !defined(HAS_MARLINUI_MENU)
#error "ONE_CLICK_PRINT needs a display that has Marlin UI menus."
#endif
#endif
#if ALL(ULTIPANEL_FEEDMULTIPLY, ULTIPANEL_FLOWPERCENT)
#error "Only enable ULTIPANEL_FEEDMULTIPLY or ULTIPANEL_FLOWPERCENT, but not both."
#endif
// Misc. Cleanup
#undef _TEST_PWM
#undef _NUM_AXES_STR
#undef _LOGICAL_AXES_STR
|
2301_81045437/Marlin
|
Marlin/src/inc/SanityCheck.h
|
C++
|
agpl-3.0
| 189,662
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#pragma once
/**
* Release version. Leave the Marlin version or apply a custom scheme.
*/
#ifndef SHORT_BUILD_VERSION
#define SHORT_BUILD_VERSION "bugfix-2.1.x"
#endif
/**
* Verbose version identifier containing a unique identifier, such as the
* vendor name, download location, GitHub account, etc.
*/
#ifndef DETAILED_BUILD_VERSION
#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION
#endif
/**
* The STRING_DISTRIBUTION_DATE represents when the binary file was built,
* here we define this default string as the date where the latest release
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2024-05-10"
#endif
/**
* Minimum Configuration.h and Configuration_adv.h file versions.
* Set based on the release version number. Used to catch an attempt to use
* older configurations. Override these if using a custom versioning scheme
* to alert users to major changes.
*/
#define MARLIN_HEX_VERSION 02010300
#ifndef REQUIRED_CONFIGURATION_H_VERSION
#define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION
#endif
#ifndef REQUIRED_CONFIGURATION_ADV_H_VERSION
#define REQUIRED_CONFIGURATION_ADV_H_VERSION MARLIN_HEX_VERSION
#endif
/**
* The protocol for communication to the host. Protocol indicates communication
* standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc.
* (Other behaviors are given by the firmware version and capabilities report.)
*/
#ifndef PROTOCOL_VERSION
#define PROTOCOL_VERSION "1.0"
#endif
/**
* Define a generic printer name to be output to the LCD after booting Marlin.
*/
#ifndef MACHINE_NAME
#define MACHINE_NAME "3D Printer"
#endif
/**
* Website where users can find Marlin source code for the binary installed on the
* device. Override this if you provide public source code download. (GPLv3 requires
* providing the source code to your customers.)
*/
#ifndef SOURCE_CODE_URL
#define SOURCE_CODE_URL "github.com/MarlinFirmware/Marlin"
#endif
/**
* Default generic printer UUID.
*/
#ifndef DEFAULT_MACHINE_UUID
#define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff"
#endif
/**
* The WEBSITE_URL is the location where users can get more information such as
* documentation about a specific Marlin release. Displayed in the Info Menu.
*/
#ifndef WEBSITE_URL
#define WEBSITE_URL "marlinfw.org"
#endif
/**
* Set the vendor info the serial USB interface, if changable
* Currently only supported by DUE platform
*/
#ifndef USB_DEVICE_VENDOR_ID
#define USB_DEVICE_VENDOR_ID 0x03EB /* ATMEL VID */
#endif
#ifndef USB_DEVICE_PRODUCT_ID
#define USB_DEVICE_PRODUCT_ID 0x2424 /* MSC / CDC */
#endif
//! USB Device string definitions (Optional)
#ifndef USB_DEVICE_MANUFACTURE_NAME
#define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL
#endif
#ifdef CUSTOM_MACHINE_NAME
#define USB_DEVICE_PRODUCT_NAME CUSTOM_MACHINE_NAME
#else
#define USB_DEVICE_PRODUCT_NAME MACHINE_NAME
#endif
#define USB_DEVICE_SERIAL_NAME "123985739853"
|
2301_81045437/Marlin
|
Marlin/src/inc/Version.h
|
C
|
agpl-3.0
| 3,908
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 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/>.
*
*/
/**
* Warnings.cpp
* Test configuration values and give warnings at compile-time.
*/
#include "MarlinConfig.h"
//
// Warnings! Located here so they will appear just once in the build output.
//
// static_warning works like a static_assert but only emits a (messy) warning.
#ifdef __GNUC__
namespace mfwarn {
struct true_type {};
struct false_type {};
template <int test> struct converter : public true_type {};
template <> struct converter<0> : public false_type {};
}
#define static_warning(cond, msg) \
struct CAT(static_warning, __LINE__) { \
void _(::mfwarn::false_type const&) __attribute__((deprecated(msg))) {}; \
void _(::mfwarn::true_type const&) {}; \
CAT(static_warning, __LINE__)() {_(::mfwarn::converter<(cond)>());} \
}
#else
#define static_warning(...)
#endif
#if ENABLED(MARLIN_DEV_MODE)
#warning "WARNING! Disable MARLIN_DEV_MODE for the final build!"
#ifdef __LONG_MAX__
#if __LONG_MAX__ > __INT_MAX__
#warning "The 'long' type is larger than the 'int' type on this platform."
#else
#warning "The 'long' type is the same as the 'int' type on this platform."
#endif
#endif
#endif
#if DISABLED(DEBUG_FLAGS_GCODE)
#warning "DEBUG_FLAGS_GCODE is recommended if you have space. Some hosts rely on it."
#endif
#if DISABLED(CAPABILITIES_REPORT)
#warning "CAPABILITIES_REPORT is recommended if you have space. Some hosts rely on it."
#endif
#if ENABLED(LA_DEBUG)
#warning "WARNING! Disable LA_DEBUG for the final build!"
#endif
#if NUM_AXES_WARNING
#warning "Note: NUM_AXES is now based on the *_DRIVER_TYPE settings so you can remove NUM_AXES from Configuration.h."
#endif
// Safety Features
#if DISABLED(USE_WATCHDOG)
#warning "Safety Alert! Enable USE_WATCHDOG for the final build!"
#endif
#if HAS_HOTEND && DISABLED(THERMAL_PROTECTION_HOTENDS)
#warning "Safety Alert! Enable THERMAL_PROTECTION_HOTENDS for the final build!"
#endif
#if HAS_HEATED_BED && DISABLED(THERMAL_PROTECTION_BED)
#warning "Safety Alert! Enable THERMAL_PROTECTION_BED for the final build!"
#endif
#if HAS_HEATED_CHAMBER && DISABLED(THERMAL_PROTECTION_CHAMBER)
#warning "Safety Alert! Enable THERMAL_PROTECTION_CHAMBER for the final build!"
#endif
#if HAS_COOLER && DISABLED(THERMAL_PROTECTION_COOLER)
#warning "Safety Alert! Enable THERMAL_PROTECTION_COOLER for the final build!"
#endif
#if ENABLED(IGNORE_THERMOCOUPLE_ERRORS)
#warning "Safety Alert! Disable IGNORE_THERMOCOUPLE_ERRORS for the final build!"
#endif
#if ANY_THERMISTOR_IS(998) || ANY_THERMISTOR_IS(999)
#warning "Warning! Don't use dummy thermistors (998/999) for final build!"
#endif
#if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT, UNIT_TEST, NO_USER_FEEDBACK_WARNING)
#warning "Your Configuration provides no method to acquire user feedback! (Define NO_USER_FEEDBACK_WARNING to suppress this warning.)"
#endif
#if MB(DUE3DOM_MINI) && PIN_EXISTS(TEMP_2) && !TEMP_SENSOR_BOARD
#warning "Onboard temperature sensor for BOARD_DUE3DOM_MINI has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)."
#elif MB(BTT_SKR_E3_TURBO) && PIN_EXISTS(TEMP_2) && !TEMP_SENSOR_BOARD
#warning "Onboard temperature sensor for BOARD_BTT_SKR_E3_TURBO has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)."
#endif
#ifndef NO_AUTO_ASSIGN_WARNING
#if AUTO_ASSIGNED_LCD_SERIAL
#warning "Note: Auto-assigned LCD_SERIAL_PORT. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_X2_STEPPER
#warning "Note: Auto-assigned X2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_X2_MS1
#warning "Note: Auto-assigned X2_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_X2_MS2
#warning "Note: Auto-assigned X2_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_X2_MS3
#warning "Note: Auto-assigned X2_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_X2_CS
#warning "Note: Auto-assigned X2_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_X2_DIAG
#if X2_STOP_PIN == X_MIN_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == X_MAX_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == X_STOP_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == Y_MIN_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == Y_MAX_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == Y_STOP_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == Z_MIN_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == Z_MAX_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == Z_STOP_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == E0_DIAG_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == E1_DIAG_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == E2_DIAG_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == E3_DIAG_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == E4_DIAG_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == E5_DIAG_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == E6_DIAG_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif X2_STOP_PIN == E7_DIAG_PIN
#warning "Note: Auto-assigned X2 sensorless endstop to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#endif
#if AUTO_ASSIGNED_Y2_STEPPER
#warning "Note: Auto-assigned Y2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Y2_MS1
#warning "Note: Auto-assigned Y2_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Y2_MS2
#warning "Note: Auto-assigned Y2_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Y2_MS3
#warning "Note: Auto-assigned Y2_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Y2_CS
#warning "Note: Auto-assigned Y2_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Y2_DIAG
#if Y2_USE_ENDSTOP == X_MIN_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_STOP_PIN == X_MAX_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_STOP_PIN == X_STOP_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_USE_ENDSTOP == Y_MIN_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_STOP_PIN == Y_MAX_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_STOP_PIN == Y_STOP_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_USE_ENDSTOP == Z_MIN_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_STOP_PIN == Z_MAX_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_STOP_PIN == Z_STOP_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_STOP_PIN == E0_DIAG_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_STOP_PIN == E1_DIAG_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_STOP_PIN == E2_DIAG_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_STOP_PIN == E3_DIAG_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_STOP_PIN == E4_DIAG_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_STOP_PIN == E5_DIAG_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_STOP_PIN == E6_DIAG_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Y2_STOP_PIN == E7_DIAG_PIN
#warning "Note: Auto-assigned Y2 sensorless endstop to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#endif
#if AUTO_ASSIGNED_Z2_STEPPER
#warning "Note: Auto-assigned Z2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Z2_MS1
#warning "Note: Auto-assigned Z2_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Z2_MS2
#warning "Note: Auto-assigned Z2_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Z2_MS3
#warning "Note: Auto-assigned Z2_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Z2_CS
#warning "Note: Auto-assigned Z2_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Z2_DIAG
#if Z2_USE_ENDSTOP == X_MIN_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_STOP_PIN == X_MAX_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_STOP_PIN == X_STOP_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_USE_ENDSTOP == Y_MIN_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_STOP_PIN == Y_MAX_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_STOP_PIN == Y_STOP_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_USE_ENDSTOP == Z_MIN_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_STOP_PIN == Z_MAX_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_STOP_PIN == Z_STOP_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_STOP_PIN == E0_DIAG_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_STOP_PIN == E1_DIAG_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_STOP_PIN == E2_DIAG_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_STOP_PIN == E3_DIAG_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_STOP_PIN == E4_DIAG_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_STOP_PIN == E5_DIAG_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_STOP_PIN == E6_DIAG_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z2_STOP_PIN == E7_DIAG_PIN
#warning "Note: Auto-assigned Z2 sensorless endstop to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#endif
#if AUTO_ASSIGNED_Z3_STEPPER
#warning "Note: Auto-assigned Z3 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Z3_CS
#warning "Note: Auto-assigned Z3_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Z3_MS1
#warning "Note: Auto-assigned Z3_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Z3_MS2
#warning "Note: Auto-assigned Z3_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Z3_MS3
#warning "Note: Auto-assigned Z3_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Z3_DIAG
#if Z3_USE_ENDSTOP == X_MIN_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_STOP_PIN == X_MAX_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_STOP_PIN == X_STOP_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_USE_ENDSTOP == Y_MIN_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_STOP_PIN == Y_MAX_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_STOP_PIN == Y_STOP_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_USE_ENDSTOP == Z_MIN_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_STOP_PIN == Z_MAX_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_STOP_PIN == Z_STOP_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_STOP_PIN == E0_DIAG_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_STOP_PIN == E1_DIAG_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_STOP_PIN == E2_DIAG_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_STOP_PIN == E3_DIAG_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_STOP_PIN == E4_DIAG_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_STOP_PIN == E5_DIAG_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_STOP_PIN == E6_DIAG_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z3_STOP_PIN == E7_DIAG_PIN
#warning "Note: Auto-assigned Z3 sensorless endstop to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#endif
#if AUTO_ASSIGNED_Z4_STEPPER
#warning "Note: Auto-assigned Z4 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Z4_CS
#warning "Note: Auto-assigned Z4_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Z4_MS1
#warning "Note: Auto-assigned Z4_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Z4_MS2
#warning "Note: Auto-assigned Z4_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Z4_MS3
#warning "Note: Auto-assigned Z4_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_Z4_DIAG
#if Z4_USE_ENDSTOP == X_MIN_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_STOP_PIN == X_MAX_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_STOP_PIN == X_STOP_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_USE_ENDSTOP == Y_MIN_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_STOP_PIN == Y_MAX_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_STOP_PIN == Y_STOP_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_USE_ENDSTOP == Z_MIN_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_STOP_PIN == Z_MAX_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_STOP_PIN == Z_STOP_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_STOP_PIN == E0_DIAG_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_STOP_PIN == E1_DIAG_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_STOP_PIN == E2_DIAG_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_STOP_PIN == E3_DIAG_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_STOP_PIN == E4_DIAG_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_STOP_PIN == E5_DIAG_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_STOP_PIN == E6_DIAG_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif Z4_STOP_PIN == E7_DIAG_PIN
#warning "Note: Auto-assigned Z4 sensorless endstop to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#endif
#if AUTO_ASSIGNED_I_STEPPER
#warning "Note: Auto-assigned I STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_I_CS
#warning "Note: Auto-assigned I_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_I_MS1
#warning "Note: Auto-assigned I_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_I_MS2
#warning "Note: Auto-assigned I_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_I_MS3
#warning "Note: Auto-assigned I_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_I_DIAG
#if I_STOP_PIN == X_MIN_PIN
#warning "Note: Auto-assigned I sensorless endstop to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == X_MAX_PIN
#warning "Note: Auto-assigned I sensorless endstop to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == X_STOP_PIN
#warning "Note: Auto-assigned I sensorless endstop to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == Y_MIN_PIN
#warning "Note: Auto-assigned I sensorless endstop to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == Y_MAX_PIN
#warning "Note: Auto-assigned I sensorless endstop to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == Y_STOP_PIN
#warning "Note: Auto-assigned I sensorless endstop to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == Z_MIN_PIN
#warning "Note: Auto-assigned I sensorless endstop to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == Z_MAX_PIN
#warning "Note: Auto-assigned I sensorless endstop to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == Z_STOP_PIN
#warning "Note: Auto-assigned I sensorless endstop to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == E0_DIAG_PIN
#warning "Note: Auto-assigned I sensorless endstop to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == E1_DIAG_PIN
#warning "Note: Auto-assigned I sensorless endstop to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == E2_DIAG_PIN
#warning "Note: Auto-assigned I sensorless endstop to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == E3_DIAG_PIN
#warning "Note: Auto-assigned I sensorless endstop to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == E4_DIAG_PIN
#warning "Note: Auto-assigned I sensorless endstop to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == E5_DIAG_PIN
#warning "Note: Auto-assigned I sensorless endstop to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == E6_DIAG_PIN
#warning "Note: Auto-assigned I sensorless endstop to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif I_STOP_PIN == E7_DIAG_PIN
#warning "Note: Auto-assigned I sensorless endstop to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#endif
#if AUTO_ASSIGNED_J_STEPPER
#warning "Note: Auto-assigned J STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_J_CS
#warning "Note: Auto-assigned J_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_J_MS1
#warning "Note: Auto-assigned J_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_J_MS2
#warning "Note: Auto-assigned J_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_J_MS3
#warning "Note: Auto-assigned J_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_J_DIAG
#if J_STOP_PIN == X_MIN_PIN
#warning "Note: Auto-assigned J sensorless endstop to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == X_MAX_PIN
#warning "Note: Auto-assigned J sensorless endstop to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == X_STOP_PIN
#warning "Note: Auto-assigned J sensorless endstop to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == Y_MIN_PIN
#warning "Note: Auto-assigned J sensorless endstop to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == Y_MAX_PIN
#warning "Note: Auto-assigned J sensorless endstop to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == Y_STOP_PIN
#warning "Note: Auto-assigned J sensorless endstop to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == Z_MIN_PIN
#warning "Note: Auto-assigned J sensorless endstop to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == Z_MAX_PIN
#warning "Note: Auto-assigned J sensorless endstop to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == Z_STOP_PIN
#warning "Note: Auto-assigned J sensorless endstop to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == E0_DIAG_PIN
#warning "Note: Auto-assigned J sensorless endstop to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == E1_DIAG_PIN
#warning "Note: Auto-assigned J sensorless endstop to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == E2_DIAG_PIN
#warning "Note: Auto-assigned J sensorless endstop to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == E3_DIAG_PIN
#warning "Note: Auto-assigned J sensorless endstop to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == E4_DIAG_PIN
#warning "Note: Auto-assigned J sensorless endstop to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == E5_DIAG_PIN
#warning "Note: Auto-assigned J sensorless endstop to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == E6_DIAG_PIN
#warning "Note: Auto-assigned J sensorless endstop to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif J_STOP_PIN == E7_DIAG_PIN
#warning "Note: Auto-assigned J sensorless endstop to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#endif
#if AUTO_ASSIGNED_K_STEPPER
#warning "Note: Auto-assigned K STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_K_CS
#warning "Note: Auto-assigned K_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_K_MS1
#warning "Note: Auto-assigned K_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_K_MS2
#warning "Note: Auto-assigned K_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_K_MS3
#warning "Note: Auto-assigned K_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_K_DIAG
#if K_STOP_PIN == X_MIN_PIN
#warning "Note: Auto-assigned K sensorless endstop to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == X_MAX_PIN
#warning "Note: Auto-assigned K sensorless endstop to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == X_STOP_PIN
#warning "Note: Auto-assigned K sensorless endstop to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == Y_MIN_PIN
#warning "Note: Auto-assigned K sensorless endstop to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == Y_MAX_PIN
#warning "Note: Auto-assigned K sensorless endstop to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == Y_STOP_PIN
#warning "Note: Auto-assigned K sensorless endstop to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == Z_MIN_PIN
#warning "Note: Auto-assigned K sensorless endstop to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == Z_MAX_PIN
#warning "Note: Auto-assigned K sensorless endstop to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == Z_STOP_PIN
#warning "Note: Auto-assigned K sensorless endstop to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == E0_DIAG_PIN
#warning "Note: Auto-assigned K sensorless endstop to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == E1_DIAG_PIN
#warning "Note: Auto-assigned K sensorless endstop to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == E2_DIAG_PIN
#warning "Note: Auto-assigned K sensorless endstop to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == E3_DIAG_PIN
#warning "Note: Auto-assigned K sensorless endstop to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == E4_DIAG_PIN
#warning "Note: Auto-assigned K sensorless endstop to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == E5_DIAG_PIN
#warning "Note: Auto-assigned K sensorless endstop to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == E6_DIAG_PIN
#warning "Note: Auto-assigned K sensorless endstop to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == E7_DIAG_PIN
#warning "Note: Auto-assigned K sensorless endstop to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#endif
#if AUTO_ASSIGNED_U_STEPPER
#warning "Note: Auto-assigned U STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_U_CS
#warning "Note: Auto-assigned U_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_U_MS1
#warning "Note: Auto-assigned U_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_U_MS2
#warning "Note: Auto-assigned U_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_U_MS3
#warning "Note: Auto-assigned U_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_U_DIAG
#if U_STOP_PIN == X_MIN_PIN
#warning "Note: Auto-assigned U sensorless endstop to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif U_STOP_PIN == X_MAX_PIN
#warning "Note: Auto-assigned U sensorless endstop to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif K_STOP_PIN == Y_MIN_PIN
#warning "Note: Auto-assigned U sensorless endstop to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif U_STOP_PIN == Y_MAX_PIN
#warning "Note: Auto-assigned U sensorless endstop to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif U_STOP_PIN == Z_MIN_PIN
#warning "Note: Auto-assigned U sensorless endstop to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif U_STOP_PIN == Z_MAX_PIN
#warning "Note: Auto-assigned U sensorless endstop to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif U_STOP_PIN == E0_DIAG_PIN
#warning "Note: Auto-assigned U sensorless endstop to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif U_STOP_PIN == E1_DIAG_PIN
#warning "Note: Auto-assigned U sensorless endstop to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif U_STOP_PIN == E2_DIAG_PIN
#warning "Note: Auto-assigned U sensorless endstop to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif U_STOP_PIN == E3_DIAG_PIN
#warning "Note: Auto-assigned U sensorless endstop to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif U_STOP_PIN == E4_DIAG_PIN
#warning "Note: Auto-assigned U sensorless endstop to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif U_STOP_PIN == E5_DIAG_PIN
#warning "Note: Auto-assigned U sensorless endstop to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif U_STOP_PIN == E6_DIAG_PIN
#warning "Note: Auto-assigned U sensorless endstop to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif U_STOP_PIN == E7_DIAG_PIN
#warning "Note: Auto-assigned U sensorless endstop to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#endif
#if AUTO_ASSIGNED_V_STEPPER
#warning "Note: Auto-assigned V STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_V_CS
#warning "Note: Auto-assigned V_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_V_MS1
#warning "Note: Auto-assigned V_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_V_MS2
#warning "Note: Auto-assigned V_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_V_MS3
#warning "Note: Auto-assigned V_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_V_DIAG
#if V_STOP_PIN == X_MIN_PIN
#warning "Note: Auto-assigned V sensorless endstop to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif V_STOP_PIN == X_MAX_PIN
#warning "Note: Auto-assigned V sensorless endstop to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif V_STOP_PIN == Y_MIN_PIN
#warning "Note: Auto-assigned V sensorless endstop to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif V_STOP_PIN == Y_MAX_PIN
#warning "Note: Auto-assigned V sensorless endstop to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif V_STOP_PIN == Z_MIN_PIN
#warning "Note: Auto-assigned V sensorless endstop to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif V_STOP_PIN == Z_MAX_PIN
#warning "Note: Auto-assigned V sensorless endstop to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif V_STOP_PIN == E0_DIAG_PIN
#warning "Note: Auto-assigned V sensorless endstop to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif V_STOP_PIN == E1_DIAG_PIN
#warning "Note: Auto-assigned V sensorless endstop to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif V_STOP_PIN == E2_DIAG_PIN
#warning "Note: Auto-assigned V sensorless endstop to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif V_STOP_PIN == E3_DIAG_PIN
#warning "Note: Auto-assigned V sensorless endstop to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif V_STOP_PIN == E4_DIAG_PIN
#warning "Note: Auto-assigned V sensorless endstop to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif V_STOP_PIN == E5_DIAG_PIN
#warning "Note: Auto-assigned V sensorless endstop to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif V_STOP_PIN == E6_DIAG_PIN
#warning "Note: Auto-assigned V sensorless endstop to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif V_STOP_PIN == E7_DIAG_PIN
#warning "Note: Auto-assigned V sensorless endstop to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#endif
#if AUTO_ASSIGNED_W_STEPPER
#warning "Note: Auto-assigned W STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_W_CS
#warning "Note: Auto-assigned W_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_W_MS1
#warning "Note: Auto-assigned W_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_W_MS2
#warning "Note: Auto-assigned W_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_W_MS3
#warning "Note: Auto-assigned W_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#if AUTO_ASSIGNED_W_DIAG
#if W_STOP_PIN == X_MIN_PIN
#warning "Note: Auto-assigned W sensorless endstop to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif W_STOP_PIN == X_MAX_PIN
#warning "Note: Auto-assigned W sensorless endstop to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif W_STOP_PIN == Y_MIN_PIN
#warning "Note: Auto-assigned W sensorless endstop to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif W_STOP_PIN == Y_MAX_PIN
#warning "Note: Auto-assigned W sensorless endstop to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif W_STOP_PIN == Z_MIN_PIN
#warning "Note: Auto-assigned W sensorless endstop to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif W_STOP_PIN == Z_MAX_PIN
#warning "Note: Auto-assigned W sensorless endstop to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif W_STOP_PIN == E0_DIAG_PIN
#warning "Note: Auto-assigned W sensorless endstop to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif W_STOP_PIN == E1_DIAG_PIN
#warning "Note: Auto-assigned W sensorless endstop to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif W_STOP_PIN == E2_DIAG_PIN
#warning "Note: Auto-assigned W sensorless endstop to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif W_STOP_PIN == E3_DIAG_PIN
#warning "Note: Auto-assigned W sensorless endstop to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif W_STOP_PIN == E4_DIAG_PIN
#warning "Note: Auto-assigned W sensorless endstop to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif W_STOP_PIN == E5_DIAG_PIN
#warning "Note: Auto-assigned W sensorless endstop to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif W_STOP_PIN == E6_DIAG_PIN
#warning "Note: Auto-assigned W sensorless endstop to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#elif W_STOP_PIN == E7_DIAG_PIN
#warning "Note: Auto-assigned W sensorless endstop to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#endif
#if ENABLED(CHAMBER_FAN) && !defined(CHAMBER_FAN_INDEX)
#warning "Note: Auto-assigned CHAMBER_FAN_INDEX to the first free FAN pin. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
#endif
#endif // !NO_AUTO_ASSIGN_WARNING
#if IS_LEGACY_TFT
#warning "Don't forget to update your TFT settings in Configuration.h."
#endif
#if ENABLED(EMIT_CREALITY_422_WARNING) && DISABLED(NO_CREALITY_422_DRIVER_WARNING)
// Driver labels: A=TMC2208, B=TMC2209, C=HR4988, E=A4988, H=TMC2225, H8=HR4988
#warning "Creality 4.2.2 boards come with a variety of stepper drivers. Check the board label (typically on SD Card module) and set the correct *_DRIVER_TYPE! (A/H: TMC2208_STANDALONE B: TMC2209_STANDALONE C/E/H8: A4988). (Define NO_CREALITY_422_DRIVER_WARNING to suppress this warning.)"
#endif
#if ENABLED(PRINTCOUNTER_SYNC)
#warning "To prevent step loss, motion will pause for PRINTCOUNTER auto-save."
#endif
#if HOMING_Z_WITH_PROBE && IS_CARTESIAN && NONE(Z_SAFE_HOMING, NO_Z_SAFE_HOMING_WARNING)
#error "Z_SAFE_HOMING is recommended when homing with a probe. (Enable Z_SAFE_HOMING or define NO_Z_SAFE_HOMING_WARNING to suppress this warning.)"
#endif
#if ENABLED(BIQU_MICROPROBE_V2) && NONE(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, NO_MICROPROBE_WARNING)
#warning "BIQU MicroProbe V2 detect signal requires a strong pull-up. Some processors have weak internal pull-up capabilities, so we recommended connecting MicroProbe SIGNAL / GND to Z-MIN / Z-STOP instead of the dedicated PROBE port. (Define NO_MICROPROBE_WARNING to suppress this warning.)"
#endif
//
// Warn users of potential endstop/DIAG pin conflicts to prevent homing issues when not using sensorless homing
//
#if !USE_SENSORLESS && HAS_DIAG_PINS
#if ENABLED(USES_DIAG_JUMPERS) && DISABLED(DIAG_JUMPERS_REMOVED)
#warning "Motherboard DIAG jumpers must be removed when SENSORLESS_HOMING is disabled. (Define DIAG_JUMPERS_REMOVED to suppress this warning.)"
#endif
#if ENABLED(USES_DIAG_PINS) && DISABLED(DIAG_PINS_REMOVED)
#warning "Driver DIAG pins must be physically removed unless SENSORLESS_HOMING is enabled. (See https://bit.ly/2ZPRlt0) (Define DIAG_PINS_REMOVED to suppress this warning.)"
#endif
#endif
#if ENABLED(QUICK_HOME) && (X_SPI_SENSORLESS || Y_SPI_SENSORLESS)
#warning "SPI_ENDSTOPS may be unreliable with QUICK_HOME. Adjust back-offs for better results."
#endif
#if CANNOT_EMBED_CONFIGURATION
#warning "Disabled CONFIGURATION_EMBEDDING because the target usually has less flash storage. Define FORCE_CONFIG_EMBED to override."
#endif
#if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX && DISABLED(NO_LCD_CONTRAST_WARNING)
#warning "Contrast cannot be changed when LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX. (Define NO_LCD_CONTRAST_WARNING to suppress this warning.)"
#endif
#if PROGRESS_MSG_EXPIRE > 0 && HAS_STATUS_MESSAGE_TIMEOUT
#warning "It is recommended not to combine PROGRESS_MSG_EXPIRE with STATUS_MESSAGE_TIMEOUT_SEC."
#endif
/**
* FYSETC/MKS/BTT/BEEZ Mini Panel backlighting
*/
#if ANY(FYSETC_242_OLED_12864, FYSETC_MINI_12864_2_1) && !ALL(NEOPIXEL_LED, LED_CONTROL_MENU, LED_USER_PRESET_STARTUP, LED_COLOR_PRESETS)
#warning "Your FYSETC/MKS/BTT/BEEZ Mini Panel works best with NEOPIXEL_LED, LED_CONTROL_MENU, LED_USER_PRESET_STARTUP, and LED_COLOR_PRESETS."
#endif
#if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED)
#warning "Your FYSETC Mini Panel works best with RGB_LED."
#elif ANY(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && DISABLED(LED_USER_PRESET_STARTUP)
#warning "Your FYSETC/MKS/BTT/BEEZ Mini Panel works best with LED_USER_PRESET_STARTUP."
#endif
#if ANY(FYSETC_242_OLED_12864, FYSETC_MINI_12864) && ALL(PSU_CONTROL, HAS_COLOR_LEDS) && !LED_POWEROFF_TIMEOUT
#warning "Your FYSETC display with PSU_CONTROL works best with LED_POWEROFF_TIMEOUT."
#endif
/**
* Maple environment
*/
#if defined(__STM32F1__) && DISABLED(NO_MAPLE_WARNING)
#warning "Maple build environments are deprecated. Please use a non-Maple build environment. Report issues to the Marlin Firmware project."
#endif
/**
* Průša MK3/S/+ fan pin reassignment
*/
#if MB(BTT_BTT002_V1_0, EINSY_RAMBO) && DISABLED(NO_MK3_FAN_PINS_WARNING)
#warning "Define MK3_FAN_PINS to swap hotend and part cooling fan pins. (Define NO_MK3_FAN_PINS_WARNING to suppress this warning.)"
#endif
/**
* GD32 is not exactly like STM32
*/
#if MB(SOVOL_V131, TRIGORILLA_V006)
#warning "GD32 based controllers may not be fully compatible with STM32 platforms. Please report any issues."
#endif
/**
* BD Sensor should always include BABYSTEPPING
*/
#if ENABLED(BD_SENSOR) && DISABLED(BABYSTEPPING)
#warning "BABYSTEPPING is recommended with BD_SENSOR."
#endif
/**
* EP Babystepping works best with EMERGENCY_PARSER
*/
#if ENABLED(EP_BABYSTEPPING) && DISABLED(EMERGENCY_PARSER)
#warning "EMERGENCY_PARSER is recommended for EP_BABYSTEPPING."
#endif
/**
* POLAR warnings
*/
#if ALL(POLAR, S_CURVE_ACCELERATION)
#warning "POLAR kinematics may not work well with S_CURVE_ACCELERATION."
#endif
/**
* Input Shaping
*/
#if HAS_ZV_SHAPING && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
#warning "Input Shaping for CORE / MARKFORGED kinematic axes is still experimental."
#endif
/**
* Automatic Multistepping Limit
*/
#if MULTISTEPPING_LIMIT_WARNING
#warning "MULTISTEPPING_LIMIT has been automatically set to 128. Use a lower value if the machine is slow to respond."
#endif
/**
* SD Card extras
*/
#if SDSORT_CACHE_VFATS_WARNING
#warning "SDSORT_CACHE_VFATS has been reduced to VFAT_ENTRIES_LIMIT."
#endif
#if SDSORT_CACHE_LPC1768_WARNING
#warning "SDCARD_SORT_ALPHA sub-options overridden for LPC1768 with DOGM LCD SCK overlap."
#endif
/**
* Ender-5 S1 bootloader
*/
#ifdef STM32F4_UPDATE_FOLDER
#warning "Place the firmware bin file in a folder named 'STM32F4_UPDATE' on the SD card. Install with 'M936 V2'."
#endif
/**
* Voxelab N32 bootloader
*/
#ifdef SDCARD_FLASH_LIMIT_256K
#warning "This board has 512K but the bootloader can only flash firmware.bin <= 256K. ICSP required for full 512K capacity."
#endif
/**
* ProUI Extras
*/
#if ENABLED(DWIN_LCD_PROUI)
#if BOOTSCREEN_TIMEOUT > 2000
#warning "For ProUI the original BOOTSCREEN_TIMEOUT of 1100 is recommended."
#endif
#if HAS_PID_HEATING && NONE(PID_AUTOTUNE_MENU, PID_EDIT_MENU)
#warning "For ProUI PID_AUTOTUNE_MENU and PID_EDIT_MENU is recommended for PID tuning."
#elif ENABLED(MPCTEMP) && NONE(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU)
#warning "For ProUI MPC_EDIT_MENU and MPC_AUTOTUNE_MENU is recommended for MPC tuning."
#endif
#endif
/**
* AD595 Minimum Voltage
*/
#if HAL_ADC_VREF_MV < 5000 && ANY_THERMISTOR_IS(-1) && DISABLED(ALLOW_AD595_3V3_VREF)
#warning "The (-1) AD595 Thermocouple Amplifier requires 5V input supply! Use AD8495 for 3.3V ADC."
#endif
/**
* No PWM on the Piezo Beeper?
*/
#if PIN_EXISTS(BEEPER) && ALL(SPEAKER, NO_SPEAKER)
#warning "The BEEPER cannot produce tones so you can disable SPEAKER."
#endif
/**
* Fixed-Time Motion
*/
#if ALL(FT_MOTION, I2S_STEPPER_STREAM)
#warning "FT_MOTION has not been tested with I2S_STEPPER_STREAM."
#endif
/**
* User doesn't have or disabled G92?
*/
#if DISABLED(EDITABLE_STEPS_PER_UNIT)
#warning "EDITABLE_STEPS_PER_UNIT is required to enable G92 runtime configuration of steps-per-unit."
#endif
|
2301_81045437/Marlin
|
Marlin/src/inc/Warnings.cpp
|
C++
|
agpl-3.0
| 51,292
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
/**
* @file lcdprint_hd44780.cpp
* @brief LCD print api for HD44780
* @author Yunhui Fu (yhfudev@gmail.com)
* @version 1.0
* @date 2016-08-19
* @copyright GPL/BSD
*/
/**
* Due to the limitation of the HD44780 hardware, the current available LCD modules can only support
* Western(English), Cyrillic(Russian), Kana(Japanese) charsets.
*/
#include "../../inc/MarlinConfigPre.h"
#if HAS_MARLINUI_HD44780
#include "../marlinui.h"
#include "../../MarlinCore.h"
#include "marlinui_HD44780.h"
#include <string.h>
extern LCD_CLASS lcd;
int lcd_glyph_height() { return 1; }
typedef struct _hd44780_charmap_t {
lchar_t uchar; // the unicode char
uint8_t idx; // the glyph of the char in the ROM
uint8_t idx2; // the char used to be combined with the idx to simulate a single char
} hd44780_charmap_t;
#ifdef __AVR__
#define IV(a) lchar_t(U##a)
#else
#define IV(a) lchar_t(L##a)
#endif
static const hd44780_charmap_t g_hd44780_charmap_device[] PROGMEM = {
// sorted by uchar:
#if DISPLAY_CHARSET_HD44780 == JAPANESE
{IV('¢'), 0xEC, 0}, // A2
{IV('°'), 0xDF, 0}, // B0, Marlin special: '°' LCD_STR_DEGREE (0x09)
{IV('ä'), 0xE1, 0}, // E4
{IV('ö'), 0xEF, 0}, // F6
{IV('÷'), 0xFD, 0}, // 00F7
{IV('ü'), 0xF5, 0}, // 00FC
{IV('ˣ'), 0xEB, 0}, // 02E3
{IV('·'), 0xA5, 0}, // 0387
{IV('Ώ'), 0xF4, 0}, // 038F
{IV('Θ'), 0xF2, 0}, // 0398, Theta
{IV('Ξ'), 0xE3, 0}, // 039E, Xi
{IV('Σ'), 0xF6, 0}, // 03A3, Sigma
{IV('Ω'), 0xF4, 0}, // 03A9, Omega
{IV('ά'), 0xE0, 0}, // 03AC
{IV('έ'), 0xE3, 0}, // 03AD
{IV('α'), 0xE0, 0}, // 03B1, alpha
{IV('β'), 0xE2, 0}, // 03B2, beta
{IV('ε'), 0xE3, 0}, // 03B5, epsilon
{IV('θ'), 0xF2, 0}, // 03B8, theta
{IV('μ'), 0xE4, 0}, // 03BC, mu
{IV('ξ'), 0xE3, 0}, // 03BE, xi
{IV('π'), 0xF7, 0}, // 03C0, pi
{IV('ρ'), 0xE6, 0}, // 03C1, rho
{IV('σ'), 0xE5, 0}, // 03C3, sigma
{IV('←'), 0x7F, 0}, // 2190
{IV('→'), 0x7E, 0}, // 2192, Marlin special: '⮈⮉⮊⮋➤→' LCD_STR_ARROW_RIGHT (0x03)
{IV('√'), 0xE8, 0}, // 221A
{IV('∞'), 0xF3, 0}, // 221E
{IV('█'), 0xFF, 0}, // 2588
//{IV(''), 0xA0, 0},
{IV('。'), 0xA1, 0},
{IV('「'), 0xA2, 0},
{IV('」'), 0xA3, 0},
{IV('゛'), 0xDE, 0}, // ‶
{IV('゜'), 0xDF, 0}, // '〫'
{IV('゠'), '=', 0},
{IV('ァ'), 0xA7, 0},
{IV('ア'), 0xB1, 0},
{IV('ィ'), 0xA8, 0},
{IV('イ'), 0xB2, 0},
{IV('ゥ'), 0xA9, 0},
{IV('ウ'), 0xB3, 0},
{IV('ェ'), 0xAA, 0},
{IV('エ'), 0xB4, 0},
{IV('ォ'), 0xAB, 0},
{IV('オ'), 0xB5, 0},
{IV('カ'), 0xB6, 0},
{IV('ガ'), 0xB6, 0xDE},
{IV('キ'), 0xB7, 0},
{IV('ギ'), 0xB7, 0xDE},
{IV('ク'), 0xB8, 0},
{IV('グ'), 0xB8, 0xDE},
{IV('ケ'), 0xB9, 0},
{IV('ゲ'), 0xB9, 0xDE},
{IV('コ'), 0xBA, 0},
{IV('ゴ'), 0xBA, 0xDE},
{IV('サ'), 0xBB, 0},
{IV('ザ'), 0xBB, 0xDE},
{IV('シ'), 0xBC, 0},
{IV('ジ'), 0xBC, 0xDE},
{IV('ス'), 0xBD, 0},
{IV('ズ'), 0xBD, 0xDE},
{IV('セ'), 0xBE, 0},
{IV('ゼ'), 0xBE, 0xDE},
{IV('ソ'), 0xBF, 0},
{IV('ゾ'), 0xBF, 0xDE},
{IV('タ'), 0xC0, 0},
{IV('ダ'), 0xC0, 0xDE},
{IV('チ'), 0xC1, 0},
{IV('ヂ'), 0xC1, 0xDE},
{IV('ッ'), 0xAF, 0},
{IV('ツ'), 0xC2, 0},
{IV('ヅ'), 0xC2, 0xDE},
{IV('テ'), 0xC3, 0},
{IV('デ'), 0xC3, 0xDE},
{IV('ト'), 0xC4, 0},
{IV('ド'), 0xC4, 0xDE},
{IV('ナ'), 0xC5, 0},
{IV('ニ'), 0xC6, 0},
{IV('ヌ'), 0xC7, 0},
{IV('ネ'), 0xC8, 0},
{IV('ノ'), 0xC9, 0},
{IV('ハ'), 0xCA, 0},
{IV('バ'), 0xCA, 0xDE},
{IV('パ'), 0xCA, 0xDF},
{IV('ヒ'), 0xCB, 0},
{IV('ビ'), 0xCB, 0xDE},
{IV('ピ'), 0xCB, 0xDF},
{IV('フ'), 0xCC, 0},
{IV('ブ'), 0xCC, 0xDE},
{IV('プ'), 0xCC, 0xDF},
{IV('ヘ'), 0xCD, 0},
{IV('ベ'), 0xCD, 0xDE},
{IV('ペ'), 0xCD, 0xDF},
{IV('ホ'), 0xCE, 0},
{IV('ボ'), 0xCE, 0xDE},
{IV('ポ'), 0xCE, 0xDF},
{IV('マ'), 0xCF, 0},
{IV('ミ'), 0xD0, 0},
{IV('ム'), 0xD1, 0},
{IV('メ'), 0xD2, 0},
{IV('モ'), 0xD3, 0},
{IV('ャ'), 0xAC, 0},
{IV('ヤ'), 0xD4, 0},
{IV('ュ'), 0xAD, 0},
{IV('ユ'), 0xD5, 0},
{IV('ョ'), 0xAE, 0},
{IV('ヨ'), 0xD6, 0},
{IV('ラ'), 0xD7, 0},
{IV('リ'), 0xD8, 0},
{IV('ル'), 0xD9, 0},
{IV('レ'), 0xDA, 0},
{IV('ロ'), 0xDB, 0},
{IV('ワ'), 0xDC, 0},
{IV('ヲ'), 0xA6, 0},
{IV('ン'), 0xDD, 0},
{IV('ヴ'), 0xB3, 0xDE},
{IV('ヷ'), 0xDC, 0xDE},
{IV('ヺ'), 0xA6, 0xDE},
{IV('・'), 0xA5, 0},
{IV('ー'), 0xB0, 0},
{IV('ヽ'), 0xA4, 0},
//{IV('g'), 0xE7, 0}, // error
//{IV(''), 0xE9, 0},
//{IV('j'), 0xEA, 0}, // error
//{IV(''), 0xED, 0},
//{IV(''), 0xEE, 0},
//{IV('p'), 0xF0, 0}, // error
//{IV('q'), 0xF1, 0}, // error
//{IV(''), 0xF8, 0},
//{IV('y'), 0xF9, 0}, // error
{IV('万'), 0xFB, 0},
{IV('円'), 0xFC, 0},
{IV('千'), 0xFA, 0},
//{IV(''), 0xFE, 0},
//、・ヲァィゥェォャュョッー
{IV('、'), 0xA4, 0}, //ヽ
{IV('・'), 0xA5, 0}, //・
{IV('ヲ'), 0xA6, 0}, //ヲ
{IV('ァ'), 0xA7, 0}, //ァ
{IV('ィ'), 0xA8, 0}, //ィ
{IV('ゥ'), 0xA9, 0}, //ゥ
{IV('ェ'), 0xAA, 0}, //ェ
{IV('ォ'), 0xAB, 0}, //ォ
{IV('ャ'), 0xAC, 0}, //ャ
{IV('ュ'), 0xAD, 0}, //ュ
{IV('ョ'), 0xAE, 0}, //ョ
{IV('ッ'), 0xAF, 0}, //ッ
{IV('ー'), 0xB0, 0}, //ー
//アイウエオカキクケコサシスセ
{IV('ア'), 0xB1, 0}, //ア
{IV('イ'), 0xB2, 0}, //イ
{IV('ウ'), 0xB3, 0}, //ウ
{IV('エ'), 0xB4, 0}, //エ
{IV('オ'), 0xB5, 0}, //オ
{IV('カ'), 0xB6, 0}, //カ
{IV('キ'), 0xB7, 0}, //キ
{IV('ク'), 0xB8, 0}, //ク
{IV('ケ'), 0xB9, 0}, //ケ
{IV('コ'), 0xBA, 0}, //コ
{IV('サ'), 0xBB, 0}, //サ
{IV('シ'), 0xBC, 0}, //シ
{IV('ス'), 0xBD, 0}, //ス
{IV('セ'), 0xBE, 0}, //セ
//ソタチツテトナニヌネノハヒフ
{IV('ソ'), 0xBF, 0}, //ソ
{IV('タ'), 0xC0, 0}, //タ
{IV('チ'), 0xC1, 0}, //チ
{IV('ツ'), 0xC2, 0}, //ツ
{IV('テ'), 0xC3, 0}, //テ
{IV('ト'), 0xC4, 0}, //ト
{IV('ナ'), 0xC5, 0}, //ナ
{IV('ニ'), 0xC6, 0}, //ニ
{IV('ヌ'), 0xC7, 0}, //ヌ
{IV('ネ'), 0xC8, 0}, //ネ
{IV('ノ'), 0xC9, 0}, //ノ
{IV('ハ'), 0xCA, 0}, //ハ
{IV('ヒ'), 0xCB, 0}, //ヒ
{IV('フ'), 0xCC, 0}, //フ
//ヘホマミムメモヤユヨラリルレロワン゙゚
{IV('ヘ'), 0xCD, 0}, //ヘ
{IV('ホ'), 0xCE, 0}, //ホ
{IV('マ'), 0xCF, 0}, //マ
{IV('ミ'), 0xD0, 0}, //ミ
{IV('ム'), 0xD1, 0}, //ム
{IV('メ'), 0xD2, 0}, //メ
{IV('モ'), 0xD3, 0}, //モ
{IV('ヤ'), 0xD4, 0}, //ヤ
{IV('ユ'), 0xD5, 0}, //ユ
{IV('ヨ'), 0xD6, 0}, //ヨ
{IV('ラ'), 0xD7, 0}, //ラ
{IV('リ'), 0xD8, 0}, //リ
{IV('ル'), 0xD9, 0}, //ル
{IV('レ'), 0xDA, 0}, //レ
{IV('ロ'), 0xDB, 0}, //ロ
{IV('ワ'), 0xDC, 0}, //ワ
{IV('ン'), 0xDD, 0}, //ン
{IV('゙'), 0xDE, 0}, // ゛
{IV('゚'), 0xDF, 0}, // ゜
{IV('¥'), 0x5C, 0},
#elif DISPLAY_CHARSET_HD44780 == WESTERN
// 0x10 -- 0x1F (except 0x1C)
// 0x80 -- 0xFF (except 0xA7,0xB0,0xB1,0xB3,0xB4,0xBF,0xD1,0xF8,0xFA,0xFC-0xFF)
{IV('¡'), 0xA9, 0},
{IV('¢'), 0xA4, 0},
{IV('£'), 0xA5, 0},
{IV('¥'), 0xA6, 0},
{IV('§'), 0xD2, 0}, // section sign
{IV('©'), 0xCF, 0},
{IV('ª'), 0x9D, 0},
{IV('«'), 0xBB, 0},
{IV('®'), 0xCE, 0},
{IV('°'), 0xB2, 0}, // Marlin special: '°' LCD_STR_DEGREE (0x09)
//{IV(''), 0xD1, 0},
{IV('±'), 0x10, 0}, //∓±
//{'='), 0x1C, 0}, // error
{IV('²'), 0x1E, 0},
{IV('³'), 0x1F, 0},
{IV('¶'), 0xD3, 0}, // pilcrow sign
{IV('º'), 0x9E, 0},
{IV('»'), 0xBC, 0}, // 00BB
//{IV(''), 0xB3, 0}, // error
//{IV(''), 0xB4, 0}, // error
{IV('¼'), 0xB6, 0}, // 00BC
{IV('½'), 0xB5, 0}, // 00BD
//{IV('¾'), '3', 0}, // 00BE
{IV('¿'), 0x9F, 0}, // 00BF
{IV('Â'), 0x8F, 0},
{IV('Ã'), 0xAA, 0},
{IV('Ä'), 0x8E, 0},
{IV('Æ'), 0x92, 0},
{IV('Ç'), 0x80, 0},
{IV('É'), 0x90, 0},
{IV('Ñ'), 0x9C, 0},
{IV('Õ'), 0xAC, 0},
{IV('Ö'), 0x99, 0},
{IV('×'), 0xB7, 0},
{IV('Ø'), 0xAE, 0},
{IV('Ü'), 0x9A, 0},
{IV('à'), 0x85, 0},
{IV('á'), 0xA0, 0},
{IV('â'), 0x83, 0},
{IV('ã'), 0xAB, 0},
{IV('ä'), 0x84, 0},
{IV('å'), 0x86, 0},
{IV('æ'), 0x91, 0},
{IV('ç'), 0x87, 0},
{IV('è'), 0x8A, 0},
{IV('é'), 0x82, 0},
{IV('ê'), 0x88, 0},
{IV('ë'), 0x89, 0},
{IV('ì'), 0x8D, 0},
{IV('í'), 0xA1, 0},
{IV('î'), 0x8C, 0},
{IV('ï'), 0x8B, 0},
{IV('ñ'), 0x9B, 0},
{IV('ò'), 0x95, 0},
{IV('ó'), 0xA2, 0},
{IV('ô'), 0x93, 0},
{IV('õ'), 0xAD, 0},
{IV('ö'), 0x94, 0},
{IV('÷'), 0xB8, 0},
{IV('ø'), 0xAF, 0},
{IV('ù'), 0x97, 0},
{IV('ú'), 0xA3, 0},
{IV('û'), 0x96, 0},
{IV('ü'), 0x81, 0},
{IV('ÿ'), 0x98, 0},
//{IV(''), 0xB0, 0}, // error
//{IV(''), 0xB1, 0}, // error
{IV('ƒ'), 0xA8, 0}, // 0192
{IV('Ύ'), 0xDB, 0}, // 038E
{IV('Ώ'), 0xDE, 0}, // 038F
{IV('ΐ'), 0xE7, 0}, // 0390
{IV('Γ'), 0xD4, 0}, // 0393, Gamma
{IV('Δ'), 0xD5, 0}, // 0394, Delta, ◿
{IV('Θ'), 0xD6, 0}, // 0398, Theta
{IV('Λ'), 0xD7, 0}, // 039B, Lambda
{IV('Ξ'), 0xD8, 0}, // 039E, Xi
{IV('Π'), 0xD9, 0}, // Pi
{IV('Σ'), 0xDA, 0}, // Sigma
{IV('Υ'), 0xDB, 0}, // Upsilon
{IV('Φ'), 0xDC, 0}, // Phi
{IV('Ψ'), 0xDD, 0}, // Psi
{IV('Ω'), 0xDE, 0}, // Omega
{IV('ά'), 0xDF, 0}, // 03AC
{IV('έ'), 0xE3, 0}, // 03AD
{IV('ή'), 0xE5, 0}, // 03AE
{IV('ί'), 0xE7, 0}, // 03AF
{IV('ΰ'), 0xF1, 0}, // 03B0
{IV('α'), 0xDF, 0}, // alpha
{IV('β'), 0xE0, 0}, // beta
{IV('γ'), 0xE1, 0}, // gamma
{IV('δ'), 0xE2, 0}, // delta
{IV('ε'), 0xE3, 0}, // epsilon
{IV('ζ'), 0xE4, 0}, // zeta
{IV('η'), 0xE5, 0}, // eta
{IV('θ'), 0xE6, 0}, // theta
{IV('ι'), 0xE7, 0}, // lota
{IV('κ'), 0xE8, 0}, // kappa
{IV('λ'), 0xE9, 0}, // lambda
{IV('μ'), 0xEA, 0}, // mu
{IV('ν'), 0xEB, 0}, // nu
{IV('ξ'), 0xEC, 0}, // xi
{IV('π'), 0xED, 0}, // pi
{IV('ρ'), 0xEE, 0}, // rho
{IV('σ'), 0xEF, 0}, // sigma
{IV('τ'), 0xF0, 0}, // tau
{IV('υ'), 0xF1, 0}, // upsilon
{IV('χ'), 0xF2, 0}, // chi
{IV('ψ'), 0xF3, 0}, // psi
{IV('ω'), 0xF4, 0}, // 03C9, omega
{IV('ϊ'), 0xE7, 0}, // 03CA
{IV('ϋ'), 0xF1, 0}, // 03CB
{IV('ύ'), 0xF1, 0}, // 03CD
{IV('ώ'), 0xF4, 0}, // 03CE
{IV('•'), 0xCD, 0}, // ·
{IV('℞'), 0xA7, 0}, // ℞ Pt ASCII 158
{IV('™'), 0xD0, 0},
{IV('↤'), 0xF9, 0}, // ⟻
{IV('↵'), 0xC4, 0},
{IV('↻'), 0x04, 0}, // Marlin special: '↻↺⟳⟲' LCD_STR_REFRESH (0x01)
{IV('⇥'), 0xFB, 0},
{IV('√'), 0xBE, 0}, // √
{IV('∞'), 0xC2, 0}, // infinity
{IV('∫'), 0x1B, 0},
{IV('∼'), 0x1D, 0},
{IV('≈'), 0x1A, 0},
{IV('≠'), 0xBD, 0},
{IV('≡'), 0x11, 0},
{IV('≤'), 0xB9, 0},// ≤≥ ⩽⩾
{IV('≥'), 0xBA, 0},
//{IV(''), 0xBF, 0}, // error
{IV('⌠'), 0xC0, 0},
{IV('⌡'), 0xC1, 0},
{IV('⎧'), 0x14, 0},
{IV('⎩'), 0x15, 0},
{IV('⎫'), 0x16, 0},
{IV('⎭'), 0x17, 0},
{IV('⎰'), 0x18, 0},
{IV('⎱'), 0x19, 0},
{IV('⎲'), 0x12, 0},
{IV('⎳'), 0x13, 0},
{IV('⏱'), 0x07, 0}, // Marlin special: '🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛🕜🕝🕞🕟🕠🕡🕢🕣🕤🕥🕦🕧 ⌚⌛⏰⏱⏳⧖⧗' LCD_STR_CLOCK (0x05)
{IV('┌'), 0xC9, 0},
{IV('┐'), 0xCA, 0},
{IV('└'), 0xCB, 0},
{IV('┘'), 0xCC, 0},
{IV('◸'), 0xC3, 0}, // ◿
{IV('⭠'), 0xC8, 0},
{IV('⭡'), 0xC5, 0},
{IV('⭢'), 0xC7, 0},
{IV('⭣'), 0xC6, 0},
{IV('⯆'), 0xF5, 0},
{IV('⯇'), 0xF7, 0}, // ⯅
{IV('⯈'), 0xF6, 0},
//{IV(''), 0xF8, 0}, // error
//{IV(''), 0xFA, 0}, // error
//{IV(''), 0xFC, 0}, // error
//{IV(''), 0xFD, 0}, // error
//{IV(''), 0xFE, 0}, // error
//{IV(''), 0xFF, 0}, // error
#elif DISPLAY_CHARSET_HD44780 == CYRILLIC
{IV('¢'), 0x5C, 0}, // 00A2
{IV('£'), 0xCF, 0}, // 00A3
{IV('°'), 0x01, 0}, // 00B0, Marlin special: '°' LCD_STR_DEGREE (0x09)
//{IV(''), 0x80, 0},
//{IV(''), 0x81, 0},
//{IV(''), 0x82, 0},
//{IV(''), 0x83, 0},
//{IV(''), 0x84, 0},
//{IV(''), 0x85, 0},
//{IV(''), 0x86, 0},
//{IV(''), 0x87, 0},
//{IV(''), 0x88, 0},
//{IV(''), 0x89, 0},
//{IV(''), 0x8A, 0},
//{IV(''), 0x8B, 0},
//{IV(''), 0x8C, 0},
//{IV(''), 0x8D, 0},
//{IV(''), 0x8E, 0},
//{IV(''), 0x8F, 0},
//{IV(''), 0x90, 0},
//{IV(''), 0x91, 0},
//{IV(''), 0x92, 0},
//{IV(''), 0x93, 0},
//{IV(''), 0x94, 0},
//{IV(''), 0x95, 0},
//{IV(''), 0x96, 0},
//{IV(''), 0x97, 0},
//{IV(''), 0x98, 0},
//{IV(''), 0x99, 0},
//{IV(''), 0x9A, 0},
//{IV(''), 0x9B, 0},
//{IV(''), 0x9C, 0},
//{IV(''), 0x9D, 0},
//{IV(''), 0x9E, 0},
//{IV(''), 0x9F, 0},
{IV('¼'), 0xF0, 0}, // 00BC
{IV('⅓'), 0xF1, 0},
{IV('½'), 0xF2, 0}, // 00BD
{IV('¾'), 0xF3, 0}, // 00BE
{IV('¿'), 0xCD, 0}, // 00BF
#if ENABLED(DISPLAY_CHARSET_ISO10646_5)
// Map Cyrillic to HD44780 extended CYRILLIC where possible
{IV('Ё'), 0xA2, 0}, // 0401
{IV('А'), 'A', 0}, // 0410
{IV('Б'), 0xA0, 0},
{IV('В'), 'B', 0},
{IV('Г'), 0xA1, 0},
{IV('Д'), 0xE0, 0},
{IV('Е'), 'E', 0},
{IV('Ж'), 0xA3, 0},
{IV('З'), 0xA4, 0},
{IV('И'), 0xA5, 0},
{IV('Й'), 0xA6, 0},
{IV('К'), 'K', 0},
{IV('Л'), 0xA7, 0},
{IV('М'), 'M', 0},
{IV('Н'), 'H', 0},
{IV('О'), 'O', 0},
{IV('П'), 0xA8, 0},
{IV('Р'), 'P', 0},
{IV('С'), 'C', 0},
{IV('Т'), 'T', 0},
{IV('У'), 0xA9, 0},
{IV('Ф'), 0xAA, 0},
{IV('Х'), 'X', 0},
{IV('Ц'), 0xE1, 0},
{IV('Ч'), 0xAB, 0},
{IV('Ш'), 0xAC, 0},
{IV('Щ'), 0xE2, 0},
{IV('Ъ'), 0xAD, 0},
{IV('Ы'), 0xAE, 0},
{IV('Ь'), 'b', 0},
{IV('Э'), 0xAF, 0},
{IV('Ю'), 0xB0, 0},
{IV('Я'), 0xB1, 0},
{IV('а'), 'a', 0},
{IV('б'), 0xB2, 0},
{IV('в'), 0xB3, 0},
{IV('г'), 0xB4, 0},
{IV('д'), 0xE3, 0},
{IV('е'), 'e', 0},
{IV('ж'), 0xB6, 0},
{IV('з'), 0xB7, 0},
{IV('и'), 0xB8, 0},
{IV('й'), 0xB9, 0},
{IV('к'), 0xBA, 0}, //клмноп
{IV('л'), 0xBB, 0},
{IV('м'), 0xBC, 0},
{IV('н'), 0xBD, 0},
{IV('о'), 'o', 0},
{IV('п'), 0xBE, 0},
{IV('р'), 'p', 0},
{IV('с'), 'c', 0},
{IV('т'), 0xBF, 0},
{IV('у'), 'y', 0},
{IV('ф'), 0xE4, 0},
{IV('х'), 'x', 0},
{IV('ц'), 0xE5, 0},
{IV('ч'), 0xC0, 0},
{IV('ш'), 0xC1, 0},
{IV('щ'), 0xE6, 0},
{IV('ъ'), 0xC2, 0},
{IV('ы'), 0xC3, 0},
{IV('ь'), 0xC4, 0},
{IV('э'), 0xC5, 0},
{IV('ю'), 0xC6, 0},
{IV('я'), 0xC7, 0}, // 044F
{IV('ё'), 0xB5, 0}, // 0451
//{IV(''), 0xC8, 0},
//{IV(''), 0xC9, 0},
//{IV(''), 0xCA, 0},
//{IV(''), 0xCB, 0},
//{IV(''), 0xCC, 0},
//{IV(''), 0xCD, 0},
//{IV(''), 0xCE, 0},
//{IV(''), 0xD0, 0},
//{IV(''), 0xD1, 0},
//{IV(''), 0xD2, 0},
//{IV(''), 0xD3, 0},
//{IV(''), 0xD4, 0},
//{IV(''), 0xD5, 0},
//{IV(''), 0xD6, 0},
//{IV(''), 0xD7, 0},
//{IV(''), 0xD8, 0},
//{IV(''), 0xDB, 0},
//{IV(''), 0xDC, 0},
//{IV(''), 0xDD, 0},
//{IV(''), 0xDE, 0},
//{IV(''), 0xDF, 0},
//{IV(''), 0xE7, 0},
//{IV(''), 0xE8, 0},
//{IV(''), 0xE9, 0},
//{IV(''), 0xEA, 0},
//{IV(''), 0xEB, 0},
//{IV(''), 0xEC, 0},
//{IV(''), 0xED, 0},
//{IV(''), 0xEE, 0},
//{IV(''), 0xEF, 0},
//{IV(''), 0xF4, 0},
//{IV(''), 0xF5, 0},
//{IV(''), 0xF6, 0},
//{IV(''), 0xF7, 0},
//{IV(''), 0xF8, 0},
//{IV(''), 0xF9, 0},
//{IV(''), 0xFA, 0},
//{IV(''), 0xFB, 0},
//{IV(''), 0xFC, 0},
//{IV(''), 0xFD, 0},
//{IV(''), 0xFE, 0},
//{IV(''), 0xFF, 0},
#endif
{IV('↑'), 0xD9, 0}, // 2191 ←↑→↓
{IV('↓'), 0xDA, 0}, // 2193
#endif
};
// the plain ASCII replacement for various char
static const hd44780_charmap_t g_hd44780_charmap_common[] PROGMEM = {
{IV('¡'), 'i', 0}, // A1
{IV('¢'), 'c', 0}, // A2
{IV('°'), 0x09, 0}, // B0 Marlin special: '°' LCD_STR_DEGREE (0x09)
// Map WESTERN code to plain ASCII
{IV('Á'), 'A', 0}, // C1
{IV('Â'), 'A', 0}, // C2
{IV('Ã'), 'A', 0}, // C3
{IV('Ä'), 'A', 0}, // C4
{IV('Å'), 'A', 0}, // C5
{IV('Æ'), 'A', 'E'}, // C6
{IV('Ç'), 'C', 0}, // C7
{IV('È'), 'E', 0}, // C8
{IV('É'), 'E', 0}, // C9
{IV('Í'), 'I', 0}, // CD
{IV('Ñ'), 'N', 0}, // D1
{IV('Õ'), 'O', 0}, // D5
{IV('Ö'), 'O', 0}, // D6
{IV('×'), 'x', 0}, // D7
{IV('Ü'), 'U', 0}, // DC
{IV('Ý'), 'Y', 0}, // DD
{IV('à'), 'a', 0}, // E0
{IV('á'), 'a', 0},
{IV('â'), 'a', 0},
{IV('ã'), 'a', 0},
{IV('ä'), 'a', 0},
{IV('å'), 'a', 0},
{IV('æ'), 'a', 'e'},
{IV('ç'), 'c', 0},
{IV('è'), 'e', 0}, // 00E8
{IV('é'), 'e', 0},
{IV('ê'), 'e', 0},
{IV('ë'), 'e', 0},
{IV('ì'), 'i', 0}, // 00EC
{IV('í'), 'i', 0},
{IV('î'), 'i', 0},
{IV('ï'), 'i', 0}, // 00EF
{IV('ñ'), 'n', 0}, // 00F1
{IV('ò'), 'o', 0},
{IV('ó'), 'o', 0},
{IV('ô'), 'o', 0},
{IV('õ'), 'o', 0},
{IV('ö'), 'o', 0},
//{IV('÷'), 0xB8, 0},
{IV('ø'), 'o', 0},
{IV('ù'), 'u', 0},
{IV('ú'), 'u', 0},
{IV('û'), 'u', 0},
{IV('ü'), 'u', 0}, // FC
{IV('ý'), 'y', 0}, // FD
{IV('ÿ'), 'y', 0}, // FF
{IV('Ą'), 'A', 0}, // 0104
{IV('ą'), 'a', 0}, // 0105
{IV('Ć'), 'C', 0}, // 0106
{IV('ć'), 'c', 0}, // 0107
{IV('Č'), 'C', 0}, // 010C
{IV('č'), 'c', 0}, // 010D
{IV('Ď'), 'D', 0}, // 010E
{IV('ď'), 'd', 0}, // 010F
{IV('đ'), 'd', 0}, // 0111
{IV('ę'), 'e', 0}, // 0119
{IV('Ě'), 'E', 0}, // 011A
{IV('ě'), 'e', 0}, // 011B
{IV('ğ'), 'g', 0}, // 011F
{IV('İ'), 'I', 0}, // 0130
{IV('ı'), 'i', 0}, // 0131
{IV('Ł'), 'L', 0}, // 0141
{IV('ł'), 'l', 0}, // 0142
{IV('Ń'), 'N', 0}, // 0143
{IV('ń'), 'n', 0}, // 0144
{IV('ň'), 'n', 0}, // 0148
{IV('Ř'), 'R', 0}, // 0158
{IV('ř'), 'r', 0}, // 0159
{IV('Ś'), 'S', 0}, // 015A
{IV('ś'), 's', 0}, // 015B
{IV('ş'), 's', 0}, // 015F
{IV('Š'), 'S', 0}, // 0160
{IV('š'), 's', 0}, // 0161
{IV('ť'), 't', 0}, // 0165
{IV('ů'), 'u', 0}, // 016F
{IV('ż'), 'z', 0}, // 017C
{IV('Ž'), 'Z', 0}, // 017D
{IV('ž'), 'z', 0}, // 017E
{IV('ƒ'), 'f', 0}, // 0192
{IV('ˣ'), 'x', 0}, // 02E3
#if ENABLED(DISPLAY_CHARSET_ISO10646_VI)
// Map Vietnamese phonetics
//{IV('à'), 'a', 0}, {IV('À'), 'A', 0},
{IV('ạ'), 'a', 0}, {IV('Ạ'), 'A', 0},
{IV('ả'), 'a', 0}, {IV('Ả'), 'A', 0},
//{IV('ã'), 'a', 0}, {IV('Ã'), 'A', 0},
//{IV('á'), 'á', 0}, {IV('Á'), 'A', 0},
{IV('Ạ'), 'A', 0},
{IV('ă'), 'a', 0}, {IV('Ă'), 'A', 0},
{IV('ằ'), 'a', 0}, {IV('Ằ'), 'A', 0},
{IV('ẳ'), 'a', 0}, {IV('Ẳ'), 'A', 0},
{IV('ẵ'), 'a', 0}, {IV('Ẵ'), 'A', 0},
{IV('ắ'), 'a', 0}, {IV('Ắ'), 'A', 0},
{IV('ặ'), 'a', 0}, {IV('Ặ'), 'A', 0},
{IV('â'), 'a', 0}, {IV('Â'), 'A', 0},
{IV('ầ'), 'a', 0}, {IV('Ầ'), 'A', 0},
{IV('ẩ'), 'a', 0}, {IV('Ẩ'), 'A', 0},
{IV('ẫ'), 'a', 0}, {IV('Ẫ'), 'A', 0},
{IV('ấ'), 'a', 0}, {IV('Ấ'), 'A', 0},
{IV('ậ'), 'a', 0}, {IV('Ậ'), 'A', 0},
//{IV('đ'), 'd', 0},
{IV('Đ'), 'D', 0},
{IV('e'), 'e', 0}, {IV('E'), 'E', 0},
{IV('è'), 'e', 0}, {IV('È'), 'E', 0},
{IV('ẻ'), 'e', 0}, {IV('Ẻ'), 'E', 0},
{IV('ẽ'), 'e', 0}, {IV('Ẽ'), 'E', 0},
{IV('é'), 'e', 0}, {IV('É'), 'E', 0},
{IV('ẹ'), 'e', 0}, {IV('Ẹ'), 'E', 0},
{IV('ê'), 'e', 0}, {IV('Ê'), 'E', 0},
{IV('ề'), 'e', 0}, {IV('Ề'), 'E', 0},
{IV('ể'), 'e', 0}, {IV('Ể'), 'E', 0},
{IV('ễ'), 'e', 0}, {IV('Ễ'), 'E', 0},
{IV('ế'), 'e', 0}, {IV('Ế'), 'E', 0},
{IV('ệ'), 'e', 0}, {IV('Ệ'), 'E', 0},
{IV('i'), 'i', 0}, {IV('I'), 'I', 0},
//{IV('ì'), 'ì', 0}, {IV('Ì'), 'Ì', 0},
{IV('ỉ'), 'ỉ', 0}, {IV('Ỉ'), 'Ỉ', 0},
{IV('ĩ'), 'ĩ', 0}, {IV('Ĩ'), 'Ĩ', 0},
{IV('í'), 'í', 0}, {IV('Í'), 'Í', 0},
{IV('ị'), 'ị', 0}, {IV('Ị'), 'Ị', 0},
{IV('o'), 'o', 0}, {IV('O'), 'O', 0},
{IV('ò'), 'o', 0}, {IV('Ò'), 'O', 0},
{IV('ỏ'), 'o', 0}, {IV('Ỏ'), 'O', 0},
{IV('õ'), 'o', 0}, {IV('Õ'), 'O', 0},
{IV('ó'), 'o', 0}, {IV('Ó'), 'O', 0},
{IV('ọ'), 'o', 0}, {IV('Ọ'), 'O', 0},
{IV('ô'), 'o', 0}, {IV('Ô'), 'O', 0},
{IV('ồ'), 'o', 0}, {IV('Ồ'), 'O', 0},
{IV('ổ'), 'o', 0}, {IV('Ổ'), 'O', 0},
{IV('ỗ'), 'o', 0}, {IV('Ỗ'), 'O', 0},
{IV('ố'), 'o', 0}, {IV('Ố'), 'O', 0},
{IV('ộ'), 'o', 0}, {IV('Ộ'), 'O', 0},
{IV('ơ'), 'o', 0}, {IV('Ơ'), 'O', 0},
{IV('ờ'), 'o', 0}, {IV('Ờ'), 'O', 0},
{IV('ở'), 'o', 0}, {IV('Ở'), 'O', 0},
{IV('ỡ'), 'o', 0}, {IV('Ỡ'), 'O', 0},
{IV('ớ'), 'o', 0}, {IV('Ớ'), 'O', 0},
{IV('ợ'), 'o', 0}, {IV('Ợ'), 'O', 0},
{IV('ù'), 'u', 0}, {IV('Ù'), 'U', 0},
{IV('ủ'), 'u', 0}, {IV('Ủ'), 'U', 0},
{IV('ũ'), 'u', 0}, {IV('Ũ'), 'U', 0},
//{IV('ú'), 'u', 0}, {IV('Ú'), 'U', 0},
{IV('ụ'), 'u', 0}, {IV('Ụ'), 'U', 0},
{IV('ư'), 'u', 0}, {IV('Ư'), 'U', 0},
{IV('ừ'), 'u', 0}, {IV('Ừ'), 'U', 0},
{IV('ử'), 'u', 0}, {IV('Ử'), 'U', 0},
{IV('ữ'), 'u', 0}, {IV('Ữ'), 'U', 0},
{IV('ứ'), 'u', 0}, {IV('Ứ'), 'U', 0},
{IV('ự'), 'u', 0}, {IV('Ự'), 'U', 0},
{IV('y'), 'y', 0}, {IV('Y'), 'Y', 0},
#endif
#if ENABLED(DISPLAY_CHARSET_ISO10646_GREEK)
{IV('΄'), '\'', 0}, // 0384
{IV('΅'), '\'', 0}, // 0385
{IV('Ά'), 'A', 0}, // 0386
{IV('·'), '.', 0}, // 0387
{IV('Έ'), 'E', 0}, // 0388
{IV('Ή'), 'H', 0}, // 0389
{IV('Ί'), 'I', 0}, // 038A
{IV('Ό'), 'O', 0}, // 038C
{IV('Ύ'), 'Y', 0}, // 038E
{IV('Ώ'), 'O', 0}, // 038F
{IV('ΐ'), 'i', 0}, // 0390
{IV('Α'), 'A', 0}, // 0391
{IV('Β'), 'B', 0}, // 0392
{IV('Γ'), 'T', 0}, // 0393, Gamma
{IV('Δ'), '4', 0}, // 0394, Delta, ◿
{IV('Ε'), 'E', 0}, // 0395
{IV('Ζ'), 'Z', 0}, // 0396
{IV('Η'), 'H', 0}, // 0397
{IV('Θ'), '0', 0}, // 0398, Theta
{IV('Ι'), 'I', 0}, // 0399
{IV('Κ'), 'K', 0}, // 039A
{IV('Λ'), '^', 0}, // 039B, Lambda
{IV('Μ'), 'M', 0}, // 039C
{IV('Ν'), 'N', 0}, // 039D
{IV('Ξ'), '3', 0}, // 039E, Xi
{IV('Ο'), 'O', 0}, // 039F
{IV('Π'), 'n', 0}, // 03A0, Pi
{IV('Ρ'), 'P', 0}, // 03A1
{IV('Σ'), 'E', 0}, // 03A3, Sigma
{IV('Τ'), 'T', 0}, // 03A4
{IV('Υ'), 'Y', 0}, // 03A5, Upsilon
{IV('Φ'), 'p', 0}, // 03A6, Phi
{IV('Χ'), 'X', 0}, // 03A7
{IV('Ψ'), 'P', 0}, // 03A8, Psi
{IV('Ω'), 'O', 0}, // 03A9, Omega
{IV('Ϊ'), 'I', 0}, // 03AA
{IV('Ϋ'), 'Y', 0}, // 03AB
{IV('ά'), 'a', 0}, // 03AC
{IV('έ'), 'e', 0}, // 03AD
{IV('ή'), 'n', 0}, // 03AE
{IV('ί'), 'i', 0}, // 03AF
{IV('ΰ'), 'v', 0}, // 03B0
{IV('α'), 'a', 0}, // 03B1, alpha
{IV('β'), 'B', 0}, // 03B2, beta
{IV('γ'), 'v', 0}, // 03B3, gamma
{IV('δ'), 'd', 0}, // 03B4, delta
{IV('ε'), 'e', 0}, // 03B5, epsilon
{IV('ζ'), 'Z', 0}, // 03B6, zeta
{IV('η'), 'n', 0}, // 03B7, eta
{IV('θ'), '0', 0}, // 03B8, theta
{IV('ι'), 'i', 0}, // 03B9, lota
{IV('κ'), 'k', 0}, // 03BA, kappa
{IV('λ'), 'L', 0}, // 03BB, lambda
{IV('μ'), 'u', 0}, // 03BC, mu
{IV('ν'), 'v', 0}, // 03BD, nu
{IV('ξ'), 'e', 0}, // 03BE, xi
{IV('ο'), 'o', 0}, // 03BF
{IV('π'), 'n', 0}, // 03C0, pi
{IV('ρ'), 'p', 0}, // 03C1, rho
{IV('ς'), 'c', 0}, // 03C2
{IV('σ'), 'o', 0}, // 03C3, sigma
{IV('τ'), 't', 0}, // 03C4, tau
{IV('υ'), 'v', 0}, // 03C5, upsilon
{IV('φ'), 'p', 0}, // 03C6
{IV('χ'), 'X', 0}, // 03C7, chi
{IV('ψ'), 'W', 0}, // 03C8, psi
{IV('ω'), 'w', 0}, // 03C9, omega
{IV('ϊ'), 'i', 0}, // 03CA
{IV('ϋ'), 'v', 0}, // 03CB
{IV('ό'), 'o', 0}, // 03CC
{IV('ύ'), 'v', 0}, // 03CD
{IV('ώ'), 'w', 0}, // 03CE
#endif
#if ENABLED(DISPLAY_CHARSET_ISO10646_5)
// Map CYRILLIC code to plain ASCII
{IV('Ё'), 'E', 0}, // 0401
{IV('А'), 'A', 0}, // 0410
{IV('Б'), 'b', 0}, // 0411
{IV('В'), 'B', 0}, // 0412
{IV('Г'), 'T', 0}, // 0413
{IV('Д'), 'Q', 0}, // 0414
{IV('Е'), 'E', 0}, // 0415
{IV('Ж'), '*', 0}, // 0416
{IV('З'), 'E', 0}, // 0417
{IV('И'), 'N', 0}, // 0418
{IV('Й'), 'N', 0}, // 0419
{IV('К'), 'K', 0}, // 041A
{IV('Л'), 'T', 0}, // 041B
{IV('М'), 'M', 0}, // 041C
{IV('Н'), 'H', 0}, // 041D
{IV('О'), 'O', 0}, // 041E
{IV('П'), 'n', 0}, // 041F
{IV('Р'), 'P', 0}, // 0420
{IV('С'), 'C', 0}, // 0421
{IV('Т'), 'T', 0}, // 0422
{IV('У'), 'Y', 0},
{IV('Ф'), 'o', 0},
{IV('Х'), 'X', 0},
{IV('Ц'), 'U', 0},
{IV('Ч'), 'y', 0},
{IV('Ш'), 'W', 0},
{IV('Щ'), 'W', 0},
{IV('Ъ'), 'b', 0},
{IV('Ы'), 'b', '|'},
{IV('Ь'), 'b'},
{IV('Э'), 'e'},
{IV('Ю'), '|', 'O'},
{IV('Я'), '9', '|'}, // 042F
{IV('а'), 'a', 0}, // 0430
{IV('б'), '6', 0}, // 0431
{IV('в'), 'B', 0}, // 0432,
{IV('г'), 'r', 0}, // 0433
{IV('д'), 'a', 0}, // 0434,
{IV('е'), 'e', 0}, // 0435
{IV('ж'), '*', 0}, // 0436
{IV('з'), 'e', 0}, // 0437,
{IV('и'), 'u', 0}, // 0438
{IV('й'), 'u', 0}, // 0439,
{IV('к'), 'k', 0}, // 043A
{IV('л'), 'n', 0},
{IV('м'), 'm', 0},
{IV('н'), 'H', 0},
{IV('о'), 'o', 0},
{IV('п'), 'n', 0},
{IV('р'), 'p', 0},
{IV('с'), 'c', 0},
{IV('т'), 't', 0},
{IV('у'), 'y', 0},
{IV('ф'), 'q', 'p'},
{IV('х'), 'x', 0},
{IV('ц'), 'u', 0},
{IV('ч'), 'y', 0},
{IV('ш'), 'w', 0},
{IV('щ'), 'w', 0},
{IV('ъ'), 'b', 0},
{IV('ы'), 'b', '|'},
{IV('ь'), 'b', 0},
{IV('э'), 'e', 0},
{IV('ю'), '|', 'o'},
{IV('я'), 'g', 0}, // 044F
{IV('ё'), 'e', 0}, // 0451
#endif
{IV('•'), '.', 0}, // 2022 ·
{IV('℞'), 'P', 'x'}, // 211E ℞ Pt ASCII 158
{IV('™'), 'T', 'M'}, // 2122
{IV('←'), '<', '-'}, // 2190
{IV('→'), '-', '>'}, // 2192, Marlin special: '⮈⮉⮊⮋➤→⏵➟➠➡' LCD_STR_ARROW_RIGHT (0x03)
//{IV('↰'), '<', 0}, // 21B0, Marlin special: '⮥⮭⮉⇧↑↰⤴' LCD_STR_UPLEVEL (0x04)
{IV('↰'), 0x03, 0}, // 21B0, Marlin special: '⮥⮭⮉⇧↑↰⤴' LCD_STR_UPLEVEL (0x04)
{IV('↻'), 0x04, 0}, // 21BB Marlin special: '↻↺⟳⟲' LCD_STR_REFRESH (0x01)
{IV('∼'), '~', 0}, // 223C
{IV('≈'), '~', '='}, // 2248
{IV('≠'), '!', '='}, // 2260
{IV('≡'), '=', 0}, // 2261
{IV('≤'), '<', '='},// 2264, ≤≥ ⩽⩾
{IV('≥'), '>', '='}, // 2265
{IV('⏱'), 0x07, 0}, // 23F1, Marlin special: '🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛🕜🕝🕞🕟🕠🕡🕢🕣🕤🕥🕦🕧 ⌚⌛⏰⏱⏳⧖⧗' LCD_STR_CLOCK (0x05)
{IV('゠'), '=', 0}, // 30A0
// ⏰⏱⏲⏳◴◵◶◷
// ⏻⏼♁♂
//{IV(''), 0x00, 0}, // Marlin special: '' LCD_STR_BEDTEMP (0x07)
{IV('🌡'), 0x02, 0}, // D83CDF21 Marlin special: '🌡' LCD_STR_THERMOMETER (0x08)
{IV('📂'), 0x05, 0}, // D83DDCC2 Marlin special: '📁📂' LCD_STR_FOLDER (0x02)
//{IV(''), 0x06, 0}, // Marlin special: '' LCD_STR_FEEDRATE (0x06)
};
/* return v1 - v2 */
static int hd44780_charmap_compare(hd44780_charmap_t * v1, hd44780_charmap_t * v2) {
return (v1->uchar < v2->uchar) ? -1 : (v1->uchar > v2->uchar) ? 1 : 0;
}
static int pf_bsearch_cb_comp_hd4map_pgm(void *userdata, size_t idx, void * data_pin) {
hd44780_charmap_t localval;
hd44780_charmap_t *p_hd44780_charmap = (hd44780_charmap_t *)userdata;
memcpy_P(&localval, p_hd44780_charmap + idx, sizeof(localval));
return hd44780_charmap_compare(&localval, (hd44780_charmap_t *)data_pin);
}
void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row) { lcd.setCursor(col, row); }
void lcd_put_int(const int i) { lcd.print(i); }
// return < 0 on error
// return the advanced cols
int lcd_put_lchar_max(const lchar_t &c, const pixel_len_t max_length) {
// find the HD44780 internal ROM first
int ret;
size_t idx = 0;
hd44780_charmap_t pinval;
hd44780_charmap_t *copy_address = nullptr;
pinval.uchar = c;
pinval.idx = -1;
if (max_length < 1) return 0;
// TODO: fix the '\\' that doesn't exist in the HD44870
if (c < 128) {
lcd.write((uint8_t)c);
return 1;
}
copy_address = nullptr;
ret = pf_bsearch_r((void *)g_hd44780_charmap_device, COUNT(g_hd44780_charmap_device), pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx);
if (ret >= 0) {
copy_address = (hd44780_charmap_t *)(g_hd44780_charmap_device + idx);
}
else {
ret = pf_bsearch_r((void *)g_hd44780_charmap_common, COUNT(g_hd44780_charmap_common), pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx);
if (ret >= 0) copy_address = (hd44780_charmap_t *)(g_hd44780_charmap_common + idx);
}
if (ret >= 0) {
hd44780_charmap_t localval;
// found
memcpy_P(&localval, copy_address, sizeof(localval));
lcd.write(localval.idx);
if (max_length >= 2 && localval.idx2 > 0) {
lcd.write(localval.idx2);
return 2;
}
return 1;
}
// Not found, print '?' instead
lcd.write((uint8_t)'?');
return 1;
}
/**
* @brief Draw a UTF-8 string
*
* @param utf8_str : the UTF-8 string
* @param cb_read_byte : the callback function to read one byte from the utf8_str (from RAM or ROM)
* @param max_length : the pixel length of the string allowed (or number of slots in HD44780)
*
* @return the number of characters emitted
*
* Draw a UTF-8 string
*/
static int lcd_put_u8str_max_cb(const char * utf8_str, read_byte_cb_t cb_read_byte, const pixel_len_t max_length) {
pixel_len_t ret = 0;
const uint8_t *p = (uint8_t *)utf8_str;
while (ret < max_length) {
lchar_t wc;
p = get_utf8_value_cb(p, cb_read_byte, wc);
if (!wc) break;
ret += lcd_put_lchar_max(wc, max_length - ret);
}
return (int)ret;
}
int lcd_put_u8str_max(const char * utf8_str, const pixel_len_t max_length) {
return lcd_put_u8str_max_cb(utf8_str, read_byte_ram, max_length);
}
int lcd_put_u8str_max_P(PGM_P utf8_pstr, const pixel_len_t max_length) {
return lcd_put_u8str_max_cb(utf8_pstr, read_byte_rom, max_length);
}
#if ENABLED(DEBUG_LCDPRINT)
int test_hd44780_charmap(hd44780_charmap_t *data, size_t size, char *name, char flg_show_contents) {
int ret;
size_t idx = 0;
hd44780_charmap_t preval = {0, 0, 0};
hd44780_charmap_t pinval = {0, 0, 0};
char flg_error = 0;
int i;
TRACE("Test %s\n", name);
for (i = 0; i < size; i ++) {
memcpy_P(&pinval, &(data[i]), sizeof(pinval));
if (flg_show_contents) {
#if 1
TRACE("[% 4d] % 6" PRIu32 "(0x%04" PRIX32 ") --> 0x%02X,0x%02X%s\n", i, pinval.uchar, pinval.uchar, (unsigned int)(pinval.idx), (unsigned int)(pinval.idx2), (preval.uchar < pinval.uchar?"":" <--- ERROR"));
#else
TRACE("[% 4d]", i);
TRACE("% 6" PRIu32 "(0x%04" PRIX32 "),", pinval.uchar, pinval.uchar);
TRACE("0x%02X,", (unsigned int)(pinval.idx));
TRACE("0x%02X,", (unsigned int)(pinval.idx2));
TRACE("%s", (preval.uchar < pinval.uchar?"":" <--- ERROR"));
#endif
}
if (preval.uchar >= pinval.uchar) {
flg_error = 1;
//TRACE("Error: out of order in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar);
//return -1;
}
memcpy(&preval, &pinval, sizeof(pinval));
ret = pf_bsearch_r((void *)data, size, pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx);
if (ret < 0) {
flg_error = 1;
TRACE("Error: not found item in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar);
//return -1;
}
if (idx != i) {
flg_error = 1;
TRACE("Error: wrong index found item in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar);
//return -1;
}
}
if (flg_error) {
TRACE("\nError: in array %s\n\n", name);
return -1;
}
TRACE("\nPASS array %s\n\n", name);
return 0;
}
int test_hd44780_charmap_all() {
int flg_error = 0;
if (test_hd44780_charmap(g_hd44780_charmap_device, COUNT(g_hd44780_charmap_device), "g_hd44780_charmap_device", 0) < 0) {
flg_error = 1;
test_hd44780_charmap(g_hd44780_charmap_device, COUNT(g_hd44780_charmap_device), "g_hd44780_charmap_device", 1);
}
if (test_hd44780_charmap(g_hd44780_charmap_common, COUNT(g_hd44780_charmap_common), "g_hd44780_charmap_common", 0) < 0) {
flg_error = 1;
test_hd44780_charmap(g_hd44780_charmap_common, COUNT(g_hd44780_charmap_common), "g_hd44780_charmap_common", 1);
}
if (flg_error) {
TRACE("\nFAILED in hd44780 tests!\n");
return -1;
}
TRACE("\nPASS in hd44780 tests.\n");
return 0;
}
#endif // DEBUG_LCDPRINT
#endif // HAS_MARLINUI_HD44780
|
2301_81045437/Marlin
|
Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp
|
C++
|
agpl-3.0
| 34,764
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfigPre.h"
#if HAS_MARLINUI_HD44780
/**
* marlinui_HD44780.cpp
*
* LCD display implementations for Hitachi HD44780.
* These are the most common LCD character displays.
*/
#include "marlinui_HD44780.h"
#include "../marlinui.h"
#include "../../libs/numtostr.h"
#include "../../sd/cardreader.h"
#include "../../module/temperature.h"
#include "../../module/printcounter.h"
#include "../../module/planner.h"
#include "../../module/motion.h"
#if DISABLED(LCD_PROGRESS_BAR) && ALL(FILAMENT_LCD_DISPLAY, HAS_MEDIA)
#include "../../feature/filwidth.h"
#include "../../gcode/parser.h"
#endif
#if ANY(HAS_COOLER, LASER_COOLANT_FLOW_METER)
#include "../../feature/cooler.h"
#endif
#if ENABLED(I2C_AMMETER)
#include "../../feature/ammeter.h"
#endif
#if ENABLED(AUTO_BED_LEVELING_UBL)
#include "../../feature/bedlevel/bedlevel.h"
#endif
#if HAS_CUTTER
#include "../../feature/spindle_laser.h"
#endif
//
// Create LCD instance and chipset-specific information
//
#if ENABLED(LCD_I2C_TYPE_PCF8575)
LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_I2C_PIN_EN, LCD_I2C_PIN_RW, LCD_I2C_PIN_RS, LCD_I2C_PIN_D4, LCD_I2C_PIN_D5, LCD_I2C_PIN_D6, LCD_I2C_PIN_D7);
#elif ANY(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008)
LCD_CLASS lcd(LCD_I2C_ADDRESS OPTARG(DETECT_I2C_LCD_DEVICE, 1));
#elif ENABLED(LCD_I2C_TYPE_PCA8574)
LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT);
#elif ENABLED(SR_LCD_2W_NL)
// 2 wire Non-latching LCD SR from:
// https://github.com/fmalpartida/New-LiquidCrystal/wiki/schematics#user-content-ShiftRegister_connection
LCD_CLASS lcd(SR_DATA_PIN, SR_CLK_PIN
#if PIN_EXISTS(SR_STROBE)
, SR_STROBE_PIN
#endif
);
#elif ENABLED(SR_LCD_3W_NL)
// NewLiquidCrystal was not working
// https://github.com/mikeshub/SailfishLCD
// uses the code directly from Sailfish
LCD_CLASS lcd(SR_STROBE_PIN, SR_DATA_PIN, SR_CLK_PIN);
#elif ENABLED(LCM1602)
LCD_CLASS lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
#elif ENABLED(YHCB2004)
#ifndef YHCB2004_SS_PIN
#define YHCB2004_SS_PIN SS
#endif
#ifndef YHCB2004_SCK_PIN
#define YHCB2004_SCK_PIN SCK
#endif
#ifndef YHCB2004_MOSI_PIN
#define YHCB2004_MOSI_PIN MOSI
#endif
#ifndef YHCB2004_MISO_PIN
#define YHCB2004_MISO_PIN MISO
#endif
#if !PINS_EXIST(YHCB2004_SS, YHCB2004_SCK, YHCB2004_MOSI, YHCB2004_MISO)
#error "YHCB2004 display requires YHCB2004_SS_PIN, YHCB2004_SCK_PIN, YHCB2004_MOSI_PIN, and YHCB2004_MISO_PIN."
#endif
LCD_CLASS lcd(YHCB2004_SS_PIN, 20, 4, YHCB2004_SCK_PIN, YHCB2004_MOSI_PIN, YHCB2004_MISO_PIN); // SS, cols, rows, SCK, MOSI, MISO
#else
// Standard direct-connected LCD implementations
LCD_CLASS lcd(LCD_PINS_RS, LCD_PINS_EN, LCD_PINS_D4, LCD_PINS_D5, LCD_PINS_D6, LCD_PINS_D7);
#endif
static void createChar_P(const char c, const byte * const ptr) {
byte temp[8];
for (uint8_t i = 0; i < 8; ++i)
temp[i] = pgm_read_byte(&ptr[i]);
lcd.createChar(c, temp);
}
#if ENABLED(LCD_PROGRESS_BAR)
#define LCD_STR_PROGRESS "\x03\x04\x05"
#endif
#if ENABLED(LCD_USE_I2C_BUZZER)
void MarlinUI::buzz(const long duration, const uint16_t freq/*=0*/) {
if (sound_on) lcd.buzz(duration, freq);
}
#endif
void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARSET_INFO*/) {
#if NONE(LCD_PROGRESS_BAR, SHOW_BOOTSCREEN)
UNUSED(screen_charset);
#endif
// CHARSET_BOOT
#if ENABLED(SHOW_BOOTSCREEN)
const static PROGMEM byte corner[4][8] = { {
B00000,
B00000,
B00000,
B00000,
B00001,
B00010,
B00100,
B00100
}, {
B00000,
B00000,
B00000,
B11100,
B11100,
B01100,
B00100,
B00100
}, {
B00100,
B00010,
B00001,
B00000,
B00000,
B00000,
B00000,
B00000
}, {
B00100,
B01000,
B10000,
B00000,
B00000,
B00000,
B00000,
B00000
} };
#endif // SHOW_BOOTSCREEN
// CHARSET_INFO
const static PROGMEM byte bedTemp[8] = {
B00000,
B11111,
B10101,
B10001,
B10101,
B11111,
B00000,
B00000
};
const static PROGMEM byte degree[8] = {
B01100,
B10010,
B10010,
B01100,
B00000,
B00000,
B00000,
B00000
};
const static PROGMEM byte thermometer[8] = {
B00100,
B01010,
B01010,
B01010,
B01010,
B10001,
B10001,
B01110
};
const static PROGMEM byte uplevel[8] = {
B00100,
B01110,
B11111,
B00100,
B11100,
B00000,
B00000,
B00000
};
const static PROGMEM byte feedrate[8] = {
#if LCD_INFO_SCREEN_STYLE == 1
B00000,
B00100,
B10010,
B01001,
B10010,
B00100,
B00000,
B00000
#else
B11100,
B10000,
B11000,
B10111,
B00101,
B00110,
B00101,
B00000
#endif
};
const static PROGMEM byte clock[8] = {
B00000,
B01110,
B10011,
B10101,
B10001,
B01110,
B00000,
B00000
};
#if ENABLED(LCD_PROGRESS_BAR)
// CHARSET_INFO
const static PROGMEM byte progress[3][8] = { {
B00000,
B10000,
B10000,
B10000,
B10000,
B10000,
B10000,
B00000
}, {
B00000,
B10100,
B10100,
B10100,
B10100,
B10100,
B10100,
B00000
}, {
B00000,
B10101,
B10101,
B10101,
B10101,
B10101,
B10101,
B00000
} };
#endif // LCD_PROGRESS_BAR
#if ALL(HAS_MEDIA, HAS_MARLINUI_MENU)
// CHARSET_MENU
const static PROGMEM byte refresh[8] = {
B00000,
B00110,
B11001,
B11000,
B00011,
B10011,
B01100,
B00000,
};
const static PROGMEM byte folder[8] = {
B00000,
B11100,
B11111,
B10001,
B10001,
B11111,
B00000,
B00000
};
#endif // HAS_MEDIA
#if ENABLED(SHOW_BOOTSCREEN)
// Set boot screen corner characters
if (screen_charset == CHARSET_BOOT) {
for (uint8_t i = 4; i--;)
createChar_P(i, corner[i]);
}
else
#endif
{ // Info Screen uses 5 special characters
createChar_P(LCD_STR_BEDTEMP[0], bedTemp);
createChar_P(LCD_STR_DEGREE[0], degree);
createChar_P(LCD_STR_THERMOMETER[0], thermometer);
createChar_P(LCD_STR_FEEDRATE[0], feedrate);
createChar_P(LCD_STR_CLOCK[0], clock);
#if ENABLED(LCD_PROGRESS_BAR)
if (screen_charset == CHARSET_INFO) { // 3 Progress bar characters for info screen
for (int16_t i = 3; i--;)
createChar_P(LCD_STR_PROGRESS[i], progress[i]);
}
else
#endif
{
createChar_P(LCD_STR_UPLEVEL[0], uplevel);
#if ALL(HAS_MEDIA, HAS_MARLINUI_MENU)
// SD Card sub-menu special characters
createChar_P(LCD_STR_REFRESH[0], refresh);
createChar_P(LCD_STR_FOLDER[0], folder);
#endif
}
}
}
void MarlinUI::init_lcd() {
#if ENABLED(LCD_I2C_TYPE_PCF8575)
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#ifdef LCD_I2C_PIN_BL
lcd.setBacklightPin(LCD_I2C_PIN_BL, POSITIVE);
lcd.setBacklight(HIGH);
#endif
#elif ENABLED(LCD_I2C_TYPE_MCP23017)
lcd.setMCPType(LTI_TYPE_MCP23017);
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
update_indicators();
#elif ENABLED(LCD_I2C_TYPE_MCP23008)
lcd.setMCPType(LTI_TYPE_MCP23008);
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#elif ENABLED(LCD_I2C_TYPE_PCA8574)
lcd.init();
lcd.backlight();
#else
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#endif
set_custom_characters(on_status_screen() ? CHARSET_INFO : CHARSET_MENU);
lcd.clear();
}
bool MarlinUI::detected() {
return TERN1(DETECT_I2C_LCD_DEVICE, lcd.LcdDetected() == 1);
}
#if HAS_SLOW_BUTTONS
uint8_t MarlinUI::read_slow_buttons() {
#if ENABLED(LCD_I2C_TYPE_MCP23017)
// Reading these buttons is too slow for interrupt context
// so they are read during LCD update in the main loop.
uint8_t slow_bits = lcd.readButtons()
#if !BUTTON_EXISTS(ENC)
<< B_I2C_BTN_OFFSET
#endif
;
#if ENABLED(LCD_I2C_VIKI)
if ((slow_bits & (B_MI | B_RI)) && PENDING(millis(), next_button_update_ms)) // LCD clicked
slow_bits &= ~(B_MI | B_RI); // Disable LCD clicked buttons if screen is updated
#endif
return slow_bits;
#endif // LCD_I2C_TYPE_MCP23017
}
#endif
void MarlinUI::clear_lcd() { lcd.clear(); }
#if ENABLED(SHOW_BOOTSCREEN)
void lcd_erase_line(const lcd_uint_t line) {
lcd_moveto(0, line);
for (uint8_t i = LCD_WIDTH + 1; --i;)
lcd_put_u8str(F(" "));
}
// Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line
void lcd_scroll(const lcd_uint_t col, const lcd_uint_t line, FSTR_P const ftxt, const uint8_t len, const int16_t time) {
uint8_t slen = utf8_strlen(ftxt);
if (slen < len) {
lcd_put_u8str_max(col, line, ftxt, len);
for (; slen < len; ++slen) lcd_put_u8str(F(" "));
safe_delay(time);
}
else {
PGM_P p = FTOP(ftxt);
int dly = time / _MAX(slen, 1);
for (uint8_t i = 0; i <= slen; ++i) {
// Print the text at the correct place
lcd_put_u8str_max_P(col, line, p, len);
// Fill with spaces
for (uint8_t ix = slen - i; ix < len; ++ix) lcd_put_u8str(F(" "));
// Delay
safe_delay(dly);
// Advance to the next UTF8 valid position
p++;
while (!START_OF_UTF8_CHAR(pgm_read_byte(p))) p++;
}
}
}
static void logo_lines(FSTR_P const extra) {
int16_t indent = (LCD_WIDTH - 8 - utf8_strlen(extra)) / 2;
lcd_put_lchar(indent, 0, '\x00'); lcd_put_u8str(F( "------" )); lcd_put_u8str(F("\x01"));
lcd_put_u8str(indent, 1, F("|Marlin|")); lcd_put_u8str(extra);
lcd_put_lchar(indent, 2, '\x02'); lcd_put_u8str(F( "------" )); lcd_put_u8str(F("\x03"));
}
void MarlinUI::show_bootscreen() {
set_custom_characters(CHARSET_BOOT);
lcd.clear();
#define LCD_EXTRA_SPACE (LCD_WIDTH-8)
#define CENTER_OR_SCROLL(STRING,DELAY) { \
lcd_erase_line(3); \
const int len = utf8_strlen(STRING); \
if (len <= LCD_WIDTH) { \
lcd_put_u8str((LCD_WIDTH - len) / 2, 3, F(STRING)); \
safe_delay(DELAY); \
} \
else \
lcd_scroll(0, 3, F(STRING), LCD_WIDTH, DELAY); \
}
//
// Show the Marlin logo with splash line 1
//
if (LCD_EXTRA_SPACE >= utf8_strlen(SHORT_BUILD_VERSION) + 1) {
//
// Show the Marlin logo, splash line1, and splash line 2
//
logo_lines(F(" " SHORT_BUILD_VERSION));
CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 2000);
}
else {
//
// Show the Marlin logo and short build version
// After a delay show the website URL
//
logo_lines(FPSTR(NUL_STR));
CENTER_OR_SCROLL(SHORT_BUILD_VERSION, 1500);
CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 1500);
#ifdef STRING_SPLASH_LINE3
CENTER_OR_SCROLL(STRING_SPLASH_LINE3, 1500);
#endif
}
}
void MarlinUI::bootscreen_completion(const millis_t) {
lcd.clear();
safe_delay(100);
set_custom_characters(CHARSET_INFO);
lcd.clear();
}
#endif // SHOW_BOOTSCREEN
void MarlinUI::draw_kill_screen() {
lcd_uint_t x = 0, y = 0;
lcd_put_u8str(x, y, status_message);
y = 2;
#if LCD_HEIGHT >= 4
lcd_put_u8str(x, y++, GET_TEXT_F(MSG_HALTED));
#endif
lcd_put_u8str(x, y, GET_TEXT_F(MSG_PLEASE_RESET));
}
//
// Before homing, blink '123' <-> '???'.
// Homed but unknown... '123' <-> ' '.
// Homed and known, display constantly.
//
FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink) {
lcd_put_lchar('X' + uint8_t(axis));
if (blink)
lcd_put_u8str(value);
else if (axis_should_home(axis))
while (const char c = *value++) lcd_put_lchar(c <= '.' ? c : '?');
else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !axis_is_trusted(axis))
lcd_put_u8str(TERN0(HAS_Z_AXIS, axis == Z_AXIS) ? F(" ") : F(" "));
else
lcd_put_u8str(value);
}
/**
* @brief Draw current and target for a heater/cooler
* @details Print at the current LCD position the current/target for a single heater,
* blinking the target temperature of an idle heater has timed out.
*
* @param heater_id The heater ID, such as 0, 1, ..., H_BED, H_CHAMBER, etc.
* @param prefix A char to draw in front (e.g., a thermometer or icon)
* @param blink Flag to show the blink state instead of the regular state
*/
FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char prefix, const bool blink) {
#if HAS_HEATED_BED
const bool isBed = heater_id == H_BED;
const celsius_t t1 = (isBed ? thermalManager.wholeDegBed() : thermalManager.wholeDegHotend(heater_id)),
t2 = (isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater_id));
#else
const celsius_t t1 = thermalManager.wholeDegHotend(heater_id), t2 = thermalManager.degTargetHotend(heater_id);
#endif
if (prefix >= 0) lcd_put_lchar(prefix);
if (t1 >= 0)
lcd_put_u8str(ui16tostr3rj(t1));
else {
#if ENABLED(SHOW_TEMPERATURE_BELOW_ZERO)
char * const str = i16tostr3rj(t1);
lcd_put_u8str(&str[1]);
#else
lcd_put_u8str(F("err"));
#endif
}
lcd_put_u8str(F("/"));
#if !HEATER_IDLE_HANDLER
UNUSED(blink);
#else
if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out)
lcd_put_u8str(F(" "));
else
#endif
lcd_put_u8str(i16tostr3left(t2));
if (prefix >= 0) {
lcd_put_lchar(LCD_STR_DEGREE[0]);
lcd_put_u8str(F(" "));
if (t2 < 10) lcd_put_u8str(F(" "));
}
}
#if HAS_COOLER
FORCE_INLINE void _draw_cooler_status(const char prefix, const bool blink) {
const celsius_t t2 = thermalManager.degTargetCooler();
if (prefix >= 0) lcd_put_lchar(prefix);
lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegCooler()));
lcd_put_u8str(F("/"));
#if !HEATER_IDLE_HANDLER
UNUSED(blink);
#else
if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out) {
lcd_put_u8str(F(" "));
if (t2 >= 10) lcd_put_u8str(F(" "));
if (t2 >= 100) lcd_put_u8str(F(" "));
}
else
#endif
lcd_put_u8str(i16tostr3left(t2));
if (prefix >= 0) {
lcd_put_lchar(LCD_STR_DEGREE[0]);
lcd_put_u8str(F(" "));
if (t2 < 10) lcd_put_u8str(F(" "));
}
}
#endif // HAS_COOLER
#if ENABLED(LASER_COOLANT_FLOW_METER)
FORCE_INLINE void _draw_flowmeter_status() {
lcd_put_u8str(F("~"));
lcd_put_u8str(ftostr11ns(cooler.flowrate));
lcd_put_u8str(F("L"));
}
#endif
#if ENABLED(I2C_AMMETER)
FORCE_INLINE void _draw_ammeter_status() {
lcd_put_u8str(F(" "));
ammeter.read();
if (ammeter.current <= 0.999f) {
lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f)));
lcd_put_u8str(F("mA"));
}
else {
lcd_put_u8str(ftostr12ns(ammeter.current));
lcd_put_u8str(F("A"));
}
}
#endif
FORCE_INLINE void _draw_bed_status(const bool blink) {
_draw_heater_status(H_BED, TERN0(HAS_LEVELING, blink && planner.leveling_active) ? '_' : LCD_STR_BEDTEMP[0], blink);
}
#if HAS_CUTTER
FORCE_INLINE void _draw_cutter_status() {
lcd_put_u8str(TERN(LASER_FEATURE, GET_TEXT_F(MSG_LASER), GET_TEXT_F(MSG_CUTTER)));
lcd_put_u8str(F(": "));
#if CUTTER_UNIT_IS(RPM)
lcd_put_u8str(ftostr61rj(float(cutter.unitPower) / 1000));
lcd_put_u8str(F("K"));
#else
lcd_put_u8str(cutter_power2str(cutter.unitPower));
#if CUTTER_UNIT_IS(PERCENT)
lcd_put_u8str(F("%"));
#endif
#endif
lcd_put_u8str(F(" "));
lcd_put_u8str(cutter.enabled() ? GET_TEXT_F(MSG_LCD_ON) : GET_TEXT_F(MSG_LCD_OFF));
lcd_put_u8str(F(" "));
switch (cutter.cutter_mode) {
case CUTTER_MODE_STANDARD: lcd_put_u8str(F("S")); break;
case CUTTER_MODE_CONTINUOUS: lcd_put_u8str(F("C")); break;
case CUTTER_MODE_DYNAMIC: lcd_put_u8str(F("D")); break;
case CUTTER_MODE_ERROR: lcd_put_u8str(F("!")); break;
}
}
#endif // HAS_CUTTER
#if ENABLED(LCD_PROGRESS_BAR)
void MarlinUI::draw_progress_bar(const uint8_t percent) {
const int16_t tix = int16_t(percent * (LCD_WIDTH) * 3) / 100,
cel = tix / 3,
rem = tix % 3;
uint8_t i = LCD_WIDTH;
char msg[LCD_WIDTH + 1], b = ' ';
msg[LCD_WIDTH] = '\0';
while (i--) {
if (i == cel - 1)
b = LCD_STR_PROGRESS[2];
else if (i == cel && rem != 0)
b = LCD_STR_PROGRESS[rem - 1];
msg[i] = b;
}
lcd_put_u8str(msg);
}
#endif // LCD_PROGRESS_BAR
void MarlinUI::draw_status_message(const bool blink) {
lcd_moveto(0, LCD_HEIGHT - 1);
#if ENABLED(LCD_PROGRESS_BAR)
// Draw the progress bar if the message has shown long enough
// or if there is no message set.
if (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !has_status()) {
const uint8_t progress = get_progress_percent();
if (progress > 2) return draw_progress_bar(progress);
}
#elif ALL(FILAMENT_LCD_DISPLAY, HAS_MEDIA)
// Alternate Status message and Filament display
if (ELAPSED(millis(), next_filament_display)) {
lcd_put_u8str(F("Dia "));
lcd_put_u8str(ftostr12ns(filwidth.measured_mm));
lcd_put_u8str(F(" V"));
lcd_put_u8str(i16tostr3rj(planner.volumetric_percent(parser.volumetric_enabled)));
lcd_put_u8str(F("%"));
return;
}
#endif // FILAMENT_LCD_DISPLAY && HAS_MEDIA
#if ENABLED(STATUS_MESSAGE_SCROLLING)
static bool last_blink = false;
// Get the UTF8 character count of the string
uint8_t slen = status_message.glyphs();
// If the string fits into the LCD, just print it and do not scroll it
if (slen <= LCD_WIDTH) {
// The string isn't scrolling and may not fill the screen
lcd_put_u8str(status_message);
// Fill the rest with spaces
while (slen < LCD_WIDTH) { lcd_put_u8str(F(" ")); ++slen; }
}
else {
// String is larger than the available space in screen.
// Get a pointer to the next valid UTF8 character
// and the string remaining length
uint8_t rlen;
const char *stat = status_and_len(rlen);
lcd_put_u8str_max(stat, LCD_WIDTH); // The string leaves space
// If the remaining string doesn't completely fill the screen
if (rlen < LCD_WIDTH) {
uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters
lcd_put_u8str(F(" ")); // Always at 1+ spaces left, draw a space
if (--chars) { // Draw a second space if there's room
lcd_put_u8str(F(" "));
if (--chars) { // Draw a third space if there's room
lcd_put_u8str(F(" "));
if (--chars)
lcd_put_u8str_max(status_message, chars); // Print a second copy of the message
}
}
}
if (last_blink != blink) {
last_blink = blink;
advance_status_scroll();
}
}
#else
UNUSED(blink);
// Get the UTF8 character count of the string
uint8_t slen = status_message.glyphs();
// Just print the string to the LCD
lcd_put_u8str_max(status_message, LCD_WIDTH);
// Fill the rest with spaces if there are missing spaces
for (; slen < LCD_WIDTH; ++slen) lcd_put_u8str(F(" "));
#endif
}
#if HAS_PRINT_PROGRESS
#define TPOFFSET (LCD_WIDTH - 1)
static uint8_t timepos = TPOFFSET - 6;
static char buffer[8];
#if ENABLED(SHOW_PROGRESS_PERCENT)
static lcd_uint_t pc = 0, pr = 2;
inline void setPercentPos(const lcd_uint_t c, const lcd_uint_t r) { pc = c; pr = r; }
void MarlinUI::drawPercent() {
const uint8_t progress = get_progress_percent();
if (progress) {
lcd_moveto(pc, pr);
lcd_put_u8str(F(TERN(IS_SD_PRINTING, "SD", "P:")));
lcd_put_u8str(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(get_progress_permyriad()), ui8tostr3rj(progress)));
lcd_put_u8str(F("%"));
}
}
#endif
#if ENABLED(SHOW_REMAINING_TIME)
void MarlinUI::drawRemain() {
if (printJobOngoing()) {
const duration_t remaint = get_remaining_time();
timepos = TPOFFSET - remaint.toDigital(buffer);
IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20));
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'R');
lcd_put_u8str(buffer);
}
}
#endif
#if ENABLED(SHOW_INTERACTION_TIME)
void MarlinUI::drawInter() {
const duration_t interactt = interaction_time;
if (printingIsActive() && interactt.value) {
timepos = TPOFFSET - interactt.toDigital(buffer);
IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20));
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'C');
lcd_put_u8str(buffer);
}
}
#endif
#if ENABLED(SHOW_ELAPSED_TIME)
void MarlinUI::drawElapsed() {
if (printJobOngoing()) {
const duration_t elapsedt = print_job_timer.duration();
timepos = TPOFFSET - elapsedt.toDigital(buffer);
IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20));
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'E');
lcd_put_u8str(buffer);
}
}
#endif
#endif // HAS_PRINT_PROGRESS
/**
* LCD_INFO_SCREEN_STYLE 0 : Classic Status Screen
*
* 16x2 |000/000 B000/000|
* |0123456789012345|
*
* 16x4 |000/000 B000/000|
* |SD---% Z 000.00|
* |F---% T--:--|
* |0123456789012345|
*
* 20x2 |T000/000° B000/000° |
* |01234567890123456789|
*
* 20x4 |T000/000° B000/000° |
* |X 000 Y 000 Z000.000|
* |F---% SD---% T--:--|
* |01234567890123456789|
*
* LCD_INFO_SCREEN_STYLE 1 : Průša-style Status Screen
*
* |T000/000° Z 000.00 |
* |B000/000° F---% |
* |SD---% T--:-- |
* |01234567890123456789|
*
* |T000/000° Z 000.00 |
* |T000/000° F---% |
* |B000/000° SD---% |
* |01234567890123456789|
*/
void MarlinUI::draw_status_screen() {
const bool blink = get_blink();
lcd_moveto(0, 0);
#if LCD_INFO_SCREEN_STYLE == 0
// ========== Line 1 ==========
#if LCD_WIDTH < 20
//
// Hotend 0 Temperature
//
#if HAS_HOTEND
_draw_heater_status(H_E0, -1, blink);
//
// Hotend 1 or Bed Temperature
//
#if HAS_MULTI_HOTEND
lcd_moveto(8, 0);
_draw_heater_status(H_E1, LCD_STR_THERMOMETER[0], blink);
#elif HAS_HEATED_BED
lcd_moveto(8, 0);
_draw_bed_status(blink);
#endif
#elif HAS_CUTTER
//
// Cutter Status
//
lcd_moveto(0, 0);
_draw_cutter_status();
#endif
#else // LCD_WIDTH >= 20
//
// Hotend 0 Temperature
//
#if HAS_HOTEND
_draw_heater_status(H_E0, LCD_STR_THERMOMETER[0], blink);
//
// Hotend 1 or Bed Temperature
//
#if HAS_MULTI_HOTEND
lcd_moveto(10, 0);
_draw_heater_status(H_E1, LCD_STR_THERMOMETER[0], blink);
#elif HAS_HEATED_BED
lcd_moveto(10, 0);
_draw_bed_status(blink);
#endif
#elif HAS_CUTTER
//
// Cutter Status
//
lcd_moveto(0, 0);
_draw_cutter_status();
#endif
TERN_(HAS_COOLER, _draw_cooler_status('*', blink));
TERN_(LASER_COOLANT_FLOW_METER, _draw_flowmeter_status());
TERN_(I2C_AMMETER, _draw_ammeter_status());
#endif // LCD_WIDTH >= 20
// ========== Line 2 ==========
#if LCD_HEIGHT > 2
#if LCD_WIDTH < 20
#if HAS_PRINT_PROGRESS
TERN_(SHOW_PROGRESS_PERCENT, setPercentPos(0, 2));
rotate_progress();
#endif
#else // LCD_WIDTH >= 20
lcd_moveto(0, 1);
// If the first line has two extruder temps,
// show more temperatures on the next line
#if HOTENDS > 2 || (HAS_MULTI_HOTEND && HAS_HEATED_BED)
#if HOTENDS > 2
_draw_heater_status(H_E2, LCD_STR_THERMOMETER[0], blink);
lcd_moveto(10, 1);
#endif
_draw_bed_status(blink);
#else // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED)
#if HAS_DUAL_MIXING
// Two-component mix / gradient instead of XY
char mixer_messages[15];
PGM_P mix_label;
#if ENABLED(GRADIENT_MIX)
if (mixer.gradient.enabled) {
mixer.update_mix_from_gradient();
mix_label = PSTR("Gr");
}
else
#endif
{
mixer.update_mix_from_vtool();
mix_label = PSTR("Mx");
}
sprintf_P(mixer_messages, PSTR(S_FMT " %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1]));
lcd_put_u8str(mixer_messages);
#else // !HAS_DUAL_MIXING
const bool show_e_total = TERN1(HAS_X_AXIS, TERN0(LCD_SHOW_E_TOTAL, printingIsActive()));
if (show_e_total) {
#if ENABLED(LCD_SHOW_E_TOTAL)
char tmp[20];
const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm
sprintf_P(tmp, PSTR("E %ld%cm "), uint32_t(_MAX(e_move_accumulator, 0.0f)) / escale, escale == 10 ? 'c' : 'm'); // 1234567mm
lcd_put_u8str(tmp);
#endif
}
else {
#if HAS_X_AXIS
const xy_pos_t lpos = current_position.asLogical();
_draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink);
#endif
#if HAS_Y_AXIS
TERN_(HAS_X_AXIS, lcd_put_u8str(F(" ")));
_draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink);
#endif
}
#endif // !HAS_DUAL_MIXING
#endif // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED)
#endif // LCD_WIDTH >= 20
#if HAS_Z_AXIS
lcd_moveto(LCD_WIDTH - 8, 1);
_draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink);
#if HAS_LEVELING && !HAS_HEATED_BED
lcd_put_lchar(planner.leveling_active || blink ? '_' : ' ');
#endif
#endif
#endif // LCD_HEIGHT > 2
// ========== Line 3 ==========
#if LCD_HEIGHT > 3
lcd_put_lchar(0, 2, LCD_STR_FEEDRATE[0]);
lcd_put_u8str(i16tostr3rj(feedrate_percentage));
lcd_put_u8str(F("%"));
#if LCD_WIDTH >= 20
#if HAS_PRINT_PROGRESS
TERN_(SHOW_PROGRESS_PERCENT, setPercentPos(6, 2));
rotate_progress();
#else
char c;
uint16_t per;
#if HAS_FAN0
if (true
#if ALL(HAS_EXTRUDERS, ADAPTIVE_FAN_SLOWING)
&& (blink || thermalManager.fan_speed_scaler[0] < 128)
#endif
) {
uint16_t spd = thermalManager.fan_speed[0];
if (blink) c = 'F';
#if ENABLED(ADAPTIVE_FAN_SLOWING)
else { c = '*'; spd = thermalManager.scaledFanSpeed(0, spd); }
#endif
per = thermalManager.pwmToPercent(spd);
}
else
#endif
{
#if HAS_EXTRUDERS
c = 'E';
per = planner.flow_percentage[0];
#endif
}
lcd_put_lchar(c);
lcd_put_u8str(i16tostr3rj(per));
lcd_put_u8str(F("%"));
#endif
#endif
#endif // LCD_HEIGHT > 3
#elif LCD_INFO_SCREEN_STYLE == 1
// ========== Line 1 ==========
//
// Hotend 0 Temperature
//
_draw_heater_status(H_E0, LCD_STR_THERMOMETER[0], blink);
//
// Z Coordinate
//
#if HAS_Z_AXIS
lcd_moveto(LCD_WIDTH - 9, 0);
_draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink);
#endif
#if HAS_LEVELING && (HAS_MULTI_HOTEND || !HAS_HEATED_BED)
lcd_put_lchar(LCD_WIDTH - 1, 0, planner.leveling_active || blink ? '_' : ' ');
#endif
// ========== Line 2 ==========
//
// Hotend 1 or Bed Temperature
//
lcd_moveto(0, 1);
#if HAS_MULTI_HOTEND
_draw_heater_status(H_E1, LCD_STR_THERMOMETER[0], blink);
#elif HAS_HEATED_BED
_draw_bed_status(blink);
#endif
lcd_put_lchar(LCD_WIDTH - 9, 1, LCD_STR_FEEDRATE[0]);
lcd_put_u8str(i16tostr3rj(feedrate_percentage));
lcd_put_u8str(F("%"));
// ========== Line 3 ==========
//
// Progress percent, Hotend 2, or Bed
//
lcd_moveto(0, 2);
#if HOTENDS > 2
_draw_heater_status(H_E2, LCD_STR_THERMOMETER[0], blink);
#elif HAS_MULTI_HOTEND && HAS_HEATED_BED
_draw_bed_status(blink);
#elif HAS_PRINT_PROGRESS
#define DREW_PRINT_PROGRESS 1
TERN_(SHOW_PROGRESS_PERCENT, setPercentPos(0, 2));
rotate_progress();
#endif
//
// All progress strings
//
#if HAS_PRINT_PROGRESS && !DREW_PRINT_PROGRESS
TERN_(SHOW_PROGRESS_PERCENT, setPercentPos(LCD_WIDTH - 9, 2));
rotate_progress();
#endif
#elif LCD_INFO_SCREEN_STYLE == 2
// ========== Line 1 ==========
//
// X Coordinate
//
lcd_moveto(0, 0);
_draw_axis_value(X_AXIS, ftostr52sp(LOGICAL_X_POSITION(current_position.x)), blink);
//
// Y Coordinate
//
lcd_moveto(LCD_WIDTH - 9, 0);
_draw_axis_value(Y_AXIS, ftostr52sp(LOGICAL_Y_POSITION(current_position.y)), blink);
// ========== Line 2 ==========
lcd_moveto(0, 1);
_draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink);
lcd_moveto(LCD_WIDTH - 9, 1);
_draw_axis_value(I_AXIS, ftostr52sp(LOGICAL_I_POSITION(current_position.i)), blink);
// ========== Line 3 ==========
lcd_moveto(0, 2);
lcd_put_lchar('F');
lcd_moveto(LCD_WIDTH - 9, 2);
lcd_put_lchar('S');
#endif // LCD_INFO_SCREEN_STYLE
// ========= Last Line ========
//
// Status Message (which may be a Progress Bar or Filament display)
//
draw_status_message(blink);
}
#if HAS_MARLINUI_MENU
#include "../menu/menu.h"
#if ENABLED(ADVANCED_PAUSE_FEATURE)
void MarlinUI::draw_hotend_status(const uint8_t row, const uint8_t extruder) {
if (row < LCD_HEIGHT) {
lcd_moveto(LCD_WIDTH - 9, row);
_draw_heater_status((heater_id_t)extruder, LCD_STR_THERMOMETER[0], get_blink());
}
}
#endif // ADVANCED_PAUSE_FEATURE
// Draw a static item with no left-right margin required. Centered by default.
void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style/*=SS_DEFAULT*/, const char *vstr/*=nullptr*/) {
lcd_moveto(0, row);
int8_t n = LCD_WIDTH;
const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL);
// Value length, if any
int8_t vlen = vstr ? utf8_strlen(vstr) : 0;
// Expanded label string and width in chars
char estr[calculateWidth(ftpl) + 3] = "\0";
int8_t llen = ftpl ? expand_u8str(estr, ftpl, itemIndex, itemStringC, itemStringF, n - vlen) : 0;
bool mv_colon = false;
if (vlen && !center) {
// Move the leading colon from the value to the label below
mv_colon = (*vstr == ':');
// Shorter value, wider label
if (mv_colon) { vstr++; vlen--; llen++; }
// Remove leading spaces from the value and shorten
while (*vstr == ' ') { vstr++; vlen--; }
}
// Padding for center or full justification
int8_t pad = (center || full) ? n - llen - vlen : 0;
// SS_CENTER: Pad with half of the unused space first
if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad, --pad, --n) lcd_put_u8str(F(" "));
// Draw as much of the label as fits (without the relocated colon, drawn below)
if (llen) n -= lcd_put_u8str_max(estr, n - vlen);
if (vlen && n > 0) {
// SS_FULL: Pad with enough space to justify the value
if (full && !center) {
// Move the leading colon from the value to the label
if (mv_colon) n -= lcd_put_u8str(F(":"));
// Pad in-between
for (; pad > 0; --pad) { lcd_put_u8str(F(" ")); n--; }
}
n -= lcd_put_u8str_max(vstr, n);
}
for (; n > 0; --n) lcd_put_u8str(F(" "));
}
// Draw a generic menu item with pre_char (if selected) and post_char
void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char pre_char, const char post_char) {
lcd_put_lchar(0, row, sel ? pre_char : ' ');
uint8_t n = LCD_WIDTH - 2;
n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n);
for (; n; --n) lcd_put_u8str(F(" "));
lcd_put_lchar(post_char);
}
// Draw a menu item with a (potentially) editable value
void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char * const inStr, const bool pgm) {
const uint8_t vlen = inStr ? (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)) : 0;
lcd_put_lchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
uint8_t n = LCD_WIDTH - 2 - vlen;
n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n);
if (vlen) {
lcd_put_u8str(F(":"));
for (; n; --n) lcd_put_u8str(F(" "));
if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr);
}
}
// Low-level draw_edit_screen can be used to draw an edit screen from anyplace
void MenuEditItemBase::draw_edit_screen(FSTR_P const ftpl, const char * const value/*=nullptr*/) {
ui.encoder_direction_normal();
uint8_t n = LCD_WIDTH - 1;
n -= lcd_put_u8str(0, 1, ftpl, itemIndex, itemStringC, itemStringF, n);
if (value) {
lcd_put_u8str(F(":")); n--;
const uint8_t len = utf8_strlen(value) + 1; // Plus one for a leading space
const lcd_uint_t valrow = n < len ? 2 : 1; // Value on the next row if it won't fit
lcd_put_lchar(LCD_WIDTH - len, valrow, ' '); // Right-justified, padded, leading space
lcd_put_u8str(value);
}
}
// The Select Screen presents a prompt and two "buttons"
void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const fpre, const char * const string/*=nullptr*/, FSTR_P const fsuf/*=nullptr*/) {
ui.draw_select_screen_prompt(fpre, string, fsuf);
if (no) {
SETCURSOR(0, LCD_HEIGHT - 1);
lcd_put_lchar(yesno ? ' ' : '['); lcd_put_u8str(no); lcd_put_lchar(yesno ? ' ' : ']');
}
if (yes) {
SETCURSOR_RJ(utf8_strlen(yes) + 2, LCD_HEIGHT - 1);
lcd_put_lchar(yesno ? '[' : ' '); lcd_put_u8str(yes); lcd_put_lchar(yesno ? ']' : ' ');
}
}
#if HAS_MEDIA
void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) {
lcd_put_lchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
uint8_t n = LCD_WIDTH - 2;
n -= lcd_put_u8str_max(ui.scrolled_filename(theCard, n, row, sel), n);
for (; n; --n) lcd_put_u8str(F(" "));
lcd_put_lchar(isDir ? LCD_STR_FOLDER[0] : ' ');
}
#endif
#if ENABLED(LCD_HAS_STATUS_INDICATORS)
void MarlinUI::update_indicators() {
// Set the LEDS - referred to as backlights by the LiquidTWI2 library
static uint8_t ledsprev = 0;
uint8_t leds = 0;
if (TERN0(HAS_HEATED_BED, thermalManager.degTargetBed() > 0)) leds |= LED_A;
if (TERN0(HAS_HOTEND, thermalManager.degTargetHotend(0) > 0)) leds |= LED_B;
#if HAS_FAN
if ( TERN0(HAS_FAN0, thermalManager.fan_speed[0])
|| TERN0(HAS_FAN1, thermalManager.fan_speed[1])
|| TERN0(HAS_FAN2, thermalManager.fan_speed[2])
|| TERN0(HAS_FAN3, thermalManager.fan_speed[3])
|| TERN0(HAS_FAN4, thermalManager.fan_speed[4])
|| TERN0(HAS_FAN5, thermalManager.fan_speed[5])
|| TERN0(HAS_FAN6, thermalManager.fan_speed[6])
|| TERN0(HAS_FAN7, thermalManager.fan_speed[7])
) leds |= LED_C;
#endif // HAS_FAN
if (TERN0(HAS_MULTI_HOTEND, thermalManager.degTargetHotend(1) > 0)) leds |= LED_C;
if (leds != ledsprev) {
lcd.setBacklight(leds);
ledsprev = leds;
}
}
#endif // LCD_HAS_STATUS_INDICATORS
#if ENABLED(AUTO_BED_LEVELING_UBL)
#define HD44780_CHAR_WIDTH 5
#define HD44780_CHAR_HEIGHT 8
#define MESH_MAP_COLS 7
#define MESH_MAP_ROWS 4
#define CHAR_LINE_TOP 0
#define CHAR_LINE_BOT 1
#define CHAR_EDGE_L 2
#define CHAR_EDGE_R 3
#define CHAR_UL_UL 4
#define CHAR_LR_UL 5
#define CHAR_UL_LR 6
#define CHAR_LR_LR 7
#define TOP_LEFT _BV(0)
#define TOP_RIGHT _BV(1)
#define LOWER_LEFT _BV(2)
#define LOWER_RIGHT _BV(3)
/**
* Possible map screens:
*
* 16x2 |X000.00 Y000.00|
* |(00,00) Z00.000|
*
* 20x2 | X:000.00 Y:000.00 |
* | (00,00) Z:00.000 |
*
* 16x4 |+-------+(00,00)|
* || |X000.00|
* || |Y000.00|
* |+-------+Z00.000|
*
* 20x4 | +-------+ (00,00) |
* | | | X:000.00|
* | | | Y:000.00|
* | +-------+ Z:00.000|
*/
typedef struct {
uint8_t custom_char_bits[HD44780_CHAR_HEIGHT];
} custom_char;
typedef struct {
lcd_uint_t column, row,
x_pixel_offset, y_pixel_offset;
uint8_t x_pixel_mask;
} coordinate;
void add_edges_to_custom_char(custom_char &custom, const coordinate &ul, const coordinate &lr, const coordinate &brc, const uint8_t cell_location);
FORCE_INLINE static void clear_custom_char(custom_char * const cc) { ZERO(cc->custom_char_bits); }
coordinate pixel_location(int16_t x, int16_t y) {
coordinate ret_val;
int16_t xp, yp, r, c;
x++; y++; // +1 because lines on the left and top
c = x / (HD44780_CHAR_WIDTH);
r = y / (HD44780_CHAR_HEIGHT);
ret_val.column = c;
ret_val.row = r;
xp = x - c * (HD44780_CHAR_WIDTH); // Get the pixel offsets into the character cell
xp = HD44780_CHAR_WIDTH - 1 - xp; // Column within relevant character cell (0 on the right)
yp = y - r * (HD44780_CHAR_HEIGHT);
ret_val.x_pixel_mask = _BV(xp);
ret_val.x_pixel_offset = xp;
ret_val.y_pixel_offset = yp;
return ret_val;
}
inline coordinate pixel_location(const lcd_uint_t x, const lcd_uint_t y) { return pixel_location((int16_t)x, (int16_t)y); }
void prep_and_put_map_char(custom_char &chrdata, const coordinate &ul, const coordinate &lr, const coordinate &brc, const uint8_t cl, const char c, const lcd_uint_t x, const lcd_uint_t y) {
add_edges_to_custom_char(chrdata, ul, lr, brc, cl);
lcd.createChar(c, (uint8_t*)&chrdata);
lcd_put_lchar(x, y, c);
}
void MarlinUI::ubl_plot(const uint8_t x_plot, const uint8_t y_plot) {
#if LCD_WIDTH >= 20
#define _LCD_W_POS 12
#define _PLOT_X 1
#define _MAP_X 3
#define _LABEL(C,X,Y) lcd_put_u8str_P(X, Y, C)
#define _XLABEL(X,Y) _LABEL(X_LBL,X,Y)
#define _YLABEL(X,Y) _LABEL(Y_LBL,X,Y)
#define _ZLABEL(X,Y) _LABEL(Z_LBL,X,Y)
#else
#define _LCD_W_POS 8
#define _PLOT_X 0
#define _MAP_X 1
#define _LABEL(X,Y,C) lcd_put_lchar(X, Y, C)
#define _XLABEL(X,Y) _LABEL('X',X,Y)
#define _YLABEL(X,Y) _LABEL('Y',X,Y)
#define _ZLABEL(X,Y) _LABEL('Z',X,Y)
#endif
#if LCD_HEIGHT <= 3 // 16x2 or 20x2 display
/**
* Show X and Y positions
*/
_XLABEL(_PLOT_X, 0);
lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(bedlevel.get_mesh_x(x_plot))));
_YLABEL(_LCD_W_POS, 0);
lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(bedlevel.get_mesh_y(y_plot))));
lcd_moveto(_PLOT_X, 0);
#else // 16x4 or 20x4 display
coordinate upper_left, lower_right, bottom_right_corner;
custom_char new_char;
uint8_t i, n, n_rows, n_cols;
lcd_uint_t j, k, l, m, bottom_line, right_edge,
x_map_pixels, y_map_pixels,
pixels_per_x_mesh_pnt, pixels_per_y_mesh_pnt,
suppress_x_offset = 0, suppress_y_offset = 0;
const uint8_t y_plot_inv = (GRID_MAX_POINTS_Y) - 1 - y_plot;
upper_left.column = 0;
upper_left.row = 0;
lower_right.column = 0;
lower_right.row = 0;
clear_lcd();
x_map_pixels = (HD44780_CHAR_WIDTH) * (MESH_MAP_COLS) - 2; // Minus 2 because we are drawing a box around the map
y_map_pixels = (HD44780_CHAR_HEIGHT) * (MESH_MAP_ROWS) - 2;
pixels_per_x_mesh_pnt = x_map_pixels / (GRID_MAX_POINTS_X);
pixels_per_y_mesh_pnt = y_map_pixels / (GRID_MAX_POINTS_Y);
if (pixels_per_x_mesh_pnt >= HD44780_CHAR_WIDTH) { // There are only 2 custom characters available, so the X
pixels_per_x_mesh_pnt = HD44780_CHAR_WIDTH; // Size of the mesh point needs to fit within them independent
suppress_x_offset = 1; // Of where the starting pixel is located.
}
if (pixels_per_y_mesh_pnt >= HD44780_CHAR_HEIGHT) { // There are only 2 custom characters available, so the Y
pixels_per_y_mesh_pnt = HD44780_CHAR_HEIGHT; // Size of the mesh point needs to fit within them independent
suppress_y_offset = 1; // Of where the starting pixel is located.
}
x_map_pixels = pixels_per_x_mesh_pnt * (GRID_MAX_POINTS_X); // Now we have the right number of pixels to make both
y_map_pixels = pixels_per_y_mesh_pnt * (GRID_MAX_POINTS_Y); // Directions fit nicely
right_edge = pixels_per_x_mesh_pnt * (GRID_MAX_POINTS_X) + 1; // Find location of right edge within the character cell
bottom_line = pixels_per_y_mesh_pnt * (GRID_MAX_POINTS_Y) + 1; // Find location of bottom line within the character cell
n_rows = bottom_line / (HD44780_CHAR_HEIGHT) + 1;
n_cols = right_edge / (HD44780_CHAR_WIDTH) + 1;
for (i = 0; i < n_cols; i++) {
lcd_put_lchar(i, 0, CHAR_LINE_TOP); // Box Top line
lcd_put_lchar(i, n_rows - 1, CHAR_LINE_BOT); // Box Bottom line
}
for (j = 0; j < n_rows; j++) {
lcd_put_lchar(0, j, CHAR_EDGE_L); // Box Left edge
lcd_put_lchar(n_cols - 1, j, CHAR_EDGE_R); // Box Right edge
}
/**
* If the entire 4th row is not in use, do not put vertical bars all the way down to the bottom of the display
*/
k = pixels_per_y_mesh_pnt * (GRID_MAX_POINTS_Y) + 2;
l = (HD44780_CHAR_HEIGHT) * n_rows;
if (l > k && l - k >= (HD44780_CHAR_HEIGHT) / 2) {
lcd_put_lchar(0, n_rows - 1, ' '); // Box Left edge
lcd_put_lchar(n_cols - 1, n_rows - 1, ' '); // Box Right edge
}
clear_custom_char(&new_char);
new_char.custom_char_bits[0] = 0b11111U; // Char #0 is used for the box top line
lcd.createChar(CHAR_LINE_TOP, (uint8_t*)&new_char);
clear_custom_char(&new_char);
k = (GRID_MAX_POINTS_Y) * pixels_per_y_mesh_pnt + 1; // Row of pixels for the bottom box line
l = k % (HD44780_CHAR_HEIGHT); // Row within relevant character cell
new_char.custom_char_bits[l] = 0b11111U; // Char #1 is used for the box bottom line
lcd.createChar(CHAR_LINE_BOT, (uint8_t*)&new_char);
clear_custom_char(&new_char);
for (j = 0; j < HD44780_CHAR_HEIGHT; j++)
new_char.custom_char_bits[j] = 0b10000U; // Char #2 is used for the box left edge
lcd.createChar(CHAR_EDGE_L, (uint8_t*)&new_char);
clear_custom_char(&new_char);
m = (GRID_MAX_POINTS_X) * pixels_per_x_mesh_pnt + 1; // Column of pixels for the right box line
n = m % (HD44780_CHAR_WIDTH); // Column within relevant character cell
i = HD44780_CHAR_WIDTH - 1 - n; // Column within relevant character cell (0 on the right)
for (j = 0; j < HD44780_CHAR_HEIGHT; j++)
new_char.custom_char_bits[j] = (uint8_t)_BV(i); // Char #3 is used for the box right edge
lcd.createChar(CHAR_EDGE_R, (uint8_t*)&new_char);
i = x_plot * pixels_per_x_mesh_pnt - suppress_x_offset;
j = y_plot_inv * pixels_per_y_mesh_pnt - suppress_y_offset;
upper_left = pixel_location(i, j);
k = (x_plot + 1) * pixels_per_x_mesh_pnt - 1 - suppress_x_offset;
l = (y_plot_inv + 1) * pixels_per_y_mesh_pnt - 1 - suppress_y_offset;
lower_right = pixel_location(k, l);
bottom_right_corner = pixel_location(x_map_pixels, y_map_pixels);
/**
* First, handle the simple case where everything is within a single character cell.
* If part of the Mesh Plot is outside of this character cell, we will follow up
* and deal with that next.
*/
clear_custom_char(&new_char);
const lcd_uint_t ypix = _MIN(upper_left.y_pixel_offset + pixels_per_y_mesh_pnt, HD44780_CHAR_HEIGHT);
for (j = upper_left.y_pixel_offset; j < ypix; j++) {
i = upper_left.x_pixel_mask;
for (k = 0; k < pixels_per_x_mesh_pnt; k++) {
new_char.custom_char_bits[j] |= i;
i >>= 1;
}
}
prep_and_put_map_char(new_char, upper_left, lower_right, bottom_right_corner, TOP_LEFT, CHAR_UL_UL, upper_left.column, upper_left.row);
/**
* Next, check for two side by side character cells being used to display the Mesh Point
* If found... do the right hand character cell next.
*/
if (upper_left.column == lower_right.column - 1) {
l = upper_left.x_pixel_offset;
clear_custom_char(&new_char);
for (j = upper_left.y_pixel_offset; j < ypix; j++) {
i = _BV(HD44780_CHAR_WIDTH - 1); // Fill in the left side of the right character cell
for (k = 0; k < pixels_per_x_mesh_pnt - 1 - l; k++) {
new_char.custom_char_bits[j] |= i;
i >>= 1;
}
}
prep_and_put_map_char(new_char, upper_left, lower_right, bottom_right_corner, TOP_RIGHT, CHAR_LR_UL, lower_right.column, upper_left.row);
}
/**
* Next, check for two character cells stacked on top of each other being used to display the Mesh Point
*/
if (upper_left.row == lower_right.row - 1) {
l = HD44780_CHAR_HEIGHT - upper_left.y_pixel_offset; // Number of pixel rows in top character cell
k = pixels_per_y_mesh_pnt - l; // Number of pixel rows in bottom character cell
clear_custom_char(&new_char);
for (j = 0; j < k; j++) {
i = upper_left.x_pixel_mask;
for (m = 0; m < pixels_per_x_mesh_pnt; m++) { // Fill in the top side of the bottom character cell
new_char.custom_char_bits[j] |= i;
if (!(i >>= 1)) break;
}
}
prep_and_put_map_char(new_char, upper_left, lower_right, bottom_right_corner, LOWER_LEFT, CHAR_UL_LR, upper_left.column, lower_right.row);
}
/**
* Next, check for four character cells being used to display the Mesh Point. If that is
* what is here, we work to fill in the character cell that is down one and to the right one
* from the upper_left character cell.
*/
if (upper_left.column == lower_right.column - 1 && upper_left.row == lower_right.row - 1) {
l = HD44780_CHAR_HEIGHT - upper_left.y_pixel_offset; // Number of pixel rows in top character cell
k = pixels_per_y_mesh_pnt - l; // Number of pixel rows in bottom character cell
clear_custom_char(&new_char);
for (j = 0; j < k; j++) {
l = upper_left.x_pixel_offset;
i = _BV(HD44780_CHAR_WIDTH - 1); // Fill in the left side of the right character cell
for (m = 0; m < pixels_per_x_mesh_pnt - 1 - l; m++) { // Fill in the top side of the bottom character cell
new_char.custom_char_bits[j] |= i;
i >>= 1;
}
}
prep_and_put_map_char(new_char, upper_left, lower_right, bottom_right_corner, LOWER_RIGHT, CHAR_LR_LR, lower_right.column, lower_right.row);
}
#endif
/**
* Print plot position
*/
lcd_put_lchar(_LCD_W_POS, 0, '(');
lcd_put_u8str(ui8tostr3rj(x_plot));
lcd_put_u8str(F(","));
lcd_put_u8str(ui8tostr3rj(y_plot));
lcd_put_u8str(F(")"));
#if LCD_HEIGHT <= 3 // 16x2 or 20x2 display
/**
* Print Z values
*/
_ZLABEL(_LCD_W_POS, 1);
if (!isnan(bedlevel.z_values[x_plot][y_plot]))
lcd_put_u8str(ftostr43sign(bedlevel.z_values[x_plot][y_plot]));
else
lcd_put_u8str(F(" -----"));
#else // 16x4 or 20x4 display
/**
* Show all values at right of screen
*/
_XLABEL(_LCD_W_POS, 1);
lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(bedlevel.get_mesh_x(x_plot))));
_YLABEL(_LCD_W_POS, 2);
lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(bedlevel.get_mesh_y(y_plot))));
/**
* Show the location value
*/
_ZLABEL(_LCD_W_POS, 3);
if (!isnan(bedlevel.z_values[x_plot][y_plot]))
lcd_put_u8str(ftostr43sign(bedlevel.z_values[x_plot][y_plot]));
else
lcd_put_u8str(F(" -----"));
#endif // LCD_HEIGHT > 3
}
void add_edges_to_custom_char(custom_char &custom, const coordinate &ul, const coordinate &lr, const coordinate &brc, const uint8_t cell_location) {
uint8_t i, k;
int16_t n_rows = lr.row - ul.row + 1,
n_cols = lr.column - ul.column + 1;
/**
* Check if Top line of box needs to be filled in
*/
if (ul.row == 0 && (cell_location & (TOP_LEFT|TOP_RIGHT))) { // Only fill in the top line for the top character cells
if (n_cols == 1) {
if (ul.column != brc.column)
custom.custom_char_bits[0] = 0xFF; // Single column in middle
else
for (i = brc.x_pixel_offset; i < HD44780_CHAR_WIDTH; i++) // Single column on right side
SBI(custom.custom_char_bits[0], i);
}
else if ((cell_location & TOP_LEFT) || lr.column != brc.column) // Multiple column in the middle or with right cell in middle
custom.custom_char_bits[0] = 0xFF;
else
for (i = brc.x_pixel_offset; i < HD44780_CHAR_WIDTH; i++)
SBI(custom.custom_char_bits[0], i);
}
/**
* Check if left line of box needs to be filled in
*/
if (cell_location & (TOP_LEFT|LOWER_LEFT)) {
if (ul.column == 0) { // Left column of characters on LCD Display
k = ul.row == brc.row ? brc.y_pixel_offset : HD44780_CHAR_HEIGHT; // If it isn't the last row... do the full character cell
for (i = 0; i < k; i++)
SBI(custom.custom_char_bits[i], HD44780_CHAR_WIDTH - 1);
}
}
/**
* Check if bottom line of box needs to be filled in
*/
// Single row of mesh plot cells
if (n_rows == 1 /* && (cell_location & (TOP_LEFT|TOP_RIGHT)) */ && ul.row == brc.row) {
if (n_cols == 1) // Single row, single column case
k = ul.column == brc.column ? brc.x_pixel_mask : 0x01;
else if (cell_location & TOP_RIGHT) // Single row, multiple column case
k = lr.column == brc.column ? brc.x_pixel_mask : 0x01;
else // Single row, left of multiple columns
k = 0x01;
while (k < _BV(HD44780_CHAR_WIDTH)) {
custom.custom_char_bits[brc.y_pixel_offset] |= k;
k <<= 1;
}
}
// Double row of characters on LCD Display
// And this is a bottom custom character
if (n_rows == 2 && (cell_location & (LOWER_LEFT|LOWER_RIGHT)) && lr.row == brc.row) {
if (n_cols == 1) // Double row, single column case
k = ul.column == brc.column ? brc.x_pixel_mask : 0x01;
else if (cell_location & LOWER_RIGHT) // Double row, multiple column case
k = lr.column == brc.column ? brc.x_pixel_mask : 0x01;
else // Double row, left of multiple columns
k = 0x01;
while (k < _BV(HD44780_CHAR_WIDTH)) {
custom.custom_char_bits[brc.y_pixel_offset] |= k;
k <<= 1;
}
}
/**
* Check if right line of box needs to be filled in
*/
// Nothing to do if the lower right part of the mesh pnt isn't in the same column as the box line
if (lr.column == brc.column) {
// This mesh point is in the same character cell as the right box line
if (ul.column == brc.column || (cell_location & (TOP_RIGHT|LOWER_RIGHT))) {
// If not the last row... do the full character cell
k = ul.row == brc.row ? brc.y_pixel_offset : HD44780_CHAR_HEIGHT;
for (i = 0; i < k; i++) custom.custom_char_bits[i] |= brc.x_pixel_mask;
}
}
}
#endif // AUTO_BED_LEVELING_UBL
#endif // HAS_MARLINUI_MENU
#endif // HAS_MARLINUI_HD44780
|
2301_81045437/Marlin
|
Marlin/src/lcd/HD44780/marlinui_HD44780.cpp
|
C++
|
agpl-3.0
| 55,919
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#pragma once
/**
* Hitachi HD44780 display defines and headers
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(LCD_I2C_TYPE_PCF8575)
// NOTE: These are register-mapped pins on the PCF8575 controller, not Arduino pins.
#define LCD_I2C_PIN_BL 3
#define LCD_I2C_PIN_EN 2
#define LCD_I2C_PIN_RW 1
#define LCD_I2C_PIN_RS 0
#define LCD_I2C_PIN_D4 4
#define LCD_I2C_PIN_D5 5
#define LCD_I2C_PIN_D6 6
#define LCD_I2C_PIN_D7 7
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#define LCD_CLASS LiquidCrystal_I2C
#elif ENABLED(LCD_I2C_TYPE_MCP23017)
// For the LED indicators (which may be mapped to different events in update_indicators())
#define LCD_HAS_STATUS_INDICATORS
#define LED_A 0x04 //100
#define LED_B 0x02 //010
#define LED_C 0x01 //001
#include <Wire.h>
#include <LiquidTWI2.h>
#define LCD_CLASS LiquidTWI2
#elif ENABLED(LCD_I2C_TYPE_MCP23008)
#include <Wire.h>
#include <LiquidTWI2.h>
#define LCD_CLASS LiquidTWI2
#elif ENABLED(LCD_I2C_TYPE_PCA8574)
#include <LiquidCrystal_I2C.h>
#define LCD_CLASS LiquidCrystal_I2C
#elif ENABLED(SR_LCD_2W_NL)
// 2 wire Non-latching LCD SR from:
// https://github.com/fmalpartida/New-LiquidCrystal/wiki/schematics#user-content-ShiftRegister_connection
#include <LCD.h>
#include <LiquidCrystal_SR.h>
#define LCD_CLASS LiquidCrystal_SR
#elif ENABLED(SR_LCD_3W_NL)
// NewLiquidCrystal didn't work, so this uses
// https://github.com/mikeshub/SailfishLCD
#include <SailfishLCD.h>
#define LCD_CLASS LiquidCrystalSerial
#elif ENABLED(LCM1602)
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#define LCD_CLASS LiquidCrystal_I2C
#elif ENABLED(YHCB2004)
#include <LiquidCrystal_AIP31068_SPI.h>
#define LCD_CLASS LiquidCrystal_AIP31068_SPI
#else
// Standard directly connected LCD implementations
#include <LiquidCrystal.h>
#define LCD_CLASS LiquidCrystal
#endif
#include "../lcdprint.h"
|
2301_81045437/Marlin
|
Marlin/src/lcd/HD44780/marlinui_HD44780.h
|
C
|
agpl-3.0
| 2,841
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
/**
* @file lcdprint_TFTGLCD.cpp
* @brief LCD print API for TFT-GLCD interface
* @author Yunhui Fu (yhfudev@gmail.com)
* @version 1.0
* @date 2016-08-19
* @copyright GPL/BSD
*/
/**
* The TFTGLCD only supports ??? languages.
*/
#include "../../inc/MarlinConfigPre.h"
#if IS_TFTGLCD_PANEL
#include "../marlinui.h"
#include "../../MarlinCore.h"
#include "../../libs/numtostr.h"
#include "marlinui_TFTGLCD.h"
#include <string.h>
int lcd_glyph_height() { return 1; }
typedef struct _TFTGLCD_charmap_t {
lchar_t uchar; // the unicode char
uint8_t idx; // the glyph of the char in the ROM
uint8_t idx2; // the char used to be combined with the idx to simulate a single char
} TFTGLCD_charmap_t;
#ifdef __AVR__
#define IV(a) U##a
#else
#define IV(a) L##a
#endif
static const TFTGLCD_charmap_t g_TFTGLCD_charmap_device[] PROGMEM = {
// sorted by uchar:
#if DISPLAY_CHARSET_HD44780 == JAPANESE
{IV('¢'), 0xEC, 0}, // A2
{IV('°'), 0xDF, 0}, // B0, Marlin special: '°' LCD_STR_DEGREE (0x09)
{IV('ä'), 0xE1, 0}, // E4
{IV('ö'), 0xEF, 0}, // F6
{IV('÷'), 0xFD, 0}, // 00F7
{IV('ü'), 0xF5, 0}, // 00FC
{IV('ˣ'), 0xEB, 0}, // 02E3
{IV('·'), 0xA5, 0}, // 0387
{IV('Ώ'), 0xF4, 0}, // 038F
{IV('Θ'), 0xF2, 0}, // 0398, Theta
{IV('Ξ'), 0xE3, 0}, // 039E, Xi
{IV('Σ'), 0xF6, 0}, // 03A3, Sigma
{IV('Ω'), 0xF4, 0}, // 03A9, Omega
{IV('ά'), 0xE0, 0}, // 03AC
{IV('έ'), 0xE3, 0}, // 03AD
{IV('α'), 0xE0, 0}, // 03B1, alpha
{IV('β'), 0xE2, 0}, // 03B2, beta
{IV('ε'), 0xE3, 0}, // 03B5, epsilon
{IV('θ'), 0xF2, 0}, // 03B8, theta
{IV('μ'), 0xE4, 0}, // 03BC, mu
{IV('ξ'), 0xE3, 0}, // 03BE, xi
{IV('π'), 0xF7, 0}, // 03C0, pi
{IV('ρ'), 0xE6, 0}, // 03C1, rho
{IV('σ'), 0xE5, 0}, // 03C3, sigma
{IV('←'), 0x7F, 0}, // 2190
{IV('→'), 0x7E, 0}, // 2192, Marlin special: '⮈⮉⮊⮋➤→' LCD_STR_ARROW_RIGHT (0x03)
{IV('√'), 0xE8, 0}, // 221A
{IV('∞'), 0xF3, 0}, // 221E
{IV('█'), 0xFF, 0}, // 2588
//{IV(''), 0xA0, 0},
{IV('。'), 0xA1, 0},
{IV('「'), 0xA2, 0},
{IV('」'), 0xA3, 0},
{IV('゛'), 0xDE, 0}, // ‶
{IV('゜'), 0xDF, 0}, // '〫'
{IV('゠'), '=', 0},
{IV('ァ'), 0xA7, 0},
{IV('ア'), 0xB1, 0},
{IV('ィ'), 0xA8, 0},
{IV('イ'), 0xB2, 0},
{IV('ゥ'), 0xA9, 0},
{IV('ウ'), 0xB3, 0},
{IV('ェ'), 0xAA, 0},
{IV('エ'), 0xB4, 0},
{IV('ォ'), 0xAB, 0},
{IV('オ'), 0xB5, 0},
{IV('カ'), 0xB6, 0},
{IV('ガ'), 0xB6, 0xDE},
{IV('キ'), 0xB7, 0},
{IV('ギ'), 0xB7, 0xDE}, //
{IV('ク'), 0xB8, 0},
{IV('グ'), 0xB8, 0xDE},
{IV('ケ'), 0xB9, 0},
{IV('ゲ'), 0xB9, 0xDE},
{IV('コ'), 0xBA, 0},
{IV('ゴ'), 0xBA, 0xDE},
{IV('サ'), 0xBB, 0},
{IV('ザ'), 0xBB, 0xDE},
{IV('シ'), 0xBC, 0},
{IV('ジ'), 0xBC, 0xDE},
{IV('ス'), 0xBD, 0},
{IV('ズ'), 0xBD, 0xDE},
{IV('セ'), 0xBE, 0},
{IV('ゼ'), 0xBE, 0xDE},
{IV('ソ'), 0xBF, 0},
{IV('ゾ'), 0xBF, 0xDE},
{IV('タ'), 0xC0, 0},
{IV('ダ'), 0xC0, 0xDE},
{IV('チ'), 0xC1, 0},
{IV('ヂ'), 0xC1, 0xDE},
{IV('ッ'), 0xAF, 0},
{IV('ツ'), 0xC2, 0},
{IV('ヅ'), 0xC2, 0xDE},
{IV('テ'), 0xC3, 0},
{IV('デ'), 0xC3, 0xDE},
{IV('ト'), 0xC4, 0},
{IV('ド'), 0xC4, 0xDE},
{IV('ナ'), 0xC5, 0},
{IV('ニ'), 0xC6, 0},
{IV('ヌ'), 0xC7, 0},
{IV('ネ'), 0xC8, 0},
{IV('ノ'), 0xC9, 0},
{IV('ハ'), 0xCA, 0},
{IV('バ'), 0xCA, 0xDE},
{IV('パ'), 0xCA, 0xDF},
{IV('ヒ'), 0xCB, 0},
{IV('ビ'), 0xCB, 0xDE},
{IV('ピ'), 0xCB, 0xDF},
{IV('フ'), 0xCC, 0},
{IV('ブ'), 0xCC, 0xDE},
{IV('プ'), 0xCC, 0xDF},
{IV('ヘ'), 0xCD, 0},
{IV('ベ'), 0xCD, 0xDE},
{IV('ペ'), 0xCD, 0xDF},
{IV('ホ'), 0xCE, 0},
{IV('ボ'), 0xCE, 0xDE},
{IV('ポ'), 0xCE, 0xDF},
{IV('マ'), 0xCF, 0},
{IV('ミ'), 0xD0, 0},
{IV('ム'), 0xD1, 0},
{IV('メ'), 0xD2, 0},
{IV('モ'), 0xD3, 0},
{IV('ャ'), 0xAC, 0},
{IV('ヤ'), 0xD4, 0},
{IV('ュ'), 0xAD, 0},
{IV('ユ'), 0xD5, 0},
{IV('ョ'), 0xAE, 0},
{IV('ヨ'), 0xD6, 0},
{IV('ラ'), 0xD7, 0},
{IV('リ'), 0xD8, 0},
{IV('ル'), 0xD9, 0},
{IV('レ'), 0xDA, 0},
{IV('ロ'), 0xDB, 0},
{IV('ワ'), 0xDC, 0},
{IV('ヲ'), 0xA6, 0},
{IV('ン'), 0xDD, 0},
{IV('ヴ'), 0xB3, 0xDE},
{IV('ヷ'), 0xDC, 0xDE},
{IV('ヺ'), 0xA6, 0xDE},
{IV('・'), 0xA5, 0},
{IV('ー'), 0xB0, 0},
{IV('ヽ'), 0xA4, 0},
//{IV('g'), 0xE7, 0}, // error
//{IV(''), 0xE9, 0},
//{IV('j'), 0xEA, 0}, // error
//{IV(''), 0xED, 0},
//{IV(''), 0xEE, 0},
//{IV('p'), 0xF0, 0}, // error
//{IV('q'), 0xF1, 0}, // error
//{IV(''), 0xF8, 0},
//{IV('y'), 0xF9, 0}, // error
{IV('万'), 0xFB, 0},
{IV('円'), 0xFC, 0},
{IV('千'), 0xFA, 0},
//{IV(''), 0xFE, 0},
//、・ヲァィゥェォャュョッー
{IV('、'), 0xA4, 0}, //ヽ
{IV('・'), 0xA5, 0}, //・
{IV('ヲ'), 0xA6, 0}, //ヲ
{IV('ァ'), 0xA7, 0}, //ァ
{IV('ィ'), 0xA8, 0}, //ィ
{IV('ゥ'), 0xA9, 0}, //ゥ
{IV('ェ'), 0xAA, 0}, //ェ
{IV('ォ'), 0xAB, 0}, //ォ
{IV('ャ'), 0xAC, 0}, //ャ
{IV('ュ'), 0xAD, 0}, //ュ
{IV('ョ'), 0xAE, 0}, //ョ
{IV('ッ'), 0xAF, 0}, //ッ
{IV('ー'), 0xB0, 0}, //ー
//アイウエオカキクケコサシスセ
{IV('ア'), 0xB1, 0}, //ア
{IV('イ'), 0xB2, 0}, //イ
{IV('ウ'), 0xB3, 0}, //ウ
{IV('エ'), 0xB4, 0}, //エ
{IV('オ'), 0xB5, 0}, //オ
{IV('カ'), 0xB6, 0}, //カ
{IV('キ'), 0xB7, 0}, //キ
{IV('ク'), 0xB8, 0}, //ク
{IV('ケ'), 0xB9, 0}, //ケ
{IV('コ'), 0xBA, 0}, //コ
{IV('サ'), 0xBB, 0}, //サ
{IV('シ'), 0xBC, 0}, //シ
{IV('ス'), 0xBD, 0}, //ス
{IV('セ'), 0xBE, 0}, //セ
//ソタチツテトナニヌネノハヒフ
{IV('ソ'), 0xBF, 0}, //ソ
{IV('タ'), 0xC0, 0}, //タ
{IV('チ'), 0xC1, 0}, //チ
{IV('ツ'), 0xC2, 0}, //ツ
{IV('テ'), 0xC3, 0}, //テ
{IV('ト'), 0xC4, 0}, //ト
{IV('ナ'), 0xC5, 0}, //ナ
{IV('ニ'), 0xC6, 0}, //ニ
{IV('ヌ'), 0xC7, 0}, //ヌ
{IV('ネ'), 0xC8, 0}, //ネ
{IV('ノ'), 0xC9, 0}, //ノ
{IV('ハ'), 0xCA, 0}, //ハ
{IV('ヒ'), 0xCB, 0}, //ヒ
{IV('フ'), 0xCC, 0}, //フ
//ヘホマミムメモヤユヨラリルレロワン゙゚
{IV('ヘ'), 0xCD, 0}, //ヘ
{IV('ホ'), 0xCE, 0}, //ホ
{IV('マ'), 0xCF, 0}, //マ
{IV('ミ'), 0xD0, 0}, //ミ
{IV('ム'), 0xD1, 0}, //ム
{IV('メ'), 0xD2, 0}, //メ
{IV('モ'), 0xD3, 0}, //モ
{IV('ヤ'), 0xD4, 0}, //ヤ
{IV('ユ'), 0xD5, 0}, //ユ
{IV('ヨ'), 0xD6, 0}, //ヨ
{IV('ラ'), 0xD7, 0}, //ラ
{IV('リ'), 0xD8, 0}, //リ
{IV('ル'), 0xD9, 0}, //ル
{IV('レ'), 0xDA, 0}, //レ
{IV('ロ'), 0xDB, 0}, //ロ
{IV('ワ'), 0xDC, 0}, //ワ
{IV('ン'), 0xDD, 0}, //ン
{IV('゙'), 0xDE, 0}, // ゛
{IV('゚'), 0xDF, 0}, // ゜
{IV('¥'), 0x5C, 0},
#elif DISPLAY_CHARSET_HD44780 == WESTERN
// 0x10 -- 0x1F (except 0x1C)
// 0x80 -- 0xFF (except 0xA7,0xB0,0xB1,0xB3,0xB4,0xBF,0xD1,0xF8,0xFA,0xFC-0xFF)
{IV('¡'), 0xA9, 0},
{IV('¢'), 0xA4, 0},
{IV('£'), 0xA5, 0},
{IV('¥'), 0xA6, 0},
{IV('§'), 0xD2, 0}, // section sign
{IV('©'), 0xCF, 0},
{IV('ª'), 0x9D, 0},
{IV('«'), 0xBB, 0},
{IV('®'), 0xCE, 0},
{IV('°'), 0xB2, 0}, // Marlin special: '°' LCD_STR_DEGREE (0x09)
//{IV(''), 0xD1, 0},
{IV('±'), 0x10, 0}, //∓±
//{'='), 0x1C, 0}, // error
{IV('²'), 0x1E, 0},
{IV('³'), 0x1F, 0},
{IV('¶'), 0xD3, 0}, // pilcrow sign
{IV('º'), 0x9E, 0},
{IV('»'), 0xBC, 0}, // 00BB
//{IV(''), 0xB3, 0}, // error
//{IV(''), 0xB4, 0}, // error
{IV('¼'), 0xB6, 0}, // 00BC
{IV('½'), 0xB5, 0}, // 00BD
//{IV('¾'), '3', 0}, // 00BE
{IV('¿'), 0x9F, 0}, // 00BF
{IV('Â'), 0x8F, 0},
{IV('Ã'), 0xAA, 0},
{IV('Ä'), 0x8E, 0},
{IV('Æ'), 0x92, 0},
{IV('Ç'), 0x80, 0},
{IV('É'), 0x90, 0},
{IV('Ñ'), 0x9C, 0},
{IV('Õ'), 0xAC, 0},
{IV('Ö'), 0x99, 0},
{IV('×'), 0xB7, 0},
{IV('Ø'), 0xAE, 0},
{IV('Ü'), 0x9A, 0},
{IV('à'), 0x85, 0},
{IV('á'), 0xA0, 0},
{IV('â'), 0x83, 0},
{IV('ã'), 0xAB, 0},
{IV('ä'), 0x84, 0},
{IV('å'), 0x86, 0},
{IV('æ'), 0x91, 0},
{IV('ç'), 0x87, 0},
{IV('è'), 0x8A, 0},
{IV('é'), 0x82, 0},
{IV('ê'), 0x88, 0},
{IV('ë'), 0x89, 0},
{IV('ì'), 0x8D, 0},
{IV('í'), 0xA1, 0},
{IV('î'), 0x8C, 0},
{IV('ï'), 0x8B, 0},
{IV('ñ'), 0x9B, 0},
{IV('ò'), 0x95, 0},
{IV('ó'), 0xA2, 0},
{IV('ô'), 0x93, 0},
{IV('õ'), 0xAD, 0},
{IV('ö'), 0x94, 0},
{IV('÷'), 0xB8, 0},
{IV('ø'), 0xAF, 0},
{IV('ù'), 0x97, 0},
{IV('ú'), 0xA3, 0},
{IV('û'), 0x96, 0},
{IV('ü'), 0x81, 0},
{IV('ÿ'), 0x98, 0},
//{IV(''), 0xB0, 0}, // error
//{IV(''), 0xB1, 0}, // error
{IV('ƒ'), 0xA8, 0}, // 0192
{IV('Ύ'), 0xDB, 0}, // 038E
{IV('Ώ'), 0xDE, 0}, // 038F
{IV('ΐ'), 0xE7, 0}, // 0390
{IV('Γ'), 0xD4, 0}, // 0393, Gamma
{IV('Δ'), 0xD5, 0}, // 0394, Delta, ◿
{IV('Θ'), 0xD6, 0}, // 0398, Theta
{IV('Λ'), 0xD7, 0}, // 039B, Lambda
{IV('Ξ'), 0xD8, 0}, // 039E, Xi
{IV('Π'), 0xD9, 0}, // Pi
{IV('Σ'), 0xDA, 0}, // Sigma
{IV('Υ'), 0xDB, 0}, // Upsilon
{IV('Φ'), 0xDC, 0}, // Phi
{IV('Ψ'), 0xDD, 0}, // Psi
{IV('Ω'), 0xDE, 0}, // Omega
{IV('ά'), 0xDF, 0}, // 03AC
{IV('έ'), 0xE3, 0}, // 03AD
{IV('ή'), 0xE5, 0}, // 03AE
{IV('ί'), 0xE7, 0}, // 03AF
{IV('ΰ'), 0xF1, 0}, // 03B0
{IV('α'), 0xDF, 0}, // alpha
{IV('β'), 0xE0, 0}, // beta
{IV('γ'), 0xE1, 0}, // gamma
{IV('δ'), 0xE2, 0}, // delta
{IV('ε'), 0xE3, 0}, // epsilon
{IV('ζ'), 0xE4, 0}, // zeta
{IV('η'), 0xE5, 0}, // eta
{IV('θ'), 0xE6, 0}, // theta
{IV('ι'), 0xE7, 0}, // lota
{IV('κ'), 0xE8, 0}, // kappa
{IV('λ'), 0xE9, 0}, // lambda
{IV('μ'), 0xEA, 0}, // mu
{IV('ν'), 0xEB, 0}, // nu
{IV('ξ'), 0xEC, 0}, // xi
{IV('π'), 0xED, 0}, // pi
{IV('ρ'), 0xEE, 0}, // rho
{IV('σ'), 0xEF, 0}, // sigma
{IV('τ'), 0xF0, 0}, // tau
{IV('υ'), 0xF1, 0}, // upsilon
{IV('χ'), 0xF2, 0}, // chi
{IV('ψ'), 0xF3, 0}, // psi
{IV('ω'), 0xF4, 0}, // 03C9, omega
{IV('ϊ'), 0xE7, 0}, // 03CA
{IV('ϋ'), 0xF1, 0}, // 03CB
{IV('ύ'), 0xF1, 0}, // 03CD
{IV('ώ'), 0xF4, 0}, // 03CE
{IV('•'), 0xCD, 0}, // ·
{IV('℞'), 0xA7, 0}, // ℞ Pt ASCII 158
{IV('™'), 0xD0, 0},
{IV('↤'), 0xF9, 0}, // ⟻
{IV('↵'), 0xC4, 0},
{IV('↻'), 0x04, 0}, // Marlin special: '↻↺⟳⟲' LCD_STR_REFRESH (0x01)
{IV('⇥'), 0xFB, 0},
{IV('√'), 0xBE, 0}, // √
{IV('∞'), 0xC2, 0}, // infinity
{IV('∫'), 0x1B, 0},
{IV('∼'), 0x1D, 0},
{IV('≈'), 0x1A, 0},
{IV('≠'), 0xBD, 0},
{IV('≡'), 0x11, 0},
{IV('≤'), 0xB9, 0},// ≤≥ ⩽⩾
{IV('≥'), 0xBA, 0},
//{IV(''), 0xBF, 0}, // error
{IV('⌠'), 0xC0, 0},
{IV('⌡'), 0xC1, 0},
{IV('⎧'), 0x14, 0},
{IV('⎩'), 0x15, 0},
{IV('⎫'), 0x16, 0},
{IV('⎭'), 0x17, 0},
{IV('⎰'), 0x18, 0},
{IV('⎱'), 0x19, 0},
{IV('⎲'), 0x12, 0},
{IV('⎳'), 0x13, 0},
{IV('⏱'), 0x07, 0}, // Marlin special: '🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛🕜🕝🕞🕟🕠🕡🕢🕣🕤🕥🕦🕧 ⌚⌛⏰⏱⏳⧖⧗' LCD_STR_CLOCK (0x05)
{IV('┌'), 0xC9, 0},
{IV('┐'), 0xCA, 0},
{IV('└'), 0xCB, 0},
{IV('┘'), 0xCC, 0},
{IV('◸'), 0xC3, 0}, // ◿
{IV('⭠'), 0xC8, 0},
{IV('⭡'), 0xC5, 0},
{IV('⭢'), 0xC7, 0},
{IV('⭣'), 0xC6, 0},
{IV('⯆'), 0xF5, 0},
{IV('⯇'), 0xF7, 0}, // ⯅
{IV('⯈'), 0xF6, 0},
//{IV(''), 0xF8, 0}, // error
//{IV(''), 0xFA, 0}, // error
//{IV(''), 0xFC, 0}, // error
//{IV(''), 0xFD, 0}, // error
//{IV(''), 0xFE, 0}, // error
//{IV(''), 0xFF, 0}, // error
#elif DISPLAY_CHARSET_HD44780 == CYRILLIC
#ifdef CONVERT_TO_EXT_ASCII
{IV('°'), 0x01, 0}, // 00B0, Marlin special: '°' LCD_STR_DEGREE (0x09)
{IV('²'), 0x0E, 0}, // 0x32 if no special symbol in panel font
{IV('³'), 0x0F, 0}, // 0x33 if no special symbol in panel font
// translate to cp866 codepage
//first ASCII symbols in panel font must be replaced with Marlin special symbols
{IV('Ё'), 0xF0, 0}, // 0401
{IV('Є'), 0xF2, 0}, // 0404
{IV('І'), 'I', 0}, // 0406
{IV('Ї'), 0xF4, 0}, // 0407
{IV('Ў'), 0xF6, 0}, // 040E
{IV('А'), 0x80, 0}, // 0410
{IV('Б'), 0x81, 0},
{IV('В'), 0x82, 0},
{IV('Г'), 0x83, 0},
{IV('Д'), 0x84, 0},
{IV('Е'), 0x85, 0},
{IV('Ж'), 0x86, 0},
{IV('З'), 0x87, 0},
{IV('И'), 0x88, 0},
{IV('Й'), 0x89, 0},
{IV('К'), 0x8A, 0},
{IV('Л'), 0x8B, 0},
{IV('М'), 0x8C, 0},
{IV('Н'), 0x8D, 0},
{IV('О'), 0x8E, 0},
{IV('П'), 0x8F, 0},
{IV('Р'), 0x90, 0},
{IV('С'), 0x91, 0},
{IV('Т'), 0x92, 0},
{IV('У'), 0x93, 0},
{IV('Ф'), 0x94, 0},
{IV('Х'), 0x95, 0},
{IV('Ц'), 0x96, 0},
{IV('Ч'), 0x97, 0},
{IV('Ш'), 0x98, 0},
{IV('Щ'), 0x99, 0},
{IV('Ъ'), 0x9A, 0},
{IV('Ы'), 0x9B, 0},
{IV('Ь'), 0x9C, 0},
{IV('Э'), 0x9D, 0},
{IV('Ю'), 0x9E, 0},
{IV('Я'), 0x9F, 0},
{IV('а'), 0xA0, 0},
{IV('б'), 0xA1, 0},
{IV('в'), 0xA2, 0},
{IV('г'), 0xA3, 0},
{IV('д'), 0xA4, 0},
{IV('е'), 0xA5, 0},
{IV('ж'), 0xA6, 0},
{IV('з'), 0xA7, 0},
{IV('и'), 0xA8, 0},
{IV('й'), 0xA9, 0},
{IV('к'), 0xAA, 0},
{IV('л'), 0xAB, 0},
{IV('м'), 0xAC, 0},
{IV('н'), 0xAD, 0},
{IV('о'), 0xAE, 0},
{IV('п'), 0xAF, 0},
{IV('р'), 0xE0, 0},
{IV('с'), 0xE1, 0},
{IV('т'), 0xE2, 0},
{IV('у'), 0xE3, 0},
{IV('ф'), 0xE4, 0},
{IV('х'), 0xE5, 0},
{IV('ц'), 0xE6, 0},
{IV('ч'), 0xE7, 0},
{IV('ш'), 0xE8, 0},
{IV('щ'), 0xE9, 0},
{IV('ъ'), 0xEA, 0},
{IV('ы'), 0xEB, 0},
{IV('ь'), 0xEC, 0},
{IV('э'), 0xED, 0},
{IV('ю'), 0xEE, 0},
{IV('я'), 0xEF, 0}, // 044F
{IV('ё'), 0xF1, 0}, // 0451
{IV('є'), 0xF3, 0}, // 0454
{IV('і'), 'i', 0}, // 0456
{IV('ї'), 0xF5, 0}, // 0457
{IV('ў'), 0xF7, 0}, // 045E
#else
{IV('¢'), 0x5C, 0}, // 00A2
{IV('£'), 0xCF, 0}, // 00A3
{IV('°'), 0x01, 0}, // 00B0, Marlin special: '°' LCD_STR_DEGREE (0x09)
//{IV(''), 0x80, 0},
//{IV(''), 0x81, 0},
//{IV(''), 0x82, 0},
//{IV(''), 0x83, 0},
//{IV(''), 0x84, 0},
//{IV(''), 0x85, 0},
//{IV(''), 0x86, 0},
//{IV(''), 0x87, 0},
//{IV(''), 0x88, 0},
//{IV(''), 0x89, 0},
//{IV(''), 0x8A, 0},
//{IV(''), 0x8B, 0},
//{IV(''), 0x8C, 0},
//{IV(''), 0x8D, 0},
//{IV(''), 0x8E, 0},
//{IV(''), 0x8F, 0},
//{IV(''), 0x90, 0},
//{IV(''), 0x91, 0},
//{IV(''), 0x92, 0},
//{IV(''), 0x93, 0},
//{IV(''), 0x94, 0},
//{IV(''), 0x95, 0},
//{IV(''), 0x96, 0},
//{IV(''), 0x97, 0},
//{IV(''), 0x98, 0},
//{IV(''), 0x99, 0},
//{IV(''), 0x9A, 0},
//{IV(''), 0x9B, 0},
//{IV(''), 0x9C, 0},
//{IV(''), 0x9D, 0},
//{IV(''), 0x9E, 0},
//{IV(''), 0x9F, 0},
{IV('¼'), 0xF0, 0}, // 00BC
{IV('⅓'), 0xF1, 0},
{IV('½'), 0xF2, 0}, // 00BD
{IV('¾'), 0xF3, 0}, // 00BE
{IV('¿'), 0xCD, 0}, // 00BF
{IV('Ё'), 0xA2, 0}, // 0401
{IV('А'), 'A', 0}, // 0410
{IV('Б'), 0xA0, 0},
{IV('В'), 'B', 0},
{IV('Г'), 0xA1, 0},
{IV('Д'), 0xE0, 0},
{IV('Е'), 'E', 0},
{IV('Ж'), 0xA3, 0},
{IV('З'), 0xA4, 0},
{IV('И'), 0xA5, 0},
{IV('Й'), 0xA6, 0},
{IV('К'), 'K', 0},
{IV('Л'), 0xA7, 0},
{IV('М'), 'M', 0},
{IV('Н'), 'H', 0},
{IV('О'), 'O', 0},
{IV('П'), 0xA8, 0},
{IV('Р'), 'P', 0},
{IV('С'), 'C', 0},
{IV('Т'), 'T', 0},
{IV('У'), 0xA9, 0},
{IV('Ф'), 0xAA, 0},
{IV('Х'), 'X', 0},
{IV('Ц'), 0xE1, 0},
{IV('Ч'), 0xAB, 0},
{IV('Ш'), 0xAC, 0},
{IV('Щ'), 0xE2, 0},
{IV('Ъ'), 0xAD, 0},
{IV('Ы'), 0xAE, 0},
{IV('Ь'), 'b', 0},
{IV('Э'), 0xAF, 0},
{IV('Ю'), 0xB0, 0},
{IV('Я'), 0xB1, 0},
{IV('а'), 'a', 0},
{IV('б'), 0xB2, 0},
{IV('в'), 0xB3, 0},
{IV('г'), 0xB4, 0},
{IV('д'), 0xE3, 0},
{IV('е'), 'e', 0},
{IV('ж'), 0xB6, 0},
{IV('з'), 0xB7, 0},
{IV('и'), 0xB8, 0},
{IV('й'), 0xB9, 0},
{IV('к'), 0xBA, 0},
{IV('л'), 0xBB, 0},
{IV('м'), 0xBC, 0},
{IV('н'), 0xBD, 0},
{IV('о'), 'o', 0},
{IV('п'), 0xBE, 0},
{IV('р'), 'p', 0},
{IV('с'), 'c', 0},
{IV('т'), 0xBF, 0},
{IV('у'), 'y', 0},
{IV('ф'), 0xE4, 0},
{IV('х'), 'x', 0},
{IV('ц'), 0xE5, 0},
{IV('ч'), 0xC0, 0},
{IV('ш'), 0xC1, 0},
{IV('щ'), 0xE6, 0},
{IV('ъ'), 0xC2, 0},
{IV('ы'), 0xC3, 0},
{IV('ь'), 0xC4, 0},
{IV('э'), 0xC5, 0},
{IV('ю'), 0xC6, 0},
{IV('я'), 0xC7, 0}, // 044F
{IV('ё'), 0xB5, 0}, // 0451
//{IV(''), 0xC8, 0},
//{IV(''), 0xC9, 0},
//{IV(''), 0xCA, 0},
//{IV(''), 0xCB, 0},
//{IV(''), 0xCC, 0},
//{IV(''), 0xCD, 0},
//{IV(''), 0xCE, 0},
//{IV(''), 0xD0, 0},
//{IV(''), 0xD1, 0},
//{IV(''), 0xD2, 0},
//{IV(''), 0xD3, 0},
//{IV(''), 0xD4, 0},
//{IV(''), 0xD5, 0},
//{IV(''), 0xD6, 0},
//{IV(''), 0xD7, 0},
//{IV(''), 0xD8, 0},
//{IV(''), 0xDB, 0},
//{IV(''), 0xDC, 0},
//{IV(''), 0xDD, 0},
//{IV(''), 0xDE, 0},
//{IV(''), 0xDF, 0},
//{IV(''), 0xE7, 0},
//{IV(''), 0xE8, 0},
//{IV(''), 0xE9, 0},
//{IV(''), 0xEA, 0},
//{IV(''), 0xEB, 0},
//{IV(''), 0xEC, 0},
//{IV(''), 0xED, 0},
//{IV(''), 0xEE, 0},
//{IV(''), 0xEF, 0},
//{IV(''), 0xF4, 0},
//{IV(''), 0xF5, 0},
//{IV(''), 0xF6, 0},
//{IV(''), 0xF7, 0},
//{IV(''), 0xF8, 0},
//{IV(''), 0xF9, 0},
//{IV(''), 0xFA, 0},
//{IV(''), 0xFB, 0},
//{IV(''), 0xFC, 0},
//{IV(''), 0xFD, 0},
//{IV(''), 0xFE, 0},
//{IV(''), 0xFF, 0},
{IV('↑'), 0xD9, 0}, // 2191 ←↑→↓
{IV('↓'), 0xDA, 0}, // 2193
#endif
#endif
};
// the plain ASCII replacement for various char
static const TFTGLCD_charmap_t g_TFTGLCD_charmap_common[] PROGMEM = {
{IV('¡'), 'i', 0}, // A1
{IV('¢'), 'c', 0}, // A2
{IV('°'), 0x09, 0}, // B0 Marlin special: '°' LCD_STR_DEGREE (0x09)
#ifndef CONVERT_TO_EXT_ASCII //this time CONVERT_TO_EXT_ASCII works only with en, ru and uk languages
// map WESTERN code to the plain ASCII
{IV('Á'), 'A', 0}, // C1
{IV('Â'), 'A', 0}, // C2
{IV('Ã'), 'A', 0}, // C3
{IV('Ä'), 'A', 0}, // C4
{IV('Å'), 'A', 0}, // C5
{IV('Æ'), 'A', 'E'}, // C6
{IV('Ç'), 'C', 0}, // C7
{IV('È'), 'E', 0}, // C8
{IV('É'), 'E', 0}, // C9
{IV('Í'), 'I', 0}, // CD
{IV('Ñ'), 'N', 0}, // D1
{IV('Õ'), 'O', 0}, // D5
{IV('Ö'), 'O', 0}, // D6
{IV('×'), 'x', 0}, // D7
{IV('Ü'), 'U', 0}, // DC
{IV('Ý'), 'Y', 0}, // DD
{IV('à'), 'a', 0}, // E0
{IV('á'), 'a', 0},
{IV('â'), 'a', 0},
{IV('ã'), 'a', 0},
{IV('ä'), 'a', 0},
{IV('å'), 'a', 0},
{IV('æ'), 'a', 'e'},
{IV('ç'), 'c', 0},
{IV('è'), 'e', 0}, // 00E8
{IV('é'), 'e', 0},
{IV('ê'), 'e', 0},
{IV('ë'), 'e', 0},
{IV('ì'), 'i', 0}, // 00EC
{IV('í'), 'i', 0},
{IV('î'), 'i', 0},
{IV('ï'), 'i', 0}, // 00EF
{IV('ñ'), 'n', 0}, // 00F1
{IV('ò'), 'o', 0},
{IV('ó'), 'o', 0},
{IV('ô'), 'o', 0},
{IV('õ'), 'o', 0},
{IV('ö'), 'o', 0},
//{IV('÷'), 0xB8, 0},
{IV('ø'), 'o', 0},
{IV('ù'), 'u', 0},
{IV('ú'), 'u', 0},
{IV('û'), 'u', 0},
{IV('ü'), 'u', 0}, // FC
{IV('ý'), 'y', 0}, // FD
{IV('ÿ'), 'y', 0}, // FF
{IV('Ą'), 'A', 0}, // 0104
{IV('ą'), 'a', 0}, // 0105
{IV('Ć'), 'C', 0}, // 0106
{IV('ć'), 'c', 0}, // 0107
{IV('Č'), 'C', 0}, // 010C
{IV('č'), 'c', 0}, // 010D
{IV('Ď'), 'D', 0}, // 010E
{IV('ď'), 'd', 0}, // 010F
{IV('đ'), 'd', 0}, // 0111
{IV('ę'), 'e', 0}, // 0119
{IV('ğ'), 'g', 0}, // 011F
{IV('İ'), 'I', 0}, // 0130
{IV('ı'), 'i', 0}, // 0131
{IV('Ł'), 'L', 0}, // 0141
{IV('ł'), 'l', 0}, // 0142
{IV('Ń'), 'N', 0}, // 0143
{IV('ń'), 'n', 0}, // 0144
{IV('ň'), 'n', 0}, // 0148
{IV('ř'), 'r', 0}, // 0159
{IV('Ś'), 'S', 0}, // 015A
{IV('ś'), 's', 0}, // 015B
{IV('ş'), 's', 0}, // 015F
{IV('Š'), 'S', 0}, // 0160
{IV('š'), 's', 0}, // 0161
{IV('ť'), 't', 0}, // 0165
{IV('ů'), 'u', 0}, // 016F
{IV('ż'), 'z', 0}, // 017C
{IV('Ž'), 'Z', 0}, // 017D
{IV('ž'), 'z', 0}, // 017E
{IV('ƒ'), 'f', 0}, // 0192
{IV('ˣ'), 'x', 0}, // 02E3
{IV('΄'), '\'', 0}, // 0384
{IV('΅'), '\'', 0}, // 0385
{IV('Ά'), 'A', 0}, // 0386
{IV('·'), '.', 0}, // 0387
{IV('Έ'), 'E', 0}, // 0388
{IV('Ή'), 'H', 0}, // 0389
{IV('Ί'), 'I', 0}, // 038A
{IV('Ό'), 'O', 0}, // 038C
{IV('Ύ'), 'Y', 0}, // 038E
{IV('Ώ'), 'O', 0}, // 038F
{IV('ΐ'), 'i', 0}, // 0390
{IV('Α'), 'A', 0}, // 0391
{IV('Β'), 'B', 0}, // 0392
{IV('Γ'), 'T', 0}, // 0393, Gamma
{IV('Δ'), '4', 0}, // 0394, Delta, ◿
{IV('Ε'), 'E', 0}, // 0395
{IV('Ζ'), 'Z', 0}, // 0396
{IV('Η'), 'H', 0}, // 0397
{IV('Θ'), '0', 0}, // 0398, Theta
{IV('Ι'), 'I', 0}, // 0399
{IV('Κ'), 'K', 0}, // 039A
{IV('Λ'), '^', 0}, // 039B, Lambda
{IV('Μ'), 'M', 0}, // 039C
{IV('Ν'), 'N', 0}, // 039D
{IV('Ξ'), '3', 0}, // 039E, Xi
{IV('Ο'), 'O', 0}, // 039F
{IV('Π'), 'n', 0}, // 03A0, Pi
{IV('Ρ'), 'P', 0}, // 03A1
{IV('Σ'), 'E', 0}, // 03A3, Sigma
{IV('Τ'), 'T', 0}, // 03A4
{IV('Υ'), 'Y', 0}, // 03A5, Upsilon
{IV('Φ'), 'p', 0}, // 03A6, Phi
{IV('Χ'), 'X', 0}, // 03A7
{IV('Ψ'), 'P', 0}, // 03A8, Psi
{IV('Ω'), 'O', 0}, // 03A9, Omega
{IV('Ϊ'), 'I', 0}, // 03AA
{IV('Ϋ'), 'Y', 0}, // 03AB
{IV('ά'), 'a', 0}, // 03AC
{IV('έ'), 'e', 0}, // 03AD
{IV('ή'), 'n', 0}, // 03AE
{IV('ί'), 'i', 0}, // 03AF
{IV('ΰ'), 'v', 0}, // 03B0
{IV('α'), 'a', 0}, // 03B1, alpha
{IV('β'), 'B', 0}, // 03B2, beta
{IV('γ'), 'v', 0}, // 03B3, gamma
{IV('δ'), 'd', 0}, // 03B4, delta
{IV('ε'), 'e', 0}, // 03B5, epsilon
{IV('ζ'), 'Z', 0}, // 03B6, zeta
{IV('η'), 'n', 0}, // 03B7, eta
{IV('θ'), '0', 0}, // 03B8, theta
{IV('ι'), 'i', 0}, // 03B9, lota
{IV('κ'), 'k', 0}, // 03BA, kappa
{IV('λ'), 'L', 0}, // 03BB, lambda
{IV('μ'), 'u', 0}, // 03BC, mu
{IV('ν'), 'v', 0}, // 03BD, nu
{IV('ξ'), 'e', 0}, // 03BE, xi
{IV('ο'), 'o', 0}, // 03BF
{IV('π'), 'n', 0}, // 03C0, pi
{IV('ρ'), 'p', 0}, // 03C1, rho
{IV('ς'), 'c', 0}, // 03C2
{IV('σ'), 'o', 0}, // 03C3, sigma
{IV('τ'), 't', 0}, // 03C4, tau
{IV('υ'), 'v', 0}, // 03C5, upsilon
{IV('φ'), 'p', 0}, // 03C6
{IV('χ'), 'X', 0}, // 03C7, chi
{IV('ψ'), 'W', 0}, // 03C8, psi
{IV('ω'), 'w', 0}, // 03C9, omega
{IV('ϊ'), 'i', 0}, // 03CA
{IV('ϋ'), 'v', 0}, // 03CB
{IV('ό'), 'o', 0}, // 03CC
{IV('ύ'), 'v', 0}, // 03CD
{IV('ώ'), 'w', 0}, // 03CE
// map CYRILLIC code to the plain ASCII
{IV('А'), 'A', 0}, // 0410
{IV('Б'), 'b', 0}, // 0411
{IV('В'), 'B', 0}, // 0412
{IV('Г'), 'T', 0}, // 0413
{IV('Д'), 'Q', 0}, // 0414
{IV('Е'), 'E', 0}, // 0415
{IV('Ж'), '*', 0}, // 0416
{IV('З'), 'E', 0}, // 0417
{IV('И'), 'N', 0}, // 0418
{IV('Й'), 'N', 0}, // 0419
{IV('К'), 'K', 0}, // 041A
{IV('Л'), 'T', 0}, // 041B
{IV('М'), 'M', 0}, // 041C
{IV('Н'), 'H', 0}, // 041D
{IV('О'), 'O', 0}, // 041E
{IV('П'), 'n', 0}, // 041F
{IV('Р'), 'P', 0}, // 0420
{IV('С'), 'C', 0}, // 0421
{IV('Т'), 'T', 0}, // 0422
{IV('У'), 'Y', 0},
{IV('Ф'), 'o', 0},
{IV('Х'), 'X', 0},
{IV('Ц'), 'U', 0},
{IV('Ч'), 'y', 0},
{IV('Ш'), 'W', 0},
{IV('Щ'), 'W', 0},
{IV('Ъ'), 'b', 0},
{IV('Ы'), 'b', '|'},
{IV('Ь'), 'b'},
{IV('Э'), 'e'},
{IV('Ю'), '|', 'O'},
{IV('Я'), '9', '|'}, // 042F
{IV('а'), 'a', 0}, // 0430
{IV('б'), '6', 0}, // 0431
{IV('в'), 'B', 0}, // 0432,
{IV('г'), 'r', 0}, // 0433
{IV('д'), 'a', 0}, // 0434,
{IV('е'), 'e', 0}, // 0435
{IV('ж'), '*', 0}, // 0436
{IV('з'), 'e', 0}, // 0437,
{IV('и'), 'u', 0}, // 0438
{IV('й'), 'u', 0}, // 0439,
{IV('к'), 'k', 0}, // 043A
{IV('л'), 'n', 0},
{IV('м'), 'm', 0},
{IV('н'), 'H', 0},
{IV('о'), 'o', 0},
{IV('п'), 'n', 0},
{IV('р'), 'p', 0},
{IV('с'), 'c', 0},
{IV('т'), 't', 0},
{IV('у'), 'y', 0},
{IV('ф'), 'q', 'p'},
{IV('х'), 'x', 0},
{IV('ц'), 'u', 0},
{IV('ч'), 'y', 0},
{IV('ш'), 'w', 0},
{IV('щ'), 'w', 0},
{IV('ъ'), 'b', 0},
{IV('ы'), 'b', '|'},
{IV('ь'), 'b', 0},
{IV('э'), 'e', 0},
{IV('ю'), '|', 'o'},
{IV('я'), 'g', 0}, // 044F
#endif
{IV('•'), '.', 0}, // 2022 ·
{IV('℞'), 'P', 'x'}, // 211E ℞ Pt ASCII 158
{IV('™'), 'T', 'M'}, // 2122
{IV('←'), '<', '-'}, // 2190
{IV('→'), '-', '>'}, // 2192, Marlin special: '⮈⮉⮊⮋➤→⏵➟➠➡' LCD_STR_ARROW_RIGHT (0x03)
//{IV('↰'), '<', 0}, // 21B0, Marlin special: '⮥⮭⮉⇧↑↰⤴' LCD_STR_UPLEVEL (0x04)
{IV('↰'), 0x03, 0}, // 21B0, Marlin special: '⮥⮭⮉⇧↑↰⤴' LCD_STR_UPLEVEL (0x04)
{IV('↻'), 0x04, 0}, // 21BB Marlin special: '↻↺⟳⟲' LCD_STR_REFRESH (0x01)
{IV('∼'), '~', 0}, // 223C
{IV('≈'), '~', '='}, // 2248
{IV('≠'), '!', '='}, // 2260
{IV('≡'), '=', 0}, // 2261
{IV('≤'), '<', '='},// 2264, ≤≥ ⩽⩾
{IV('≥'), '>', '='}, // 2265
{IV('⏱'), 0x07, 0}, // 23F1, Marlin special: '🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛🕜🕝🕞🕟🕠🕡🕢🕣🕤🕥🕦🕧 ⌚⌛⏰⏱⏳⧖⧗' LCD_STR_CLOCK (0x05)
{IV('゠'), '=', 0}, // 30A0
// ⏰⏱⏲⏳◴◵◶◷
// ⏻⏼♁♂
//{IV(''), 0x00, 0}, // Marlin special: '' LCD_STR_BEDTEMP (0x07)
{IV('🌡'), 0x02, 0}, // D83CDF21 Marlin special: '🌡' LCD_STR_THERMOMETER (0x08)
{IV('📂'), 0x05, 0}, // D83DDCC2 Marlin special: '📁📂' LCD_STR_FOLDER (0x02)
//{IV(''), 0x06, 0}, // Marlin special: '' LCD_STR_FEEDRATE (0x06)
};
/* return v1 - v2 */
static int TFTGLCD_charmap_compare(TFTGLCD_charmap_t * v1, TFTGLCD_charmap_t * v2) {
return (v1->uchar < v2->uchar) ? -1 : (v1->uchar > v2->uchar) ? 1 : 0;
}
static int pf_bsearch_cb_comp_hd4map_pgm(void *userdata, size_t idx, void * data_pin) {
TFTGLCD_charmap_t localval;
TFTGLCD_charmap_t *p_TFTGLCD_charmap = (TFTGLCD_charmap_t *)userdata;
memcpy_P(&localval, p_TFTGLCD_charmap + idx, sizeof(localval));
return TFTGLCD_charmap_compare(&localval, (TFTGLCD_charmap_t *)data_pin);
}
void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row) { lcd.setCursor(col, row); }
void lcd_put_int(const int i) {
const char* str = i16tostr3left(i);
while (*str) lcd.write(*str++);
}
// return < 0 on error
// return the advanced cols
int lcd_put_lchar_max(const lchar_t &c, const pixel_len_t max_length) {
// find the HD44780 internal ROM first
int ret;
size_t idx = 0;
TFTGLCD_charmap_t pinval;
TFTGLCD_charmap_t *copy_address = nullptr;
pinval.uchar = c;
pinval.idx = -1;
if (max_length < 1) return 0;
if (c < 128) {
lcd.write((uint8_t)c);
return 1;
}
copy_address = nullptr;
ret = pf_bsearch_r((void *)g_TFTGLCD_charmap_device, COUNT(g_TFTGLCD_charmap_device), pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx);
if (ret >= 0) {
copy_address = (TFTGLCD_charmap_t *)(g_TFTGLCD_charmap_device + idx);
}
else {
ret = pf_bsearch_r((void *)g_TFTGLCD_charmap_common, COUNT(g_TFTGLCD_charmap_common), pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx);
if (ret >= 0) copy_address = (TFTGLCD_charmap_t *)(g_TFTGLCD_charmap_common + idx);
}
if (ret >= 0) {
TFTGLCD_charmap_t localval;
// found
memcpy_P(&localval, copy_address, sizeof(localval));
lcd.write(localval.idx);
if (max_length >= 2 && localval.idx2 > 0) {
lcd.write(localval.idx2);
return 2;
}
return 1;
}
// Not found, print '?' instead
lcd.write((uint8_t)'?');
return 1;
}
/**
* @brief Draw a UTF-8 string
*
* @param utf8_str : the UTF-8 string
* @param cb_read_byte : the callback function to read one byte from the utf8_str (from RAM or ROM)
* @param max_length : the pixel length of the string allowed (or number of slots in HD44780)
*
* @return the number of characters emitted
*
* Draw a UTF-8 string
*/
static int lcd_put_u8str_max_cb(const char * utf8_str, read_byte_cb_t cb_read_byte, const pixel_len_t max_length) {
pixel_len_t ret = 0;
const uint8_t *p = (uint8_t *)utf8_str;
while (ret < max_length) {
lchar_t wc;
p = get_utf8_value_cb(p, cb_read_byte, wc);
if (!wc) break;
ret += lcd_put_lchar_max(wc, max_length - ret);
}
return (int)ret;
}
int lcd_put_u8str_max(const char * utf8_str, const pixel_len_t max_length) {
return lcd_put_u8str_max_cb(utf8_str, read_byte_ram, max_length);
}
int lcd_put_u8str_max_P(PGM_P utf8_pstr, const pixel_len_t max_length) {
return lcd_put_u8str_max_cb(utf8_pstr, read_byte_rom, max_length);
}
#if ENABLED(DEBUG_LCDPRINT)
int test_TFTGLCD_charmap(TFTGLCD_charmap_t *data, size_t size, char *name, char flg_show_contents) {
int ret;
size_t idx = 0;
TFTGLCD_charmap_t preval = {0, 0, 0};
TFTGLCD_charmap_t pinval = {0, 0, 0};
char flg_error = 0;
int i;
TRACE("Test %s\n", name);
for (i = 0; i < size; i ++) {
memcpy_P(&pinval, &(data[i]), sizeof(pinval));
if (flg_show_contents) {
#if 1
TRACE("[% 4d] % 6" PRIu32 "(0x%04" PRIX32 ") --> 0x%02X,0x%02X%s\n", i, pinval.uchar, pinval.uchar, (unsigned int)(pinval.idx), (unsigned int)(pinval.idx2), (preval.uchar < pinval.uchar?"":" <--- ERROR"));
#else
TRACE("[% 4d]", i);
TRACE("% 6" PRIu32 "(0x%04" PRIX32 "),", pinval.uchar, pinval.uchar);
TRACE("0x%02X,", (unsigned int)(pinval.idx));
TRACE("0x%02X,", (unsigned int)(pinval.idx2));
TRACE("%s", (preval.uchar < pinval.uchar?"":" <--- ERROR"));
#endif
}
if (preval.uchar >= pinval.uchar) {
flg_error = 1;
//TRACE("Error: out of order in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar);
//return -1;
}
memcpy(&preval, &pinval, sizeof(pinval));
ret = pf_bsearch_r((void *)data, size, pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx);
if (ret < 0) {
flg_error = 1;
TRACE("Error: not found item in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar);
//return -1;
}
if (idx != i) {
flg_error = 1;
TRACE("Error: wrong index found item in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar);
//return -1;
}
}
if (flg_error) {
TRACE("\nError: in array %s\n\n", name);
return -1;
}
TRACE("\nPASS array %s\n\n", name);
return 0;
}
int test_TFTGLCD_charmap_all() {
int flg_error = 0;
if (test_TFTGLCD_charmap(g_TFTGLCD_charmap_device, COUNT(g_TFTGLCD_charmap_device), "g_TFTGLCD_charmap_device", 0) < 0) {
flg_error = 1;
test_TFTGLCD_charmap(g_TFTGLCD_charmap_device, COUNT(g_TFTGLCD_charmap_device), "g_TFTGLCD_charmap_device", 1);
}
if (test_TFTGLCD_charmap(g_TFTGLCD_charmap_common, COUNT(g_TFTGLCD_charmap_common), "g_TFTGLCD_charmap_common", 0) < 0) {
flg_error = 1;
test_TFTGLCD_charmap(g_TFTGLCD_charmap_common, COUNT(g_TFTGLCD_charmap_common), "g_TFTGLCD_charmap_common", 1);
}
if (flg_error) {
TRACE("\nFAILED in hd44780 tests!\n");
return -1;
}
TRACE("\nPASS in hd44780 tests.\n");
return 0;
}
#endif // DEBUG_LCDPRINT
#endif // IS_TFTGLCD_PANEL
|
2301_81045437/Marlin
|
Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp
|
C++
|
agpl-3.0
| 33,956
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include "../../inc/MarlinConfigPre.h"
#if IS_TFTGLCD_PANEL
/**
* marlinui_TFTGLCD.cpp
*
* Implementation of the LCD display routines for a TFT GLCD displays with external controller.
* This display looks like a REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER but has good text font
* and supports color output.
*/
#if NONE(__AVR__, TARGET_LPC1768, STM32F1, STM32F4xx)
#warning "Selected platform not yet tested. Please contribute your good pin mappings."
#endif
#if ENABLED(TFTGLCD_PANEL_SPI)
#include <SPI.h>
#else
#include <Wire.h>
#endif
#include "marlinui_TFTGLCD.h"
#include "../marlinui.h"
#include "../../libs/numtostr.h"
#include "../../sd/cardreader.h"
#include "../../module/temperature.h"
#include "../../module/printcounter.h"
#include "../../module/planner.h"
#include "../../module/motion.h"
#if DISABLED(LCD_PROGRESS_BAR) && ALL(FILAMENT_LCD_DISPLAY, HAS_MEDIA)
#include "../../feature/filwidth.h"
#include "../../gcode/parser.h"
#endif
#if ANY(HAS_COOLER, LASER_COOLANT_FLOW_METER)
#include "../../feature/cooler.h"
#endif
#if ENABLED(I2C_AMMETER)
#include "../../feature/ammeter.h"
#endif
#if HAS_CUTTER
#include "../../feature/spindle_laser.h"
#endif
#if ENABLED(AUTO_BED_LEVELING_UBL)
#include "../../feature/bedlevel/bedlevel.h"
#endif
TFTGLCD lcd;
#define ICON_LOGO B00000001
#define ICON_TEMP1 B00000010 // Hotend 1
#define ICON_TEMP2 B00000100 // Hotend 2
#define ICON_TEMP3 B00001000 // Hotend 3
#define ICON_BED B00010000
#define ICON_FAN B00100000
#define ICON_HOT B01000000 // When any T > 50deg
#define PIC_MASK 0x7F
// LEDs not used, for compatibility with Smoothieware
#define LED_HOTEND_ON B00000001
#define LED_BED_ON B00000010
#define LED_FAN_ON B00000100
#define LED_HOT B00001000
#define LED_MASK 0x0F
#define FBSIZE (LCD_WIDTH * LCD_HEIGHT + 2)
#define MIDDLE_Y ((LCD_HEIGHT - 1) / 2)
// Markers for change line colors
#define COLOR_EDIT '#'
#define COLOR_ERROR '!'
#ifdef CONVERT_TO_EXT_ASCII //use standard pseudographic symbols in ASCII table
#define LR 179 //vertical line
#define TRC 191 //top right corner
#define BLC 192 //bottom left corner
#define GL 196 //horizontal line
#define BRC 217 //bottom right corner, should be replaced to 12 for some languages
#define TLC 218 //top left corner, should be replaced to 13 for some languages
#else //next symbols must be present in panel font
#define LR 8 //equal to 179
#define TRC 9 //equal to 191
#define BLC 10 //equal to 192
#define GL 11 //equal to 196
#define BRC 12 //equal to 217
#define TLC 13 //equal to 218
#endif
#define Marlin 0x01
enum Commands { // based on Smoothieware commands
GET_SPI_DATA = 0,
READ_BUTTONS, // read buttons
READ_ENCODER, // read encoder
LCD_WRITE, // write all screen to LCD
BUZZER, // beep buzzer
CONTRAST, // set contrast (brightnes)
// Other commands... 0xE0 thru 0xFF
GET_LCD_ROW = 0xE0, // for detect panel
GET_LCD_COL, // reserved for compatibility with Smoothieware, not used
LCD_PUT, // write one line to LCD
CLR_SCREEN,
INIT_SCREEN = 0xFE // clear panel buffer
};
static unsigned char framebuffer[FBSIZE];
static unsigned char *fb;
static uint8_t cour_line;
static uint8_t picBits, ledBits, hotBits;
static uint8_t PanelDetected = 0;
// Different platforms use different SPI methods
#if ANY(__AVR__, TARGET_LPC1768, __STM32F1__, ARDUINO_ARCH_SAM, __SAMD51__, __MK20DX256__, __MK64FX512__)
#define SPI_SEND_ONE(V) SPI.transfer(V);
#define SPI_SEND_TWO(V) SPI.transfer16(V);
#elif ANY(STM32F4xx, STM32F1xx)
#define SPI_SEND_ONE(V) SPI.transfer(V, SPI_CONTINUE);
#define SPI_SEND_TWO(V) SPI.transfer16(V, SPI_CONTINUE);
#elif defined(ARDUINO_ARCH_ESP32)
#define SPI_SEND_ONE(V) SPI.write(V);
#define SPI_SEND_TWO(V) SPI.write16(V);
#endif
#if ANY(__AVR__, ARDUINO_ARCH_SAM, __SAMD51__, __MK20DX256__, __MK64FX512__)
#define SPI_SEND_SOME(V,L,Z) SPI.transfer(&V[Z], L);
#elif ANY(STM32F4xx, STM32F1xx)
#define SPI_SEND_SOME(V,L,Z) SPI.transfer(&V[Z], L, SPI_CONTINUE);
#elif ANY(TARGET_LPC1768, __STM32F1__, ARDUINO_ARCH_ESP32)
#define SPI_SEND_SOME(V,L,Z) do{ for (uint16_t i = 0; i < L; i++) SPI_SEND_ONE(V[(Z)+i]); }while(0)
#endif
// Constructor
TFTGLCD::TFTGLCD() {}
// Clear local buffer
void TFTGLCD::clear_buffer() {
memset(&framebuffer[0], ' ', FBSIZE - 2);
framebuffer[FBSIZE - 1] = framebuffer[FBSIZE - 2] = 0;
picBits = ledBits = 0;
}
// Clear panel's screen
void TFTGLCD::clr_screen() {
if (!PanelDetected) return;
#if ENABLED(TFTGLCD_PANEL_SPI)
WRITE(TFTGLCD_CS, LOW);
SPI_SEND_ONE(CLR_SCREEN);
WRITE(TFTGLCD_CS, HIGH);
#else
Wire.beginTransmission((uint8_t)LCD_I2C_ADDRESS); //set I2C device address
Wire.write(CLR_SCREEN);
Wire.endTransmission(); //transmit data
#endif
}
// Set new text cursor position
void TFTGLCD::setCursor(uint8_t col, uint8_t row) {
fb = &framebuffer[0] + col + row * LCD_WIDTH;
cour_line = row;
}
// Send char to buffer
void TFTGLCD::write(char c) {
*fb++ = c;
}
// Send text line to buffer
void TFTGLCD::print(const char *line) {
while (*line) *fb++ = *line++;
}
// For menu
void TFTGLCD::print_line() {
if (!PanelDetected) return;
#if ENABLED(TFTGLCD_PANEL_SPI)
WRITE(TFTGLCD_CS, LOW);
SPI_SEND_ONE(LCD_PUT);
SPI_SEND_ONE(cour_line);
SPI_SEND_SOME(framebuffer, LCD_WIDTH, cour_line * LCD_WIDTH);
WRITE(TFTGLCD_CS, HIGH);
#else
Wire.beginTransmission((uint8_t)LCD_I2C_ADDRESS); //set I2C device address
Wire.write(LCD_PUT);
Wire.write(cour_line);
Wire.write(&framebuffer[cour_line * LCD_WIDTH], LCD_WIDTH); //transfer 1 line to txBuffer
Wire.endTransmission(); //transmit data
safe_delay(1);
#endif
}
void TFTGLCD::print_screen() {
if (!PanelDetected) return;
framebuffer[FBSIZE - 2] = picBits & PIC_MASK;
framebuffer[FBSIZE - 1] = ledBits;
#if ENABLED(TFTGLCD_PANEL_SPI)
// Send all framebuffer to panel
WRITE(TFTGLCD_CS, LOW);
SPI_SEND_ONE(LCD_WRITE);
SPI_SEND_SOME(framebuffer, FBSIZE, 0);
WRITE(TFTGLCD_CS, HIGH);
#else
uint8_t r;
// Send framebuffer to panel by line
Wire.beginTransmission((uint8_t)LCD_I2C_ADDRESS);
// First line
Wire.write(LCD_WRITE);
Wire.write(&framebuffer[0], LCD_WIDTH);
Wire.endTransmission();
for (r = 1; r < (LCD_HEIGHT - 1); r++) {
Wire.beginTransmission((uint8_t)LCD_I2C_ADDRESS);
Wire.write(&framebuffer[r * LCD_WIDTH], LCD_WIDTH);
Wire.endTransmission();
}
// Last line
Wire.beginTransmission((uint8_t)LCD_I2C_ADDRESS);
Wire.write(&framebuffer[r * LCD_WIDTH], LCD_WIDTH);
Wire.write(&framebuffer[FBSIZE - 2], 2);
Wire.endTransmission();
#endif
}
void TFTGLCD::setContrast(uint16_t contrast) {
if (!PanelDetected) return;
#if ENABLED(TFTGLCD_PANEL_SPI)
WRITE(TFTGLCD_CS, LOW);
SPI_SEND_ONE(CONTRAST);
SPI_SEND_ONE((uint8_t)contrast);
WRITE(TFTGLCD_CS, HIGH);
#else
Wire.beginTransmission((uint8_t)LCD_I2C_ADDRESS);
Wire.write(CONTRAST);
Wire.write((uint8_t)contrast);
Wire.endTransmission();
#endif
}
extern volatile int8_t encoderDiff;
// Read buttons and encoder states
uint8_t MarlinUI::read_slow_buttons() {
if (!PanelDetected) return 0;
#if ENABLED(TFTGLCD_PANEL_SPI)
uint8_t b = 0;
WRITE(TFTGLCD_CS, LOW);
SPI_SEND_ONE(READ_ENCODER);
#ifndef STM32F4xx
WRITE(TFTGLCD_CS, LOW); // for delay
#endif
encoderDiff += SPI_SEND_ONE(READ_BUTTONS);
#ifndef STM32F4xx
WRITE(TFTGLCD_CS, LOW); // for delay
WRITE(TFTGLCD_CS, LOW);
#endif
b = SPI_SEND_ONE(GET_SPI_DATA);
WRITE(TFTGLCD_CS, HIGH);
return b;
#else
Wire.beginTransmission((uint8_t)LCD_I2C_ADDRESS);
Wire.write(READ_ENCODER);
Wire.endTransmission();
#ifdef __AVR__
Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, 2, 0, 0, 1);
#elif defined(STM32F1)
Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, (uint8_t)2);
#elif ANY(STM32F4xx, TARGET_LPC1768)
Wire.requestFrom(LCD_I2C_ADDRESS, 2);
#endif
encoderDiff += Wire.read();
return Wire.read(); //buttons
#endif
}
// Duration in ms, freq in Hz
void MarlinUI::buzz(const long duration, const uint16_t freq/*=0*/) {
if (!PanelDetected) return;
if (!sound_on) return;
#if ENABLED(TFTGLCD_PANEL_SPI)
WRITE(TFTGLCD_CS, LOW);
SPI_SEND_ONE(BUZZER);
SPI_SEND_TWO((uint16_t)duration);
SPI_SEND_TWO(freq);
WRITE(TFTGLCD_CS, HIGH);
#else
Wire.beginTransmission((uint8_t)LCD_I2C_ADDRESS);
Wire.write(BUZZER);
Wire.write((uint8_t)(duration >> 8));
Wire.write((uint8_t)duration);
Wire.write((uint8_t)(freq >> 8));
Wire.write((uint8_t)freq);
Wire.endTransmission();
#endif
}
void MarlinUI::init_lcd() {
uint8_t t;
lcd.clear_buffer();
t = 0;
#if ENABLED(TFTGLCD_PANEL_SPI)
// SPI speed must be less 10MHz
SET_OUTPUT(TFTGLCD_CS);
WRITE(TFTGLCD_CS, HIGH);
spiInit(TERN(__STM32F1__, SPI_QUARTER_SPEED, SPI_FULL_SPEED));
WRITE(TFTGLCD_CS, LOW);
SPI_SEND_ONE(GET_LCD_ROW);
t = SPI_SEND_ONE(GET_SPI_DATA);
#else
#ifdef TARGET_LPC1768
Wire.begin(); //init twi/I2C
#else
Wire.begin((uint8_t)LCD_I2C_ADDRESS); //init twi/I2C
#endif
Wire.beginTransmission((uint8_t)LCD_I2C_ADDRESS);
Wire.write((uint8_t)GET_LCD_ROW); // put command to buffer
Wire.endTransmission(); // send buffer
#ifdef __AVR__
Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, 1, 0, 0, 1);
#elif ANY(STM32F1, STM32F4xx, TARGET_LPC1768)
Wire.requestFrom(LCD_I2C_ADDRESS, 1);
#endif
t = (uint8_t)Wire.read();
#endif
if (t == LCD_HEIGHT) {
PanelDetected = 1;
#if ENABLED(TFTGLCD_PANEL_SPI)
SPI_SEND_ONE(INIT_SCREEN);
SPI_SEND_ONE(Marlin);
WRITE(TFTGLCD_CS, HIGH);
#else
Wire.beginTransmission((uint8_t)LCD_I2C_ADDRESS);
Wire.write((uint8_t)INIT_SCREEN);
Wire.write(Marlin);
Wire.endTransmission();
#endif
}
else
PanelDetected = 0;
safe_delay(100);
}
bool MarlinUI::detected() {
return PanelDetected;
}
void MarlinUI::clear_lcd() {
if (!PanelDetected) return;
lcd.clr_screen();
lcd.clear_buffer();
}
#if HAS_LCD_CONTRAST
void MarlinUI::_set_contrast() { lcd.setContrast(contrast); }
#endif
#if !IS_TFTGLCD_PANEL
void lcd_moveto(const uint8_t col, const uint8_t row) { lcd.setCursor(col, row); }
#endif
static void center_text(FSTR_P const fstart, const uint8_t y) {
const uint8_t len = utf8_strlen(fstart);
lcd_moveto(len < LCD_WIDTH ? (LCD_WIDTH - len) / 2 : 0, y);
lcd_put_u8str(fstart);
}
#if ENABLED(SHOW_BOOTSCREEN)
void MarlinUI::show_bootscreen() {
if (!PanelDetected) return;
//
// Show the Marlin logo, splash line1, and splash line 2
//
uint8_t indent = (LCD_WIDTH - 8) / 2;
// symbols 217 (bottom right corner) and 218 (top left corner) are using for letters in some languages
// and they should be moved to beginning ASCII table as special symbols
lcd_moveto(indent, 0); lcd.write(TLC); lcd_put_u8str(F("------")); lcd.write(TRC);
lcd_moveto(indent, 1); lcd.write(LR); lcd_put_u8str(F("Marlin")); lcd.write(LR);
lcd_moveto(indent, 2); lcd.write(BLC); lcd_put_u8str(F("------")); lcd.write(BRC);
center_text(F(SHORT_BUILD_VERSION), 3);
center_text(F(MARLIN_WEBSITE_URL), 4);
picBits = ICON_LOGO;
lcd.print_screen();
}
void MarlinUI::bootscreen_completion(const millis_t sofar) {
if ((BOOTSCREEN_TIMEOUT) > sofar) safe_delay((BOOTSCREEN_TIMEOUT) - sofar);
}
#endif // SHOW_BOOTSCREEN
void MarlinUI::draw_kill_screen() {
if (!PanelDetected) return;
lcd.clear_buffer();
lcd_moveto(0, 3); lcd.write(COLOR_ERROR);
lcd_moveto((LCD_WIDTH - status_message.glyphs()) / 2 + 1, 3);
lcd_put_u8str(status_message);
center_text(GET_TEXT_F(MSG_HALTED), 5);
center_text(GET_TEXT_F(MSG_PLEASE_RESET), 6);
lcd.print_screen();
}
//
// Before homing, blink '123' <-> '???'.
// Homed but unknown... '123' <-> ' '.
// Homed and known, display constantly.
//
FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink) {
lcd.write('X' + uint8_t(axis));
if (blink)
lcd.print(value);
else if (axis_should_home(axis))
while (const char c = *value++) lcd.write(c <= '.' ? c : '?');
else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !axis_is_trusted(axis))
lcd_put_u8str(axis == Z_AXIS ? F(" ") : F(" "));
else
lcd_put_u8str(value);
}
#if HAS_HOTEND || HAS_HEATED_BED
FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char *prefix, const bool blink) {
uint8_t pic_hot_bits;
#if HAS_HEATED_BED
const bool isBed = heater_id < 0;
const celsius_t t1 = (isBed ? thermalManager.wholeDegBed() : thermalManager.wholeDegHotend(heater_id)),
t2 = (isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater_id));
#else
const celsius_t t1 = thermalManager.wholeDegHotend(heater_id), t2 = thermalManager.degTargetHotend(heater_id);
#endif
#if HOTENDS < 2
if (heater_id == H_E0) {
lcd_moveto(2, 5); lcd.print(prefix); //HE
lcd_moveto(1, 6); lcd.print(i16tostr3rj(t1));
lcd_moveto(1, 7);
}
else {
lcd_moveto(6, 5); lcd.print(prefix); //BED
lcd_moveto(6, 6); lcd.print(i16tostr3rj(t1));
lcd_moveto(6, 7);
}
#else
if (heater_id > H_BED) {
lcd_moveto(heater_id * 4, 5); lcd.print(prefix); // HE1 or HE2 or HE3
lcd_moveto(heater_id * 4, 6); lcd.print(i16tostr3rj(t1));
lcd_moveto(heater_id * 4, 7);
}
else {
lcd_moveto(13, 5); lcd.print(prefix); //BED
lcd_moveto(13, 6); lcd.print(i16tostr3rj(t1));
lcd_moveto(13, 7);
}
#endif // HOTENDS <= 1
#if !HEATER_IDLE_HANDLER
UNUSED(blink);
#else
if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out) {
lcd.write(' ');
if (t2 >= 10) lcd.write(' ');
if (t2 >= 100) lcd.write(' ');
}
else
#endif // !HEATER_IDLE_HANDLER
lcd.print(i16tostr3rj(t2));
switch (heater_id) {
case H_BED: pic_hot_bits = ICON_BED; break;
case H_E0: pic_hot_bits = ICON_TEMP1; break;
case H_E1: pic_hot_bits = ICON_TEMP2; break;
case H_E2: pic_hot_bits = ICON_TEMP3;
default: break;
}
if (t2) picBits |= pic_hot_bits;
else picBits &= ~pic_hot_bits;
if (t1 > 50) hotBits |= pic_hot_bits;
else hotBits &= ~pic_hot_bits;
if (hotBits) picBits |= ICON_HOT;
else picBits &= ~ICON_HOT;
}
#endif // HAS_HOTEND || HAS_HEATED_BED
#if HAS_COOLER
FORCE_INLINE void _draw_cooler_status(const bool blink) {
const celsius_t t2 = thermalManager.degTargetCooler();
lcd_moveto(0, 5); lcd_put_u8str(F("COOL"));
lcd_moveto(1, 6); lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegCooler()));
lcd_moveto(1, 7);
#if !HEATER_IDLE_HANDLER
UNUSED(blink);
#else
if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out)
lcd_put_u8str(F(" "));
else
#endif
lcd_put_u8str(i16tostr3left(t2));
lcd_put_u8str(F(" "));
if (t2 < 10) lcd_put_u8str(F(" "));
if (t2) picBits |= ICON_TEMP1;
else picBits &= ~ICON_TEMP1;
}
#endif // HAS_COOLER
#if ENABLED(LASER_COOLANT_FLOW_METER)
FORCE_INLINE void _draw_flowmeter_status() {
lcd_moveto(5, 5); lcd_put_u8str(F("FLOW"));
lcd_moveto(7, 6); lcd_put_u8str(F("L"));
lcd_moveto(6, 7); lcd_put_u8str(ftostr11ns(cooler.flowrate));
if (cooler.flowrate) picBits |= ICON_FAN;
else picBits &= ~ICON_FAN;
}
#endif
#if ENABLED(I2C_AMMETER)
FORCE_INLINE void _draw_ammeter_status() {
lcd_moveto(10, 5); lcd_put_u8str(F("ILAZ"));
ammeter.read();
lcd_moveto(11, 6);
if (ammeter.current <= 0.999f)
{
lcd_put_u8str("mA");
lcd_moveto(10, 7);
lcd_put_u8str(F(" ")); lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f)));
}
else {
lcd_put_u8str(" A");
lcd_moveto(10, 7);
lcd_put_u8str(ftostr12ns(ammeter.current));
}
if (ammeter.current) picBits |= ICON_BED;
else picBits &= ~ICON_BED;
}
#endif // I2C_AMMETER
#if HAS_CUTTER
FORCE_INLINE void _draw_cutter_status() {
lcd_moveto(15, 5); lcd_put_u8str(F("CUTT"));
#if CUTTER_UNIT_IS(RPM)
lcd_moveto(16, 6); lcd_put_u8str(F("RPM"));
lcd_moveto(15, 7); lcd_put_u8str(ftostr31ns(float(cutter.unitPower) / 1000));
lcd_put_u8str(F("K"));
#elif CUTTER_UNIT_IS(PERCENT)
lcd_moveto(17, 6); lcd_put_u8str(F("%"));
lcd_moveto(18, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower));
#else
lcd_moveto(17, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower));
#endif
if (cutter.unitPower) picBits |= ICON_HOT;
else picBits &= ~ICON_HOT;
}
#endif // HAS_CUTTER
#if HAS_PRINT_PROGRESS // UNTESTED!!!
#define TPOFFSET (LCD_WIDTH - 1)
static uint8_t timepos = TPOFFSET - 6;
#if ENABLED(SHOW_PROGRESS_PERCENT)
void MarlinUI::drawPercent() {
const uint8_t progress = ui.get_progress_percent();
if (progress) {
lcd_moveto(0, 2);
lcd_put_u8str(F(TERN(IS_SD_PRINTING, "SD", "P:")));
lcd.print(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui8tostr3rj(progress)));
lcd.write('%');
}
}
#endif
#if ENABLED(SHOW_REMAINING_TIME)
void MarlinUI::drawRemain() {
if (printJobOngoing()) {
const duration_t remaint = ui.get_remaining_time();
char buffer[10];
timepos = TPOFFSET - remaint.toDigital(buffer);
lcd_moveto(timepos, 1);
lcd.write('R');
lcd.print(buffer);
}
}
#endif
#if ENABLED(SHOW_INTERACTION_TIME)
void MarlinUI::drawInter() {
const duration_t interactt = ui.interaction_time;
if (printingIsActive() && interactt.value) {
char buffer[10];
timepos = TPOFFSET - interactt.toDigital(buffer);
lcd_moveto(timepos, 1);
lcd.write('C');
lcd.print(buffer);
}
}
#endif
#if ENABLED(SHOW_ELAPSED_TIME)
void MarlinUI::drawElapsed() {
if (printJobOngoing()) {
const duration_t elapsedt = print_job_timer.duration();
char buffer[10];
timepos = TPOFFSET - elapsedt.toDigital(buffer);
lcd_moveto(timepos, 1);
lcd.write('E');
lcd.print(buffer);
}
}
#endif
#endif // HAS_PRINT_PROGRESS
#if ENABLED(LCD_PROGRESS_BAR)
void MarlinUI::draw_progress_bar(const uint8_t percent) {
if (!PanelDetected) return;
if (fb == &framebuffer[0] + LCD_WIDTH * 2) { // For status screen
lcd.write('%'); lcd.write(percent);
}
else { // For progress bar test
lcd_moveto(LCD_WIDTH / 2 - 2, MIDDLE_Y);
lcd.print(i16tostr3rj(percent)); lcd.write('%');
lcd.print_line();
lcd_moveto(0, MIDDLE_Y + 1);
lcd.write('%'); lcd.write(percent);
lcd.print_line();
}
}
#endif // LCD_PROGRESS_BAR
void MarlinUI::draw_status_message(const bool blink) {
if (!PanelDetected) return;
lcd_moveto(0, 3);
#if ALL(FILAMENT_LCD_DISPLAY, HAS_MEDIA)
// Alternate Status message and Filament display
if (ELAPSED(millis(), next_filament_display)) {
lcd_put_u8str(F("Dia "));
lcd.print(ftostr12ns(filament_width_meas));
lcd_put_u8str(F(" V"));
lcd.print(i16tostr3rj(100.0 * (
parser.volumetric_enabled
? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
: planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
)
));
lcd.write('%');
return;
}
#endif // FILAMENT_LCD_DISPLAY && HAS_MEDIA
// Get the UTF8 character count of the string
uint8_t slen = status_message.glyphs();
#if ENABLED(STATUS_MESSAGE_SCROLLING)
static bool last_blink = false;
// If the string fits into the LCD, just print it and do not scroll it
if (slen <= LCD_WIDTH) {
// The string isn't scrolling and may not fill the screen
lcd_put_u8str(status_message);
// Fill the rest with spaces
while (slen < LCD_WIDTH) { lcd.write(' '); ++slen; }
}
else {
// String is larger than the available space in screen.
// Get a pointer to the next valid UTF8 character
// and the string remaining length
uint8_t rlen;
const char *stat = status_and_len(rlen);
lcd_put_u8str_max(stat, LCD_WIDTH); // The string leaves space
// If the remaining string doesn't completely fill the screen
if (rlen < LCD_WIDTH) {
uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters
lcd.write(' '); // Always at 1+ spaces left, draw a space
if (--chars) { // Draw a second space if there's room
lcd.write(' ');
if (--chars) { // Draw a third space if there's room
lcd.write(' ');
if (--chars)
lcd_put_u8str_max(status_message, chars); // Print a second copy of the message
}
}
}
if (last_blink != blink) {
last_blink = blink;
advance_status_scroll();
}
}
#else
UNUSED(blink);
// Just print the string to the LCD
lcd_put_u8str_max(status_message, LCD_WIDTH);
// Fill the rest with spaces if there are missing spaces
while (slen < LCD_WIDTH) {
lcd.write(' ');
++slen;
}
#endif
}
/**
Possible status screens:
Equal to 20x10 text LCD
|X 000 Y 000 Z 000.00|
|FR100% SD100% C--:--|
| Progress bar line |
|Status message |
| |
| HE BED FAN |
| ttc ttc % | ttc - current temperature
| tts tts %%% | tts - set temperature, %%% - percent for FAN
| ICO ICO ICO ICO | ICO - icon 48x48, placed in 2 text lines
| ICO ICO ICO ICO | ICO
or
|X 000 Y 000 Z 000.00|
|FR100% SD100% C--:--|
| Progress bar line |
|Status message |
| |
|HE1 HE2 HE3 BED ICO|
|ttc ttc ttc ttc ICO|
|tts tts tts tts %%%|
|ICO ICO ICO ICO ICO|
|ICO ICO ICO ICO ICO|
or
|X 000 Y 000 Z 000.00|
|FR100% SD100% C--:--|
| Progress bar line |
|Status message |
| |
|COOL FLOW ILAZ CUTT |
| ttc L mA RPM |
| tts f.f aaa rr.rK|
| ICO ICO ICO ICO |
| ICO ICO ICO ICO |
or
Equal to 24x10 text LCD
|X 000 Y 000 Z 000.00 |
|FR100% SD100% C--:--|
| Progress bar line |
|Status message |
| |
|HE1 HE2 HE3 BED FAN |
|ttc ttc ttc ttc % |
|tts tts tts tts %%% |
|ICO ICO ICO ICO ICO ICO|
|ICO ICO ICO ICO ICO ICO|
*/
void MarlinUI::draw_status_screen() {
if (!PanelDetected) return;
const bool blink = get_blink();
lcd.clear_buffer();
//
// Line 1 - XYZ coordinates
//
#if NUM_AXES
lcd_moveto(0, 0);
const xyz_pos_t lpos = current_position.asLogical();
_draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink);
#if HAS_Y_AXIS
lcd.write(' '); _draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink);
#endif
#if HAS_Z_AXIS
lcd.write(' '); _draw_axis_value(Z_AXIS, ftostr52sp(lpos.z), blink);
#endif
#endif
#if HAS_LEVELING && !HAS_HEATED_BED
lcd.write(planner.leveling_active || blink ? '_' : ' ');
#endif
//
// Line 2 - feedrate, progress %, progress time
//
lcd_moveto(0, 1);
lcd_put_u8str(F("FR")); lcd.print(i16tostr3rj(feedrate_percentage)); lcd.write('%');
ui.rotate_progress(); // UNTESTED!!!
//
// Line 3 - progressbar
//
lcd_moveto(0, 2);
#if ENABLED(LCD_PROGRESS_BAR)
draw_progress_bar(_get_progress());
#else
lcd.write('%'); lcd.write(0);
#endif
//
// Line 4 - Status Message (which may be a Filament display)
//
draw_status_message(blink);
//
// Line 5
//
#if HOTENDS <= 1 || (HOTENDS <= 2 && !HAS_HEATED_BED)
#if HAS_DUAL_MIXING
lcd_moveto(0, 4);
// Two-component mix / gradient instead of XY
char mixer_messages[15];
PGM_P mix_label;
#if ENABLED(GRADIENT_MIX)
if (mixer.gradient.enabled) {
mixer.update_mix_from_gradient();
mix_label = PSTR("Gr");
}
else
#endif
{
mixer.update_mix_from_vtool();
mix_label = PSTR("Mx");
}
sprintf_P(mixer_messages, PSTR(S_FMT " %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1]));
lcd_put_u8str(mixer_messages);
#endif
#endif
//
// Line 6..8 Temperatures, FAN for printer or Cooler, Flowmetter, Ampermeter, Cutter for laser/spindle
//
#if HAS_HOTEND
#if HOTENDS < 2
_draw_heater_status(H_E0, "HE", blink); // Hotend Temperature
#else
_draw_heater_status(H_E0, "HE1", blink); // Hotend 1 Temperature
_draw_heater_status(H_E1, "HE2", blink); // Hotend 2 Temperature
#if HOTENDS > 2
_draw_heater_status(H_E2, "HE3", blink); // Hotend 3 Temperature
#endif
#endif
#if HAS_HEATED_BED
#if HAS_LEVELING
_draw_heater_status(H_BED, (planner.leveling_active && blink ? "___" : "BED"), blink);
#else
_draw_heater_status(H_BED, "BED", blink);
#endif
#endif
#if HAS_FAN
uint16_t spd = thermalManager.fan_speed[0];
#if ENABLED(ADAPTIVE_FAN_SLOWING)
if (!blink) spd = thermalManager.scaledFanSpeed(0, spd);
#endif
uint16_t per = thermalManager.pwmToPercent(spd);
#if HOTENDS < 2
#define FANX 11
#else
#define FANX 17
#endif
lcd_moveto(FANX, 5); lcd_put_u8str(F("FAN"));
lcd_moveto(FANX + 1, 6); lcd.write('%');
lcd_moveto(FANX, 7);
lcd.print(i16tostr3rj(per));
if (TERN0(HAS_FAN0, thermalManager.fan_speed[0]) || TERN0(HAS_FAN1, thermalManager.fan_speed[1]) || TERN0(HAS_FAN2, thermalManager.fan_speed[2]))
picBits |= ICON_FAN;
else
picBits &= ~ICON_FAN;
#endif // HAS_FAN
#else
TERN_(HAS_COOLER, _draw_cooler_status(blink));
TERN_(LASER_COOLANT_FLOW_METER, _draw_flowmeter_status());
TERN_(I2C_AMMETER, _draw_ammeter_status());
TERN_(HAS_CUTTER, _draw_cutter_status());
#endif
//
// Line 9, 10 - icons
//
lcd.print_screen();
}
#if HAS_MARLINUI_MENU
#include "../menu/menu.h"
#if ENABLED(ADVANCED_PAUSE_FEATURE)
void MarlinUI::draw_hotend_status(const uint8_t row, const uint8_t extruder) {
if (!PanelDetected) return;
lcd_moveto((LCD_WIDTH - 14) / 2, row + 1);
lcd.write(LCD_STR_THERMOMETER[0]); lcd_put_u8str(F(" E")); lcd.write('1' + extruder); lcd.write(' ');
lcd.print(i16tostr3rj(thermalManager.wholeDegHotend(extruder))); lcd.write(LCD_STR_DEGREE[0]); lcd.write('/');
lcd.print(i16tostr3rj(thermalManager.degTargetHotend(extruder))); lcd.write(LCD_STR_DEGREE[0]);
lcd.print_line();
}
#endif
// Draw a static item with no left-right margin required. Centered by default.
void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style/*=SS_DEFAULT*/, const char *vstr/*=nullptr*/) {
if (!PanelDetected) return;
lcd_moveto(0, row);
uint8_t n = LCD_WIDTH;
const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL);
// Value length, if any
int8_t vlen = vstr ? utf8_strlen(vstr) : 0;
char estr[utf8_strlen(ftpl) + 3] = "\0";
int8_t llen = ftpl ? expand_u8str(estr, ftpl, itemIndex, itemStringC, itemStringF, n - vlen) : 0;
bool mv_colon = false;
if (vlen && !center) {
// Move the leading colon from the value to the label below
mv_colon = (*vstr == ':');
// Shorter value, wider label
if (mv_colon) { vstr++; vlen--; llen++; }
// Remove leading spaces from the value and shorten
while (*vstr == ' ') { vstr++; vlen--; }
}
int8_t pad = (center || full) ? n - llen - vlen : 0;
// SS_CENTER: Pad with half of the unused space first
if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad) { lcd.write(' '); n--; }
// Draw as much of the label as fits
if (llen) n -= lcd_put_u8str_max(estr, n - vlen);
if (vlen && n > 0) {
// SS_FULL: Pad with enough space to justify the value
if (full && !center) {
// Move the leading colon from the value to the label
if (mv_colon) { lcd.write(':'); n--; }
// Pad in-between
for (; pad > 0; --pad) { lcd.write(' '); n--; }
}
n -= lcd_put_u8str_max(vstr, n);
}
for (; n > 0; --n) lcd.write(' ');
lcd.print_line();
}
// Draw a generic menu item with pre_char (if selected) and post_char
void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char pre_char, const char post_char) {
if (!PanelDetected) return;
lcd_moveto(0, row);
lcd.write(sel ? pre_char : ' ');
uint8_t n = LCD_WIDTH - 2;
n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n);
for (; n; --n) lcd.write(' ');
lcd.write(post_char);
lcd.print_line();
}
// Draw a menu item with a (potentially) editable value
void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char * const inStr, const bool pgm) {
if (!PanelDetected) return;
const uint8_t vlen = inStr ? (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)) : 0;
lcd_moveto(0, row);
lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
uint8_t n = LCD_WIDTH - 2 - vlen;
n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n);
if (vlen) {
lcd.write(':');
for (; n; --n) lcd.write(' ');
if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr);
}
lcd.print_line();
}
// Low-level draw_edit_screen can be used to draw an edit screen from anyplace
// This line moves to the last line of the screen for UBL plot screen on the panel side
void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) {
if (!PanelDetected) return;
ui.encoder_direction_normal();
const uint8_t y = TERN0(AUTO_BED_LEVELING_UBL, ui.external_control) ? LCD_HEIGHT - 1 : MIDDLE_Y;
lcd_moveto(0, y);
lcd.write(COLOR_EDIT);
lcd_put_u8str(fstr);
if (value) {
lcd.write(':');
lcd_moveto((LCD_WIDTH - 1) - (utf8_strlen(value) + 1), y); // Right-justified, padded by spaces
lcd.write(' '); // Overwrite char if value gets shorter
lcd.print(value);
lcd.write(' ');
lcd.print_line();
}
}
// The Select Screen presents a prompt and two "buttons"
void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const fpre, const char * const string, FSTR_P const fsuf) {
if (!PanelDetected) return;
ui.draw_select_screen_prompt(fpre, string, fsuf);
lcd.write(COLOR_EDIT);
if (no) {
lcd_moveto(0, MIDDLE_Y);
lcd.write(yesno ? ' ' : '['); lcd_put_u8str(no); lcd.write(yesno ? ' ' : ']');
}
if (yes) {
lcd_moveto(LCD_WIDTH - utf8_strlen(yes) - 3, MIDDLE_Y);
lcd.write(yesno ? '[' : ' '); lcd_put_u8str(yes); lcd.write(yesno ? ']' : ' ');
}
lcd.print_line();
}
#if HAS_MEDIA
void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) {
if (!PanelDetected) return;
lcd_moveto(0, row);
lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
uint8_t n = LCD_WIDTH - 2;
n -= lcd_put_u8str_max(ui.scrolled_filename(theCard, n, row, sel), n);
for (; n; --n) lcd.write(' ');
lcd.write(isDir ? LCD_STR_FOLDER[0] : ' ');
lcd.print_line();
}
#endif // HAS_MEDIA
#if ENABLED(LCD_HAS_STATUS_INDICATORS)
void MarlinUI::update_indicators() {}
#endif // LCD_HAS_STATUS_INDICATORS
#if ENABLED(AUTO_BED_LEVELING_UBL)
/**
* Map screen:
* |/---------\ (00,00) |
* || . . . . | X:000.00|
* || . . . . | Y:000.00|
* || . . . . | Z:00.000|
* || . . . . | |
* || . . . . | |
* || . . . . | |
* |+---------/ |
* | |
* |____________________|
*/
void MarlinUI::ubl_plot(const uint8_t x_plot, const uint8_t y_plot) {
if (!PanelDetected) return;
#define _LCD_W_POS 12
lcd.clear_buffer();
//print only top left corner. All frame with grid points will be printed by panel
lcd_moveto(0, 0);
*fb++ = TLC; //top left corner - marker for plot parameters
*fb = (GRID_MAX_POINTS_X << 4) + GRID_MAX_POINTS_Y; //set mesh size
// Print plot position
lcd_moveto(_LCD_W_POS, 0);
*fb++ = '('; lcd.print(i16tostr3left(x_plot));
*fb++ = ','; lcd.print(i16tostr3left(y_plot)); *fb = ')';
// Show all values
lcd_moveto(_LCD_W_POS, 1); lcd_put_u8str(F("X:"));
lcd.print(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&bedlevel._mesh_index_to_xpos[x_plot]))));
lcd_moveto(_LCD_W_POS, 2); lcd_put_u8str(F("Y:"));
lcd.print(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&bedlevel._mesh_index_to_ypos[y_plot]))));
// Show the location value
lcd_moveto(_LCD_W_POS, 3); lcd_put_u8str(F("Z:"));
if (!isnan(bedlevel.z_values[x_plot][y_plot]))
lcd.print(ftostr43sign(bedlevel.z_values[x_plot][y_plot]));
else
lcd_put_u8str(F(" -----"));
center_text(GET_TEXT_F(MSG_UBL_FINE_TUNE_MESH), 8);
lcd.print_screen();
}
#endif // AUTO_BED_LEVELING_UBL
#endif // HAS_MARLINUI_MENU
#endif // IS_TFTGLCD_PANEL
|
2301_81045437/Marlin
|
Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp
|
C++
|
agpl-3.0
| 35,132
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#pragma once
/**
* Implementation of the LCD display routines for a TFT GLCD displays with external controller.
*/
#include "../../inc/MarlinConfig.h"
#if IS_TFTGLCD_PANEL
#include "../../libs/duration_t.h"
////////////////////////////////////
// Set up button and encode mappings for each panel (into 'buttons' variable)
//
// This is just to map common functions (across different panels) onto the same
// macro name. The mapping is independent of whether the button is directly connected or
// via a shift/i2c register.
////////////////////////////////////
// Create LCD class instance and chipset-specific information
class TFTGLCD {
private:
public:
TFTGLCD();
void clear_buffer();
void clr_screen();
void setCursor(uint8_t col, uint8_t row);
void write(char c);
void print(const char *line);
void print_line();
void print_screen();
void redraw_screen();
void setContrast(uint16_t contrast);
};
extern TFTGLCD lcd;
#include "../lcdprint.h"
// Use panel encoder - free old encoder pins
#undef BTN_EN1
#undef BTN_EN2
#undef BTN_ENC
#ifndef EN_C
#define EN_C 4 // for click
#endif
#endif // IS_TFTGLCD_PANEL
|
2301_81045437/Marlin
|
Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.h
|
C++
|
agpl-3.0
| 2,037
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#pragma once
#include "../inc/MarlinConfig.h"
#if ((!HAS_ADC_BUTTONS && IS_NEWPANEL) || BUTTONS_EXIST(EN1, EN2)) && !IS_TFTGLCD_PANEL
#define HAS_MARLINUI_ENCODER 1
#endif
#if (HAS_MARLINUI_ENCODER || ANY_BUTTON(ENC, BACK, UP, DOWN, LEFT, RIGHT)) && DISABLED(TOUCH_UI_FTDI_EVE)
#define HAS_DIGITAL_BUTTONS 1
#endif
#if !HAS_ADC_BUTTONS && (IS_RRW_KEYPAD || (HAS_WIRED_LCD && !IS_NEWPANEL))
#define HAS_SHIFT_ENCODER 1
#endif
// I2C buttons must be read in the main thread
#if ANY(LCD_I2C_VIKI, LCD_I2C_PANELOLU2, IS_TFTGLCD_PANEL)
#define HAS_SLOW_BUTTONS 1
#endif
#if ANY(HAS_DIGITAL_BUTTONS, HAS_DWIN_E3V2)
// Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes)
#define BLEN_A 0
#define BLEN_B 1
#define EN_A _BV(BLEN_A)
#define EN_B _BV(BLEN_B)
#define _BUTTON_PRESSED(BN) !READ(BTN_##BN)
#if BUTTON_EXISTS(ENC) || HAS_TOUCH_BUTTONS
#define BLEN_C 2
#define EN_C _BV(BLEN_C)
#endif
#if ENABLED(LCD_I2C_VIKI)
#include <LiquidTWI2.h>
#define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
// button and encoder bit positions within 'buttons'
#define B_LE (BUTTON_LEFT << B_I2C_BTN_OFFSET) // The remaining normalized buttons are all read via I2C
#define B_UP (BUTTON_UP << B_I2C_BTN_OFFSET)
#define B_MI (BUTTON_SELECT << B_I2C_BTN_OFFSET)
#define B_DW (BUTTON_DOWN << B_I2C_BTN_OFFSET)
#define B_RI (BUTTON_RIGHT << B_I2C_BTN_OFFSET)
#if BUTTON_EXISTS(ENC) // The pause/stop/restart button is connected to BTN_ENC when used
#define B_ST (EN_C) // Map the pause/stop/resume button into its normalized functional name
#define BUTTON_CLICK() (buttons & (B_MI|B_RI|B_ST)) // Pause/stop also acts as click until a proper pause/stop is implemented.
#else
#define BUTTON_CLICK() (buttons & (B_MI|B_RI))
#endif
// I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
#elif ENABLED(LCD_I2C_PANELOLU2)
#if !BUTTON_EXISTS(ENC) // Use I2C if not directly connected to a pin
#define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
#define B_MI (PANELOLU2_ENCODER_C << B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later
#define BUTTON_CLICK() (buttons & B_MI)
#endif
#endif
#else
#undef BUTTON_EXISTS
#define BUTTON_EXISTS(...) false
// Dummy button, never pressed
#define _BUTTON_PRESSED(BN) false
// Shift register bits correspond to buttons:
#define BL_LE 7 // Left
#define BL_UP 6 // Up
#define BL_MI 5 // Middle
#define BL_DW 4 // Down
#define BL_RI 3 // Right
#define BL_ST 2 // Red Button
#define B_LE _BV(BL_LE)
#define B_UP _BV(BL_UP)
#define B_MI _BV(BL_MI)
#define B_DW _BV(BL_DW)
#define B_RI _BV(BL_RI)
#define B_ST _BV(BL_ST)
#ifndef BUTTON_CLICK
#if EN_C
#define BUTTON_CLICK() (buttons & (B_MI|B_ST))
#endif
#endif
#endif
#if IS_RRW_KEYPAD
#define BTN_OFFSET 0 // Bit offset into buttons for shift register values
#define BLEN_KEYPAD_F3 0
#define BLEN_KEYPAD_F2 1
#define BLEN_KEYPAD_F1 2
#define BLEN_KEYPAD_DOWN 3
#define BLEN_KEYPAD_RIGHT 4
#define BLEN_KEYPAD_MIDDLE 5
#define BLEN_KEYPAD_UP 6
#define BLEN_KEYPAD_LEFT 7
#define EN_KEYPAD_F1 _BV(BTN_OFFSET + BLEN_KEYPAD_F1)
#define EN_KEYPAD_F2 _BV(BTN_OFFSET + BLEN_KEYPAD_F2)
#define EN_KEYPAD_F3 _BV(BTN_OFFSET + BLEN_KEYPAD_F3)
#define EN_KEYPAD_DOWN _BV(BTN_OFFSET + BLEN_KEYPAD_DOWN)
#define EN_KEYPAD_RIGHT _BV(BTN_OFFSET + BLEN_KEYPAD_RIGHT)
#define EN_KEYPAD_MIDDLE _BV(BTN_OFFSET + BLEN_KEYPAD_MIDDLE)
#define EN_KEYPAD_UP _BV(BTN_OFFSET + BLEN_KEYPAD_UP)
#define EN_KEYPAD_LEFT _BV(BTN_OFFSET + BLEN_KEYPAD_LEFT)
#define RRK(B) (keypad_buttons & (B))
#ifdef EN_C
#define BUTTON_CLICK() ((buttons & EN_C) || RRK(EN_KEYPAD_MIDDLE))
#else
#define BUTTON_CLICK() RRK(EN_KEYPAD_MIDDLE)
#endif
#endif
#ifndef EN_A
#define EN_A 0
#endif
#ifndef EN_B
#define EN_B 0
#endif
#ifndef EN_C
#define EN_C 0
#endif
#if BUTTON_EXISTS(BACK) || ANY(HAS_TOUCH_BUTTONS, IS_TFTGLCD_PANEL)
#define BLEN_D 3
#define EN_D _BV(BLEN_D)
#else
#define EN_D 0
#endif
#define BUTTON_PRESSED(BN) (_BUTTON_PRESSED_##BN)
#if BUTTON_EXISTS(EN1)
#define _BUTTON_PRESSED_EN1 _BUTTON_PRESSED(EN1)
#else
#define _BUTTON_PRESSED_EN1 false
#endif
#if BUTTON_EXISTS(EN2)
#define _BUTTON_PRESSED_EN2 _BUTTON_PRESSED(EN2)
#else
#define _BUTTON_PRESSED_EN2 false
#endif
#if BUTTON_EXISTS(ENC_EN)
#define _BUTTON_PRESSED_ENC_EN _BUTTON_PRESSED(ENC_EN)
#else
#define _BUTTON_PRESSED_ENC_EN false
#endif
#if BUTTON_EXISTS(ENC)
#define _BUTTON_PRESSED_ENC _BUTTON_PRESSED(ENC)
#else
#define _BUTTON_PRESSED_ENC false
#endif
#if BUTTON_EXISTS(UP)
#define _BUTTON_PRESSED_UP _BUTTON_PRESSED(UP)
#else
#define _BUTTON_PRESSED_UP false
#endif
#if BUTTON_EXISTS(DOWN)
#define _BUTTON_PRESSED_DOWN _BUTTON_PRESSED(DOWN)
#else
#define _BUTTON_PRESSED_DOWN false
#endif
#if BUTTON_EXISTS(LEFT)
#define _BUTTON_PRESSED_LEFT _BUTTON_PRESSED(LEFT)
#else
#define _BUTTON_PRESSED_LEFT false
#endif
#if BUTTON_EXISTS(RIGHT)
#define _BUTTON_PRESSED_RIGHT _BUTTON_PRESSED(RIGHT)
#else
#define _BUTTON_PRESSED_RIGHT false
#endif
#if BUTTON_EXISTS(BACK)
#define _BUTTON_PRESSED_BACK _BUTTON_PRESSED(BACK)
#else
#define _BUTTON_PRESSED_BACK false
#endif
#ifndef BUTTON_CLICK
#if EN_C > 0
#define BUTTON_CLICK() (buttons & EN_C)
#else
#define BUTTON_CLICK() false
#endif
#endif
#if EN_D > 0
#define LCD_BACK_CLICKED() (buttons & EN_D)
#else
#define LCD_BACK_CLICKED() false
#endif
|
2301_81045437/Marlin
|
Marlin/src/lcd/buttons.h
|
C
|
agpl-3.0
| 6,674
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#pragma once
/**
* Standard Marlin Boot Screen bitmaps
*
* Use the Marlin Bitmap Converter to make your own:
* https://marlinfw.org/tools/u8glib/converter.html
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(SHOW_CUSTOM_BOOTSCREEN)
typedef struct {
const unsigned char *bitmap;
const unsigned short duration;
} boot_frame_t;
#include "../../../_Bootscreen.h"
#if ENABLED(CUSTOM_BOOTSCREEN_ANIMATED) && DISABLED(CUSTOM_BOOTSCREEN_ANIMATED_FRAME_TIME) && !defined(CUSTOM_BOOTSCREEN_FRAME_TIME)
#define CUSTOM_BOOTSCREEN_FRAME_TIME 500 // (ms)
#endif
#ifndef CUSTOM_BOOTSCREEN_BMPWIDTH
#define CUSTOM_BOOTSCREEN_BMPWIDTH 128
#endif
#ifndef CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH
#define CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH CEILING(CUSTOM_BOOTSCREEN_BMPWIDTH, 8)
#endif
#ifndef CUSTOM_BOOTSCREEN_BMPHEIGHT
#define CUSTOM_BOOTSCREEN_BMPHEIGHT (sizeof(custom_start_bmp) / (CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH))
#endif
#ifndef CUSTOM_BOOTSCREEN_Y
#if ENABLED(CUSTOM_BOOTSCREEN_BOTTOM_JUSTIFY)
#define CUSTOM_BOOTSCREEN_Y (LCD_PIXEL_HEIGHT - (CUSTOM_BOOTSCREEN_BMPHEIGHT))
#else
#define CUSTOM_BOOTSCREEN_Y ((LCD_PIXEL_HEIGHT - (CUSTOM_BOOTSCREEN_BMPHEIGHT)) / 2)
#endif
#endif
#endif
#if ENABLED(BOOT_MARLIN_LOGO_SMALL)
#define START_BMPWIDTH 56
const unsigned char start_bmp[] PROGMEM = {
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,
B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,
B10000011,B11001111,B00000000,B00000000,B00001100,B00110000,B00111111,
B10000111,B11111111,B10000000,B00000000,B00001100,B00110000,B00011111,
B10000110,B01111001,B10000000,B00000000,B00001100,B00000000,B00001111,
B10001100,B00110000,B11000111,B10000011,B10001100,B00110000,B11100111,
B10001100,B00110000,B11001111,B11000111,B11001100,B00110001,B11110011,
B10001100,B00110000,B11011100,B11101100,B11101100,B00110011,B10111001,
B10001100,B00110000,B11011000,B01101100,B01101100,B00110011,B00011001,
B10001100,B00110000,B11010000,B01101100,B00001100,B00110011,B00011001,
B10001100,B00110000,B11011000,B01101100,B00001100,B00110011,B00011001,
B10001100,B00110000,B11011100,B01101100,B00001110,B00111011,B00011001,
B10001100,B00110000,B11001111,B01111100,B00000111,B10011111,B00011001,
B10001100,B00110000,B11000111,B01111100,B00000011,B10001111,B00011001,
B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000
};
#if ENABLED(BOOT_MARLIN_LOGO_ANIMATED)
const unsigned char start_bmp1[] PROGMEM = {
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,
B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,
B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000
};
const unsigned char start_bmp2[] PROGMEM = {
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,
B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,
B10000011,B11001111,B00000000,B00000000,B00000000,B00000000,B00111111,
B10000111,B11111111,B10000000,B00000000,B00000000,B00000000,B00011111,
B10000110,B01111001,B10000000,B00000000,B00000000,B00000000,B00001111,
B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000111,
B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000011,
B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001,
B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001,
B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001,
B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001,
B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001,
B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001,
B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001,
B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000
};
const unsigned char start_bmp3[] PROGMEM = {
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,
B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,
B10000011,B11001111,B00000000,B00000000,B00000000,B00000000,B00111111,
B10000111,B11111111,B10000000,B00000000,B00000000,B00000000,B00011111,
B10000110,B01111001,B10000000,B00000000,B00000000,B00000000,B00001111,
B10001100,B00110000,B11000111,B10000000,B00000000,B00000000,B00000111,
B10001100,B00110000,B11001111,B11000000,B00000000,B00000000,B00000011,
B10001100,B00110000,B11011100,B11100000,B00000000,B00000000,B00000001,
B10001100,B00110000,B11011000,B01100000,B00000000,B00000000,B00000001,
B10001100,B00110000,B11010000,B01100000,B00000000,B00000000,B00000001,
B10001100,B00110000,B11011000,B01100000,B00000000,B00000000,B00000001,
B10001100,B00110000,B11011100,B01100000,B00000000,B00000000,B00000001,
B10001100,B00110000,B11001111,B01110000,B00000000,B00000000,B00000001,
B10001100,B00110000,B11000111,B01110000,B00000000,B00000000,B00000001,
B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000
};
const unsigned char start_bmp4[] PROGMEM = {
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,
B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,
B10000011,B11001111,B00000000,B00000000,B00000000,B00000000,B00111111,
B10000111,B11111111,B10000000,B00000000,B00000000,B00000000,B00011111,
B10000110,B01111001,B10000000,B00000000,B00000000,B00000000,B00001111,
B10001100,B00110000,B11000111,B10000011,B10000000,B00000000,B00000111,
B10001100,B00110000,B11001111,B11000111,B11000000,B00000000,B00000011,
B10001100,B00110000,B11011100,B11101100,B11100000,B00000000,B00000001,
B10001100,B00110000,B11011000,B01101100,B01100000,B00000000,B00000001,
B10001100,B00110000,B11010000,B01101100,B00000000,B00000000,B00000001,
B10001100,B00110000,B11011000,B01101100,B00000000,B00000000,B00000001,
B10001100,B00110000,B11011100,B01101100,B00000000,B00000000,B00000001,
B10001100,B00110000,B11001111,B01111100,B00000000,B00000000,B00000001,
B10001100,B00110000,B11000111,B01111100,B00000000,B00000000,B00000001,
B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000
};
const unsigned char start_bmp5[] PROGMEM = {
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,
B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,
B10000011,B11001111,B00000000,B00000000,B00001100,B00000000,B00111111,
B10000111,B11111111,B10000000,B00000000,B00001100,B00000000,B00011111,
B10000110,B01111001,B10000000,B00000000,B00001100,B00000000,B00001111,
B10001100,B00110000,B11000111,B10000011,B10001100,B00000000,B00000111,
B10001100,B00110000,B11001111,B11000111,B11001100,B00000000,B00000011,
B10001100,B00110000,B11011100,B11101100,B11101100,B00000000,B00000001,
B10001100,B00110000,B11011000,B01101100,B01101100,B00000000,B00000001,
B10001100,B00110000,B11010000,B01101100,B00001100,B00000000,B00000001,
B10001100,B00110000,B11011000,B01101100,B00001100,B00000000,B00000001,
B10001100,B00110000,B11011100,B01101100,B00001110,B00000000,B00000001,
B10001100,B00110000,B11001111,B01111100,B00000111,B10000000,B00000001,
B10001100,B00110000,B11000111,B01111100,B00000011,B10000000,B00000001,
B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000
};
const unsigned char start_bmp6[] PROGMEM = {
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,
B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,
B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,
B10000011,B11001111,B00000000,B00000000,B00001100,B00110000,B00111111,
B10000111,B11111111,B10000000,B00000000,B00001100,B00110000,B00011111,
B10000110,B01111001,B10000000,B00000000,B00001100,B00000000,B00001111,
B10001100,B00110000,B11000111,B10000011,B10001100,B00110000,B00000111,
B10001100,B00110000,B11001111,B11000111,B11001100,B00110000,B00000011,
B10001100,B00110000,B11011100,B11101100,B11101100,B00110000,B00000001,
B10001100,B00110000,B11011000,B01101100,B01101100,B00110000,B00000001,
B10001100,B00110000,B11010000,B01101100,B00001100,B00110000,B00000001,
B10001100,B00110000,B11011000,B01101100,B00001100,B00110000,B00000001,
B10001100,B00110000,B11011100,B01101100,B00001110,B00111000,B00000001,
B10001100,B00110000,B11001111,B01111100,B00000111,B10011100,B00000001,
B10001100,B00110000,B11000111,B01111100,B00000011,B10001100,B00000001,
B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000
};
#endif
#else
#define START_BMPWIDTH 112
const unsigned char start_bmp[] PROGMEM = {
B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111,
B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111,
B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00111111,B11111111,
B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00011000,B00000000,B00011111,B11111111,
B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00001111,B11111111,
B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000111,B11111111,
B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000011,B11111111,
B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000001,B11111111,
B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000,B11111111,
B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000011,B11100000,B01111000,B00111100,B00000011,B11110000,B01111111,
B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B01111000,B00111100,B00000111,B11111100,B00111111,
B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B01111000,B00111100,B00001111,B11111110,B00011111,
B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B01111000,B00111100,B00011111,B11111110,B00001111,
B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B01111000,B00111100,B00111111,B00111111,B00000111,
B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B01111000,B00111100,B00111110,B00011111,B00000111,
B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B01111000,B00111100,B00111100,B00001111,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B01111000,B00111100,B00111100,B00001111,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B01111100,B00111100,B00111100,B00001111,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B01111111,B10111100,B00111100,B00001111,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00111111,B10111111,B11111100,B00001111,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00011111,B10111111,B11111100,B00001111,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00001111,B10111111,B11111100,B00001111,B00000011,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,
B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110,
B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100,
B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,
B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000,
B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000
};
#if ENABLED(BOOT_MARLIN_LOGO_ANIMATED)
const unsigned char start_bmp1[] PROGMEM = {
B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111,
B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111,
B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,
B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110,
B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100,
B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,
B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000,
B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000
};
const unsigned char start_bmp2[] PROGMEM = {
B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111,
B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111,
B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,
B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,
B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111,
B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,
B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,
B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,
B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,
B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110,
B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100,
B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,
B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000,
B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000
};
const unsigned char start_bmp3[] PROGMEM = {
B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111,
B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111,
B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,
B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,
B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111,
B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,
B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,
B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,
B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,
B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,
B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,
B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,
B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,
B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,
B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,
B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,
B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110,
B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100,
B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,
B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000,
B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000
};
const unsigned char start_bmp4[] PROGMEM = {
B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111,
B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111,
B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,
B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,
B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111,
B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,
B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,
B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,
B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,
B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B01111111,
B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B00000000,B00000000,B00000000,B00000000,B00111111,
B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B00000000,B00000000,B00000000,B00000000,B00011111,
B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B00000000,B00000000,B00000000,B00000000,B00001111,
B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B00000000,B00000000,B00000000,B00000000,B00000111,
B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B00000000,B00000000,B00000000,B00000000,B00000111,
B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,
B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110,
B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100,
B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,
B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000,
B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000
};
const unsigned char start_bmp5[] PROGMEM = {
B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111,
B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111,
B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00111111,B11111111,
B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00011111,B11111111,
B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00001111,B11111111,
B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000111,B11111111,
B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000011,B11111111,
B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000001,B11111111,
B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000,B11111111,
B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000011,B11100000,B01111000,B00000000,B00000000,B00000000,B01111111,
B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B01111000,B00000000,B00000000,B00000000,B00111111,
B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B01111000,B00000000,B00000000,B00000000,B00011111,
B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B01111000,B00000000,B00000000,B00000000,B00001111,
B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B01111000,B00000000,B00000000,B00000000,B00000111,
B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B01111000,B00000000,B00000000,B00000000,B00000111,
B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B01111000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B01111000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B01111000,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B01111100,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B01111111,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00111111,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00011111,B00000000,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00001111,B00000000,B00000000,B00000000,B00000011,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,
B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110,
B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100,
B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,
B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000,
B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000
};
const unsigned char start_bmp6[] PROGMEM = {
B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111,
B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111,
B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111,
B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00111111,B11111111,
B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00011000,B00000000,B00011111,B11111111,
B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00001111,B11111111,
B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000111,B11111111,
B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000011,B11111111,
B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000001,B11111111,
B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000,B11111111,
B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000011,B11100000,B01111000,B00111100,B00000000,B00000000,B01111111,
B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B01111000,B00111100,B00000000,B00000000,B00111111,
B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B01111000,B00111100,B00000000,B00000000,B00011111,
B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B01111000,B00111100,B00000000,B00000000,B00001111,
B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B01111000,B00111100,B00000000,B00000000,B00000111,
B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B01111000,B00111100,B00000000,B00000000,B00000111,
B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B01111000,B00111100,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B01111000,B00111100,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B01111100,B00111100,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B01111111,B10111100,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00111111,B10111111,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00011111,B10111111,B00000000,B00000000,B00000011,
B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00001111,B10111111,B00000000,B00000000,B00000011,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,
B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,
B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110,
B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100,
B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,
B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000,
B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000
};
#endif
#endif
#if ENABLED(BOOT_MARLIN_LOGO_ANIMATED)
#ifndef MARLIN_BOOTSCREEN_FRAME_TIME
#define MARLIN_BOOTSCREEN_FRAME_TIME 100 // (ms)
#endif
const unsigned char * const marlin_bootscreen_animation[] PROGMEM = {
start_bmp1, start_bmp2, start_bmp3, start_bmp4, start_bmp5, start_bmp6, start_bmp
};
#endif
#ifndef START_BMP_BYTEWIDTH
#define START_BMP_BYTEWIDTH CEILING(START_BMPWIDTH, 8)
#endif
#ifndef START_BMPHEIGHT
#define START_BMPHEIGHT (sizeof(start_bmp) / (START_BMP_BYTEWIDTH))
#endif
static_assert(sizeof(start_bmp) == (START_BMP_BYTEWIDTH) * (START_BMPHEIGHT), "Bootscreen (start_bmp) dimensions don't match data.");
|
2301_81045437/Marlin
|
Marlin/src/lcd/dogm/dogm_Bootscreen.h
|
C
|
agpl-3.0
| 52,982
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#pragma once
/**
* Standard Marlin Status Screen bitmaps
*
* Use the Marlin Bitmap Converter to make your own:
* https://marlinfw.org/tools/u8glib/converter.html
*/
#include "../../inc/MarlinConfig.h"
#include "marlinui_DOGM.h"
#define BW(N) ((N + 7) / 8)
#if ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && DISABLED(STATUS_COMBINE_HEATERS)
#undef STATUS_HEATERS_X
#undef STATUS_BED_X
/**
* Custom _Statusscreen.h files can define:
* - A custom logo image
* - A custom heater bitmap
* - A custom fan bitmap / animation
*
* See the included examples for guidance
*/
#include "../../../_Statusscreen.h"
#ifdef STATUS_SCREENWIDTH
#error "Your custom _Statusscreen.h needs to be converted for Marlin 2.0."
#endif
#endif
//
// Default Status Screen Heater or Hotends bitmaps
//
#if !STATUS_HEATERS_WIDTH && !STATUS_HOTEND1_WIDTH
#if ENABLED(STATUS_COMBINE_HEATERS)
#include "status/combined.h"
#else
#if HAS_HOTEND
#include "status/hotend.h"
#else
#define STATUS_HEATERS_HEIGHT 20
#endif
#endif
#endif
//
// Laser / Spindle
//
#if !STATUS_CUTTER_WIDTH && HAS_CUTTER
#include "status/cutter.h"
#endif
#ifndef STATUS_CUTTER_WIDTH
#define STATUS_CUTTER_WIDTH 0
#endif
#ifndef STATUS_CUTTER_BYTEWIDTH
#define STATUS_CUTTER_BYTEWIDTH BW(STATUS_CUTTER_WIDTH)
#endif
//
// Laser cooler
//
#if !STATUS_COOLER_WIDTH && HAS_COOLER
#include "status/cooler.h"
#endif
#ifndef STATUS_COOLER_WIDTH
#define STATUS_COOLER_WIDTH 0
#endif
#ifndef STATUS_COOLER_BYTEWIDTH
#define STATUS_COOLER_BYTEWIDTH BW(STATUS_COOLER_WIDTH)
#endif
//
// Laser Flowmeter
//
#if !STATUS_FLOWMETER_WIDTH && ENABLED(LASER_COOLANT_FLOW_METER)
#include "status/cooler.h"
#endif
#ifndef STATUS_FLOWMETER_WIDTH
#define STATUS_FLOWMETER_WIDTH 0
#endif
#ifndef STATUS_FLOWMETER_BYTEWIDTH
#define STATUS_FLOWMETER_BYTEWIDTH BW(STATUS_FLOWMETER_WIDTH)
#endif
//
// Laser Ammeter
//
#if ENABLED(I2C_AMMETER)
#if !STATUS_AMMETER_WIDTH
#include "status/ammeter.h"
#endif
#ifndef STATUS_AMMETER_WIDTH
#define STATUS_AMMETER_WIDTH 0
#endif
#endif
//
// Bed
//
#if !STATUS_BED_WIDTH && HAS_HEATED_BED && DISABLED(STATUS_COMBINE_HEATERS)
#include "status/bed.h"
#endif
#ifndef STATUS_BED_WIDTH
#define STATUS_BED_WIDTH 0
#endif
//
// Chamber
//
#if !STATUS_CHAMBER_WIDTH && HAS_TEMP_CHAMBER && ((HOTENDS <= 4 && !HAS_HEATED_BED) || (HOTENDS <= 3 && HAS_HEATED_BED))
#include "status/chamber.h"
#endif
#ifndef STATUS_CHAMBER_WIDTH
#define STATUS_CHAMBER_WIDTH 0
#endif
// Can also be overridden in Configuration_adv.h
// If you can afford it, try the 3-frame fan animation!
// Don't compile in the fan animation with no fan
#if !HAS_FAN0 || (HOTENDS == 5 || (HOTENDS == 4 && (HAS_HEATED_BED || HAS_TEMP_CHAMBER)) || ALL(STATUS_COMBINE_HEATERS, HAS_HEATED_CHAMBER))
#undef STATUS_FAN_FRAMES
#elif !STATUS_FAN_FRAMES
#define STATUS_FAN_FRAMES 2
#elif STATUS_FAN_FRAMES > 4
#error "A maximum of 4 fan animation frames is currently supported."
#endif
#if HOTENDS > 4
#undef STATUS_LOGO_WIDTH
#undef STATUS_HEATERS_XSPACE
#define STATUS_HEATERS_XSPACE 24
#endif
//
// Provide default Fan Bitmaps
//
#if !STATUS_FAN_WIDTH && STATUS_FAN_FRAMES > 0
#include "status/fan.h"
#else
#undef STATUS_FAN_FRAMES
#define STATUS_FAN_WIDTH 0
#endif
#define _EXTRA_WIDTH (STATUS_FAN_WIDTH + STATUS_CHAMBER_WIDTH + STATUS_BED_WIDTH)
//
// Heater Bitmap X Space Requirements
//
#if !defined(STATUS_HEATERS_XSPACE) && (STATUS_HOTEND1_WIDTH || STATUS_HEATERS_WIDTH)
#if (HOTENDS == 3 || HOTENDS == 4) && ENABLED(STATUS_COMBINE_HEATERS)
// If more heaters or they're combined, 3 bytes
#define STATUS_HEATERS_XSPACE 24
#elif STATUS_LOGO_WIDTH > (LCD_PIXEL_WIDTH - (_EXTRA_WIDTH) - 26 * (HOTENDS)) // 128 - (20 + 24 + 26) == 58
// If the logo won't fit at 26 width
#define STATUS_HEATERS_XSPACE 24
#else
#define STATUS_HEATERS_XSPACE 26
#endif
#endif
#if ENABLED(CUSTOM_STATUS_SCREEN_IMAGE)
//
// Disable the logo bitmap if insufficient space
//
#if STATUS_HEATERS_XSPACE
#define _HEATERS_WIDTH (HOTENDS * (STATUS_HEATERS_XSPACE)) // as many hotends as possible
#elif STATUS_HEATERS_WIDTH
#define _HEATERS_WIDTH STATUS_HEATERS_WIDTH
#elif HOTENDS
#error "Status screen heaters region was not specified."
#endif
#if STATUS_LOGO_WIDTH > (LCD_PIXEL_WIDTH - (_EXTRA_WIDTH + _HEATERS_WIDTH))
#warning "Unable to fit custom Status Screen logo. Disabling."
#undef STATUS_LOGO_WIDTH
#endif
#ifndef STATUS_HEATERS_X
#define _BED_OR_CHAMBER_OR_FAN (HAS_HEATED_BED || HAS_TEMP_CHAMBER || HAS_FAN)
#if (HAS_HOTEND && STATUS_LOGO_WIDTH && _BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !_BED_OR_CHAMBER_OR_FAN)
#define _STATUS_HEATERS_X(H,S,N) ((LCD_PIXEL_WIDTH - (H * (S + N)) - (_EXTRA_WIDTH) + (STATUS_LOGO_WIDTH)) / 2)
#if STATUS_HOTEND1_WIDTH
#if HOTENDS > 2
#define STATUS_HEATERS_X _STATUS_HEATERS_X(HOTENDS, STATUS_HOTEND1_WIDTH, 6)
#else
#define STATUS_HEATERS_X _STATUS_HEATERS_X(HOTENDS, STATUS_HOTEND1_WIDTH, 4)
#endif
#else
#define STATUS_HEATERS_X _STATUS_HEATERS_X(1, STATUS_HEATERS_WIDTH, 4)
#endif
#endif
#endif
#undef _BED_OR_CHAMBER_OR_FAN
#endif
//
// Custom Logo Bitmap Properties
//
#ifndef STATUS_LOGO_WIDTH
#define STATUS_LOGO_WIDTH 0
#endif
#ifndef STATUS_LOGO_BYTEWIDTH
#define STATUS_LOGO_BYTEWIDTH BW(STATUS_LOGO_WIDTH)
#endif
#if STATUS_LOGO_WIDTH
#ifndef STATUS_LOGO_X
#ifdef STATUS_HEATERS_X
#define STATUS_LOGO_X ((STATUS_HEATERS_X - (STATUS_LOGO_WIDTH) - 1) / 2)
#else
#define STATUS_LOGO_X 0
#endif
#endif
#ifndef STATUS_LOGO_HEIGHT
#define STATUS_LOGO_HEIGHT (sizeof(status_logo_bmp) / (STATUS_LOGO_BYTEWIDTH))
#endif
#ifndef STATUS_LOGO_Y
#define STATUS_LOGO_Y _MAX(0U, (28U - _MIN(28U, STATUS_LOGO_HEIGHT)) / 2U)
#endif
static_assert(
sizeof(status_logo_bmp) == (STATUS_LOGO_BYTEWIDTH) * (STATUS_LOGO_HEIGHT),
"Status logo bitmap (status_logo_bmp) dimensions don't match data."
);
#endif
//
// Hotend Heater Bitmap starting X position
//
#if !defined(STATUS_HEATERS_X) && (STATUS_HOTEND1_WIDTH || STATUS_HEATERS_WIDTH)
#if STATUS_LOGO_BYTEWIDTH
#define STATUS_HEATERS_X (STATUS_LOGO_BYTEWIDTH * 8)
#elif ((STATUS_CHAMBER_WIDTH || STATUS_FAN_WIDTH) && (STATUS_BED_WIDTH && STATUS_HOTEND_BITMAPS == 3)) || \
((STATUS_CHAMBER_WIDTH || STATUS_FAN_WIDTH || STATUS_BED_WIDTH) && STATUS_HOTEND_BITMAPS == 4)
#define STATUS_HEATERS_X 5
#else
#if ALL(STATUS_COMBINE_HEATERS, HAS_HEATED_BED) && HOTENDS <= 4
#define STATUS_HEATERS_X 5
#else
#define STATUS_HEATERS_X 8 // Like the included bitmaps
#endif
#endif
#endif
#if STATUS_HOTEND1_WIDTH
//
// Hotend images. A base hotend image and optional "ON" state image.
//
#ifndef STATUS_HOTEND_BITMAPS
#define STATUS_HOTEND_BITMAPS 1
#endif
#ifndef STATUS_HOTEND2_WIDTH
#define STATUS_HOTEND2_WIDTH STATUS_HOTEND1_WIDTH
#endif
#ifndef STATUS_HOTEND3_WIDTH
#define STATUS_HOTEND3_WIDTH STATUS_HOTEND2_WIDTH
#endif
#ifndef STATUS_HOTEND4_WIDTH
#define STATUS_HOTEND4_WIDTH STATUS_HOTEND3_WIDTH
#endif
#ifndef STATUS_HOTEND5_WIDTH
#define STATUS_HOTEND5_WIDTH STATUS_HOTEND4_WIDTH
#endif
#ifndef STATUS_HOTEND6_WIDTH
#define STATUS_HOTEND6_WIDTH STATUS_HOTEND5_WIDTH
#endif
#ifndef STATUS_HOTEND7_WIDTH
#define STATUS_HOTEND7_WIDTH STATUS_HOTEND6_WIDTH
#endif
#ifndef STATUS_HOTEND8_WIDTH
#define STATUS_HOTEND8_WIDTH STATUS_HOTEND7_WIDTH
#endif
#define _SHNAME(N,T) STATUS_HOTEND##N##_##T,
constexpr uint8_t status_hotend_width[HOTENDS] = { REPEAT2_S(1, INCREMENT(HOTENDS), _SHNAME, WIDTH) };
#define STATUS_HOTEND_WIDTH(N) status_hotend_width[N]
#ifndef STATUS_HOTEND1_BYTEWIDTH
#define STATUS_HOTEND1_BYTEWIDTH BW(STATUS_HOTEND1_WIDTH)
#endif
#ifndef STATUS_HOTEND2_BYTEWIDTH
#define STATUS_HOTEND2_BYTEWIDTH BW(STATUS_HOTEND2_WIDTH)
#endif
#ifndef STATUS_HOTEND3_BYTEWIDTH
#define STATUS_HOTEND3_BYTEWIDTH BW(STATUS_HOTEND3_WIDTH)
#endif
#ifndef STATUS_HOTEND4_BYTEWIDTH
#define STATUS_HOTEND4_BYTEWIDTH BW(STATUS_HOTEND4_WIDTH)
#endif
#ifndef STATUS_HOTEND5_BYTEWIDTH
#define STATUS_HOTEND5_BYTEWIDTH BW(STATUS_HOTEND5_WIDTH)
#endif
#ifndef STATUS_HOTEND6_BYTEWIDTH
#define STATUS_HOTEND6_BYTEWIDTH BW(STATUS_HOTEND6_WIDTH)
#endif
#ifndef STATUS_HOTEND7_BYTEWIDTH
#define STATUS_HOTEND7_BYTEWIDTH BW(STATUS_HOTEND7_WIDTH)
#endif
#ifndef STATUS_HOTEND8_BYTEWIDTH
#define STATUS_HOTEND8_BYTEWIDTH BW(STATUS_HOTEND8_WIDTH)
#endif
constexpr uint8_t status_hotend_bytewidth[HOTENDS] = { REPEAT2_S(1, INCREMENT(HOTENDS), _SHNAME, BYTEWIDTH) };
#define STATUS_HOTEND_BYTEWIDTH(N) status_hotend_bytewidth[N]
#ifndef STATUS_HOTEND1_X
#define STATUS_HOTEND1_X STATUS_HEATERS_X
#endif
#ifndef STATUS_HOTEND2_X
#define STATUS_HOTEND2_X STATUS_HOTEND1_X + STATUS_HEATERS_XSPACE
#endif
#if HOTENDS > 2
#ifndef STATUS_HOTEND3_X
#define STATUS_HOTEND3_X STATUS_HOTEND2_X + STATUS_HEATERS_XSPACE
#endif
#ifndef STATUS_HOTEND4_X
#define STATUS_HOTEND4_X STATUS_HOTEND3_X + STATUS_HEATERS_XSPACE
#endif
#ifndef STATUS_HOTEND5_X
#define STATUS_HOTEND5_X STATUS_HOTEND4_X + STATUS_HEATERS_XSPACE
#endif
#ifndef STATUS_HOTEND6_X
#define STATUS_HOTEND6_X STATUS_HOTEND5_X + STATUS_HEATERS_XSPACE
#endif
#ifndef STATUS_HOTEND7_X
#define STATUS_HOTEND7_X STATUS_HOTEND6_X + STATUS_HEATERS_XSPACE
#endif
#ifndef STATUS_HOTEND8_X
#define STATUS_HOTEND8_X STATUS_HOTEND7_X + STATUS_HEATERS_XSPACE
#endif
constexpr uint8_t status_hotend_x[HOTENDS] = { REPEAT2_S(1, INCREMENT(HOTENDS), _SHNAME, X) };
#define STATUS_HOTEND_X(N) status_hotend_x[N]
#elif HAS_MULTI_HOTEND
#define STATUS_HOTEND_X(N) ((N) ? STATUS_HOTEND2_X : STATUS_HOTEND1_X)
#else
#define STATUS_HOTEND_X(N) STATUS_HOTEND1_X
#endif
#ifndef STATUS_HOTEND_TEXT_X
#ifdef STATUS_HOTEND1_TEXT_X
#ifndef STATUS_HOTEND2_TEXT_X
#define STATUS_HOTEND2_TEXT_X STATUS_HOTEND1_TEXT_X + STATUS_HEATERS_XSPACE
#endif
#ifndef STATUS_HOTEND3_TEXT_X
#define STATUS_HOTEND3_TEXT_X STATUS_HOTEND2_TEXT_X + STATUS_HEATERS_XSPACE
#endif
#ifndef STATUS_HOTEND4_TEXT_X
#define STATUS_HOTEND4_TEXT_X STATUS_HOTEND3_TEXT_X + STATUS_HEATERS_XSPACE
#endif
#ifndef STATUS_HOTEND5_TEXT_X
#define STATUS_HOTEND5_TEXT_X STATUS_HOTEND4_TEXT_X + STATUS_HEATERS_XSPACE
#endif
#ifndef STATUS_HOTEND6_TEXT_X
#define STATUS_HOTEND6_TEXT_X STATUS_HOTEND5_TEXT_X + STATUS_HEATERS_XSPACE
#endif
#ifndef STATUS_HOTEND7_TEXT_X
#define STATUS_HOTEND7_TEXT_X STATUS_HOTEND6_TEXT_X + STATUS_HEATERS_XSPACE
#endif
#ifndef STATUS_HOTEND8_TEXT_X
#define STATUS_HOTEND8_TEXT_X STATUS_HOTEND7_TEXT_X + STATUS_HEATERS_XSPACE
#endif
constexpr uint8_t status_hotend_text_x[HOTENDS] = { REPEAT2_S(1, INCREMENT(HOTENDS), _SHNAME, TEXT_X) };
#define STATUS_HOTEND_TEXT_X(N) status_hotend_text_x[N]
#else
#define STATUS_HOTEND_TEXT_X(N) (STATUS_HOTEND1_X + 6 + (N) * (STATUS_HEATERS_XSPACE))
#endif
#endif
#undef _SHNAME
#if STATUS_HOTEND_BITMAPS > 1 && DISABLED(STATUS_HOTEND_NUMBERLESS)
#define TEST_BITMAP_OFF status_hotend1_a_bmp
#define TEST_BITMAP_ON status_hotend1_b_bmp
#else
#define TEST_BITMAP_OFF status_hotend_a_bmp
#define TEST_BITMAP_ON status_hotend_b_bmp
#endif
#ifndef STATUS_HEATERS_HEIGHT
#define STATUS_HEATERS_HEIGHT (sizeof(TEST_BITMAP_OFF) / (STATUS_HOTEND1_BYTEWIDTH))
#endif
#ifndef STATUS_HEATERS_Y
#define STATUS_HEATERS_Y (20 - (STATUS_HEATERS_HEIGHT))
#endif
#define HOTEND0_BITMAP_SIZE (STATUS_HOTEND1_BYTEWIDTH) * (STATUS_HEATERS_HEIGHT)
static_assert(
sizeof(TEST_BITMAP_OFF) == HOTEND0_BITMAP_SIZE,
"Status hotend bitmap (" STRINGIFY(TEST_BITMAP_OFF) ") dimensions don't match data."
);
#ifdef STATUS_HOTEND_ANIM
static_assert(
sizeof(TEST_BITMAP_ON) == HOTEND0_BITMAP_SIZE,
"Status hotend bitmaps (" STRINGIFY(TEST_BITMAP_OFF) " and " STRINGIFY(TEST_BITMAP_ON) ") dimensions don't match."
);
#endif
#elif STATUS_HEATERS_WIDTH
#ifndef STATUS_HEATERS_XSPACE
#define STATUS_HEATERS_XSPACE 24
#endif
#ifndef STATUS_HOTEND_WIDTH
#define STATUS_HOTEND_WIDTH(N) 10
#endif
#ifndef STATUS_HOTEND_X
#define STATUS_HOTEND_X(N) (STATUS_HEATERS_X + 2 + (N) * (STATUS_HEATERS_XSPACE))
#endif
#ifndef STATUS_HOTEND_TEXT_X
#if HOTENDS == 4 && STATUS_LOGO_WIDTH
#define STATUS_HOTEND_TEXT_X(N) (STATUS_HEATERS_X + 6 + (N) * (STATUS_HEATERS_XSPACE))
#else
#define STATUS_HOTEND_TEXT_X(N) (STATUS_HEATERS_X + 6 + (N) * (STATUS_HEATERS_XSPACE))
#endif
#endif
#ifndef STATUS_HEATERS_BYTEWIDTH
#define STATUS_HEATERS_BYTEWIDTH BW(STATUS_HEATERS_WIDTH)
#endif
#ifndef STATUS_HEATERS_HEIGHT
#define STATUS_HEATERS_HEIGHT (sizeof(status_heaters_bmp) / (STATUS_HEATERS_BYTEWIDTH))
#endif
#ifndef STATUS_HEATERS_Y
#define STATUS_HEATERS_Y (20 - (STATUS_HEATERS_HEIGHT))
#endif
static_assert(
sizeof(status_heaters_bmp) == (STATUS_HEATERS_BYTEWIDTH) * (STATUS_HEATERS_HEIGHT),
"Status heaters bitmap (status_heaters_bmp) dimensions don't match data."
);
#else // HOTENDS == 0
#define STATUS_HOTEND_TEXT_X(N) 0
#define STATUS_HEATERS_Y 0
#endif
//
// Cutter Bitmap Properties
//
#if HAS_CUTTER
#if STATUS_CUTTER_WIDTH
#ifndef STATUS_CUTTER_X
#define STATUS_CUTTER_X (LCD_PIXEL_WIDTH - (STATUS_CUTTER_BYTEWIDTH + STATUS_CUTTER_BYTEWIDTH) * 8)
#endif
#ifndef STATUS_CUTTER_HEIGHT
#ifdef STATUS_CUTTER_ANIM
#define STATUS_CUTTER_HEIGHT(S) ((S) ? sizeof(status_cutter_on_bmp) / (STATUS_CUTTER_BYTEWIDTH) : sizeof(status_cutter_bmp) / (STATUS_CUTTER_BYTEWIDTH))
#else
#define STATUS_CUTTER_HEIGHT(S) (sizeof(status_cutter_bmp) / (STATUS_CUTTER_BYTEWIDTH))
#endif
#endif
#ifndef STATUS_CUTTER_Y
#define STATUS_CUTTER_Y(S) 4
#endif
#ifndef STATUS_CUTTER_TEXT_X
#define STATUS_CUTTER_TEXT_X (STATUS_CUTTER_X - 1)
#endif
#ifndef STATUS_CUTTER_TEXT_Y
#define STATUS_CUTTER_TEXT_Y 28
#endif
static_assert(
sizeof(status_cutter_bmp) == (STATUS_CUTTER_BYTEWIDTH) * STATUS_CUTTER_HEIGHT(0),
"Status cutter bitmap (status_cutter_bmp) dimensions don't match data."
);
#ifdef STATUS_CUTTER_ANIM
static_assert(
sizeof(status_cutter_on_bmp) == (STATUS_CUTTER_BYTEWIDTH) * STATUS_CUTTER_HEIGHT(1),
"Status cutter bitmap (status_cutter_on_bmp) dimensions don't match data."
);
#endif
#endif
#endif
//
// Chamber Bitmap Properties
//
#ifndef STATUS_CHAMBER_BYTEWIDTH
#define STATUS_CHAMBER_BYTEWIDTH BW(STATUS_CHAMBER_WIDTH)
#endif
#if STATUS_CHAMBER_WIDTH
#ifndef STATUS_CHAMBER_X
#define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8)
#endif
#ifndef STATUS_CHAMBER_HEIGHT
#ifdef STATUS_CHAMBER_ANIM
#define STATUS_CHAMBER_HEIGHT(S) ((S) ? sizeof(status_chamber_on_bmp) / (STATUS_CHAMBER_BYTEWIDTH) : sizeof(status_chamber_bmp) / (STATUS_CHAMBER_BYTEWIDTH))
#else
#define STATUS_CHAMBER_HEIGHT(S) (sizeof(status_chamber_bmp) / (STATUS_CHAMBER_BYTEWIDTH))
#endif
#endif
#ifndef STATUS_CHAMBER_Y
#define STATUS_CHAMBER_Y(S) (20 - STATUS_CHAMBER_HEIGHT(S))
#endif
#ifndef STATUS_CHAMBER_TEXT_X
#define STATUS_CHAMBER_TEXT_X (STATUS_CHAMBER_X + 11)
#endif
static_assert(
sizeof(status_chamber_bmp) == (STATUS_CHAMBER_BYTEWIDTH) * STATUS_CHAMBER_HEIGHT(0),
"Status chamber bitmap (status_chamber_bmp) dimensions don't match data."
);
#ifdef STATUS_CHAMBER_ANIM
static_assert(
sizeof(status_chamber_on_bmp) == (STATUS_CHAMBER_BYTEWIDTH) * STATUS_CHAMBER_HEIGHT(1),
"Status chamber bitmap (status_chamber_on_bmp) dimensions don't match data."
);
#endif
#endif
//
// Cooler Bitmap Properties
//
#if HAS_COOLER
#if STATUS_COOLER_WIDTH
#ifndef STATUS_COOLER_X
#define STATUS_COOLER_X (LCD_PIXEL_WIDTH - (STATUS_COOLER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH + STATUS_CUTTER_BYTEWIDTH) * 8)
#endif
#ifndef STATUS_COOLER_HEIGHT
#define STATUS_COOLER_HEIGHT(S) (sizeof(status_cooler_bmp1) / (STATUS_COOLER_BYTEWIDTH))
#endif
#ifndef STATUS_COOLER_Y
#define STATUS_COOLER_Y(S) (18 - STATUS_COOLER_HEIGHT(S))
#endif
#ifndef STATUS_COOLER_TEXT_X
#define STATUS_COOLER_TEXT_X (STATUS_COOLER_X + 12)
#endif
static_assert(
sizeof(status_cooler_bmp1) == (STATUS_COOLER_BYTEWIDTH) * STATUS_COOLER_HEIGHT(0),
"Status cooler bitmap (status_cooler_bmp1) dimensions don't match data."
);
#ifdef STATUS_COOLER_ANIM
static_assert(
sizeof(status_cooler_bmp2) == (STATUS_COOLER_BYTEWIDTH) * STATUS_COOLER_HEIGHT(1),
"Status cooler bitmap (status_cooler_bmp2) dimensions don't match data."
);
#endif
#endif
#endif
//
// Flowmeter Bitmap Properties
//
#if ENABLED(LASER_COOLANT_FLOW_METER)
#if STATUS_FLOWMETER_WIDTH
#ifndef STATUS_FLOWMETER_X
#define STATUS_FLOWMETER_X (LCD_PIXEL_WIDTH - (STATUS_FLOWMETER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH + STATUS_CUTTER_BYTEWIDTH + STATUS_COOLER_BYTEWIDTH) * 8)
#endif
#ifndef STATUS_FLOWMETER_HEIGHT
#define STATUS_FLOWMETER_HEIGHT(S) (sizeof(status_flowmeter_bmp1) / (STATUS_FLOWMETER_BYTEWIDTH))
#endif
#ifndef STATUS_FLOWMETER_Y
#define STATUS_FLOWMETER_Y(S) (20 - STATUS_FLOWMETER_HEIGHT(S))
#endif
#ifndef STATUS_FLOWMETER_TEXT_X
#define STATUS_FLOWMETER_TEXT_X (STATUS_FLOWMETER_X + 12)
#endif
static_assert(
sizeof(status_flowmeter_bmp1) == (STATUS_FLOWMETER_BYTEWIDTH) * STATUS_FLOWMETER_HEIGHT(0),
"Status flowmeter bitmap (status_flowmeter_bmp1) dimensions don't match data."
);
#ifdef STATUS_COOLER_ANIM
static_assert(
sizeof(status_flowmeter_bmp2) == (STATUS_FLOWMETER_BYTEWIDTH) * STATUS_FLOWMETER_HEIGHT(1),
"Status flowmeter bitmap (status_flowmeter_bmp2) dimensions don't match data."
);
#endif
#endif
#endif
//
// I2C Laser Ammeter
//
#if ENABLED(I2C_AMMETER) && STATUS_AMMETER_WIDTH
#ifndef STATUS_AMMETER_BYTEWIDTH
#define STATUS_AMMETER_BYTEWIDTH BW(STATUS_AMMETER_WIDTH)
#endif
#ifndef STATUS_AMMETER_X
#define STATUS_AMMETER_X (LCD_PIXEL_WIDTH - (STATUS_AMMETER_BYTEWIDTH + STATUS_FLOWMETER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH + STATUS_CUTTER_BYTEWIDTH + STATUS_COOLER_BYTEWIDTH) * 8)
#endif
#ifndef STATUS_AMMETER_HEIGHT
#define STATUS_AMMETER_HEIGHT(S) (sizeof(status_ammeter_bmp_mA) / (STATUS_AMMETER_BYTEWIDTH))
#endif
#ifndef STATUS_AMMETER_Y
#define STATUS_AMMETER_Y(S) (18 - STATUS_AMMETER_HEIGHT(S))
#endif
#ifndef STATUS_AMMETER_TEXT_X
#define STATUS_AMMETER_TEXT_X (STATUS_AMMETER_X + 7)
#endif
static_assert(
sizeof(status_ammeter_bmp_mA) == (STATUS_AMMETER_BYTEWIDTH) * STATUS_AMMETER_HEIGHT(0),
"Status ammeter bitmap (status_ammeter_bmp_mA) dimensions don't match data."
);
#endif
//
// Bed Bitmap Properties
//
#ifndef STATUS_BED_BYTEWIDTH
#define STATUS_BED_BYTEWIDTH BW(STATUS_BED_WIDTH)
#endif
#if STATUS_BED_WIDTH && !STATUS_HEATERS_WIDTH
#ifndef STATUS_BED_X
#define STATUS_BED_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH + STATUS_BED_BYTEWIDTH) * 8 - TERN0(STATUS_HEAT_PERCENT, 4))
#endif
#ifndef STATUS_BED_HEIGHT
#ifdef STATUS_BED_ANIM
#define STATUS_BED_HEIGHT(S) ((S) ? sizeof(status_bed_on_bmp) / (STATUS_BED_BYTEWIDTH) : sizeof(status_bed_bmp) / (STATUS_BED_BYTEWIDTH))
#else
#define STATUS_BED_HEIGHT(S) (sizeof(status_bed_bmp) / (STATUS_BED_BYTEWIDTH))
#endif
#endif
#ifndef STATUS_BED_Y
#define STATUS_BED_Y(S) (20 - STATUS_BED_HEIGHT(S))
#endif
#ifndef STATUS_BED_TEXT_X
#define STATUS_BED_TEXT_X (STATUS_BED_X + 9)
#endif
static_assert(
sizeof(status_bed_bmp) == (STATUS_BED_BYTEWIDTH) * STATUS_BED_HEIGHT(0),
"Status bed bitmap (status_bed_bmp) dimensions don't match data."
);
#ifdef STATUS_BED_ANIM
static_assert(
sizeof(status_bed_on_bmp) == (STATUS_BED_BYTEWIDTH) * STATUS_BED_HEIGHT(1),
"Status bed bitmap (status_bed_on_bmp) dimensions don't match data."
);
#endif
#endif
//
// Fan Bitmap Properties
//
#ifndef STATUS_FAN_BYTEWIDTH
#define STATUS_FAN_BYTEWIDTH BW(STATUS_FAN_WIDTH)
#endif
#if STATUS_FAN_FRAMES
#ifndef STATUS_FAN_X
#define STATUS_FAN_X (LCD_PIXEL_WIDTH - (STATUS_FAN_BYTEWIDTH) * 8)
#endif
#ifndef STATUS_FAN_Y
#define STATUS_FAN_Y 1
#endif
#ifndef STATUS_FAN_TEXT_X
#define STATUS_FAN_TEXT_X (STATUS_FAN_X - 1)
#endif
#ifndef STATUS_FAN_TEXT_Y
#define STATUS_FAN_TEXT_Y 28
#endif
#ifndef STATUS_FAN_HEIGHT
#define STATUS_FAN_HEIGHT (sizeof(status_fan0_bmp) / (STATUS_FAN_BYTEWIDTH))
#endif
#define FAN_BMP_SIZE (STATUS_FAN_BYTEWIDTH) * (STATUS_FAN_HEIGHT)
static_assert(sizeof(status_fan0_bmp) == FAN_BMP_SIZE, "Status fan bitmap (status_fan0_bmp) dimensions don't match data.");
#if STATUS_FAN_FRAMES > 1
static_assert(sizeof(status_fan1_bmp) == FAN_BMP_SIZE, "Status fan bitmap (status_fan1_bmp) dimensions don't match data.");
#if STATUS_FAN_FRAMES > 2
static_assert(sizeof(status_fan2_bmp) == FAN_BMP_SIZE, "Status fan bitmap (status_fan2_bmp) dimensions don't match data.");
#if STATUS_FAN_FRAMES > 3
static_assert(sizeof(status_fan3_bmp) == FAN_BMP_SIZE, "Status fan bitmap (status_fan3_bmp) dimensions don't match data.");
#endif
#endif
#endif
#endif
#if STATUS_LOGO_WIDTH && ENABLED(CUSTOM_STATUS_SCREEN_IMAGE)
#define DO_DRAW_LOGO 1
#endif
#if HOTENDS > 0
#define DO_DRAW_HOTENDS 1
#endif
#if HAS_HEATED_BED && HOTENDS <= 4
#define DO_DRAW_BED 1
#endif
#if HAS_CUTTER && !DO_DRAW_BED
#define DO_DRAW_CUTTER 1
#endif
#if HAS_COOLER
#define DO_DRAW_COOLER 1
#endif
#if ENABLED(LASER_COOLANT_FLOW_METER)
#define DO_DRAW_FLOWMETER 1
#endif
#if ENABLED(I2C_AMMETER)
#define DO_DRAW_AMMETER 1
#endif
#if HAS_TEMP_CHAMBER && STATUS_CHAMBER_WIDTH && HOTENDS <= 4
#define DO_DRAW_CHAMBER 1
#endif
#if HAS_FAN0 && STATUS_FAN_WIDTH && HOTENDS <= 4 && defined(STATUS_FAN_FRAMES)
#define DO_DRAW_FAN 1
#endif
#if ALL(HAS_HOTEND, STATUS_HOTEND_ANIM)
#define ANIM_HOTEND 1
#endif
#if ALL(DO_DRAW_BED, STATUS_BED_ANIM)
#define ANIM_BED 1
#endif
#if ALL(DO_DRAW_CHAMBER, STATUS_CHAMBER_ANIM)
#define ANIM_CHAMBER 1
#endif
#if ALL(DO_DRAW_CUTTER, STATUS_CUTTER_ANIM)
#define ANIM_CUTTER 1
#endif
#if ALL(DO_DRAW_COOLER, STATUS_COOLER_ANIM)
#define ANIM_COOLER 1
#endif
#if ALL(DO_DRAW_FLOWMETER, STATUS_FLOWMETER_ANIM)
#define ANIM_FLOWMETER 1
#endif
#if ANIM_HOTEND || ANIM_BED || ANIM_CHAMBER || ANIM_CUTTER
#define ANIM_HBCC 1
#endif
|
2301_81045437/Marlin
|
Marlin/src/lcd/dogm/dogm_Statusscreen.h
|
C++
|
agpl-3.0
| 23,916
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#pragma once
/**
* Fontname: -Misc-Fixed-Medium-R-Normal--9-90-75-75-C-60-ISO10646-1
* Copyright: Public domain font. Share and enjoy.
* Capital A Height: 6, '1' Height: 6
* Calculated Max Values w= 6 h= 9 x= 5 y= 5 dx= 6 dy= 0 ascent= 7 len= 9
* Font Bounding box w= 6 h= 9 x= 0 y=-2
* Calculated Min Values x= 0 y=-2 dx= 0 dy= 0
* Pure Font ascent = 6 descent=-2
* X Font ascent = 6 descent=-2
* Max Font ascent = 7 descent=-2
*/
#include <U8glib-HAL.h>
const u8g_fntpgm_uint8_t u8g_font_6x9[2434] U8G_FONT_SECTION(".progmem.u8g_font_6x9") = {
0x00,0x06,0x09,0x00,0xFE,0x06,0x02,0x0F,0x03,0x84,0x01,0xFF,0xFE,0x07,0xFE,0x06,
0xFE,0x05,0x07,0x07,0x00,0x00,0x00,0x40,0xF0,0xC8,0x88,0x98,0x78,0x10,0x05,0x07,
0x07,0x00,0x00,0x00,0xC0,0xF8,0x88,0x88,0x88,0x88,0xF8,0x05,0x05,0x05,0x00,0x00,
0x01,0x20,0x30,0xF8,0x30,0x20,0x05,0x07,0x07,0x00,0x00,0x00,0x20,0x70,0xF8,0x20,
0x20,0x20,0xE0,0x05,0x07,0x07,0x00,0x00,0x00,0x20,0x70,0xA8,0xB8,0x88,0x70,0x20,
0x06,0x05,0x05,0x00,0x00,0x00,0xB0,0xD8,0x6C,0xD8,0xB0,0x05,0x08,0x08,0x00,0x00,
0xFF,0xF8,0xA8,0x88,0x88,0x88,0x88,0xA8,0xF8,0x05,0x09,0x09,0x00,0x00,0xFE,0x20,
0x50,0x50,0x50,0x50,0x88,0xA8,0x88,0x70,0x03,0x03,0x03,0x00,0x00,0x03,0x40,0xA0,
0x40,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x06,0x05,0xFF,0x01,0x06,0x06,
0x06,0x02,0x00,0x80,0x80,0x80,0x80,0x00,0x80,0x03,0x03,0x03,0x06,0x01,0x03,0xA0,
0xA0,0xA0,0x05,0x07,0x07,0x06,0x00,0xFF,0x50,0x50,0xF8,0x50,0xF8,0x50,0x50,0x05,
0x09,0x09,0x06,0x00,0xFE,0x20,0x70,0xA8,0xA0,0x70,0x28,0xA8,0x70,0x20,0x06,0x08,
0x08,0x06,0x00,0xFF,0x40,0xA8,0x48,0x10,0x20,0x48,0x54,0x08,0x05,0x07,0x07,0x06,
0x00,0xFF,0x60,0x90,0x90,0x60,0x98,0x90,0x68,0x01,0x03,0x03,0x06,0x02,0x03,0x80,
0x80,0x80,0x02,0x07,0x07,0x06,0x02,0xFF,0x40,0x80,0x80,0x80,0x80,0x80,0x40,0x02,
0x07,0x07,0x06,0x02,0xFF,0x80,0x40,0x40,0x40,0x40,0x40,0x80,0x05,0x05,0x05,0x06,
0x00,0x00,0x88,0x50,0xF8,0x50,0x88,0x05,0x05,0x05,0x06,0x00,0x00,0x20,0x20,0xF8,
0x20,0x20,0x02,0x04,0x04,0x06,0x02,0xFE,0xC0,0x40,0x40,0x80,0x05,0x01,0x01,0x06,
0x00,0x02,0xF8,0x02,0x02,0x02,0x06,0x02,0x00,0xC0,0xC0,0x04,0x06,0x06,0x06,0x01,
0x00,0x10,0x10,0x20,0x40,0x80,0x80,0x04,0x06,0x06,0x06,0x01,0x00,0x60,0x90,0x90,
0x90,0x90,0x60,0x03,0x06,0x06,0x06,0x01,0x00,0x40,0xC0,0x40,0x40,0x40,0xE0,0x04,
0x06,0x06,0x06,0x01,0x00,0x60,0x90,0x10,0x20,0x40,0xF0,0x04,0x06,0x06,0x06,0x01,
0x00,0xF0,0x20,0x60,0x10,0x10,0xE0,0x05,0x06,0x06,0x06,0x00,0x00,0x10,0x30,0x50,
0x90,0xF8,0x10,0x04,0x06,0x06,0x06,0x01,0x00,0xF0,0x80,0xE0,0x10,0x10,0xE0,0x04,
0x06,0x06,0x06,0x01,0x00,0x60,0x80,0xE0,0x90,0x90,0x60,0x04,0x06,0x06,0x06,0x01,
0x00,0xF0,0x10,0x10,0x20,0x40,0x40,0x04,0x06,0x06,0x06,0x01,0x00,0x60,0x90,0x60,
0x90,0x90,0x60,0x04,0x06,0x06,0x06,0x01,0x00,0x60,0x90,0x90,0x70,0x10,0x60,0x02,
0x05,0x05,0x06,0x02,0x00,0xC0,0xC0,0x00,0xC0,0xC0,0x02,0x07,0x07,0x06,0x02,0xFE,
0xC0,0xC0,0x00,0xC0,0x40,0x40,0x80,0x05,0x05,0x05,0x06,0x00,0x00,0x18,0x60,0x80,
0x60,0x18,0x05,0x03,0x03,0x06,0x00,0x01,0xF8,0x00,0xF8,0x05,0x05,0x05,0x06,0x00,
0x00,0xC0,0x30,0x08,0x30,0xC0,0x04,0x07,0x07,0x06,0x01,0x00,0x60,0x90,0x10,0x60,
0x40,0x00,0x40,0x05,0x06,0x06,0x06,0x00,0x00,0x70,0x90,0xA8,0xB0,0x80,0x70,0x05,
0x06,0x06,0x06,0x00,0x00,0x20,0x50,0x88,0xF8,0x88,0x88,0x05,0x06,0x06,0x06,0x00,
0x00,0xF0,0x88,0xF0,0x88,0x88,0xF0,0x04,0x06,0x06,0x06,0x01,0x00,0x60,0x90,0x80,
0x80,0x90,0x60,0x04,0x06,0x06,0x06,0x01,0x00,0xE0,0x90,0x90,0x90,0x90,0xE0,0x04,
0x06,0x06,0x06,0x01,0x00,0xF0,0x80,0xE0,0x80,0x80,0xF0,0x04,0x06,0x06,0x06,0x01,
0x00,0xF0,0x80,0xE0,0x80,0x80,0x80,0x04,0x06,0x06,0x06,0x01,0x00,0x60,0x90,0x80,
0xB0,0x90,0x60,0x04,0x06,0x06,0x06,0x01,0x00,0x90,0x90,0xF0,0x90,0x90,0x90,0x03,
0x06,0x06,0x06,0x01,0x00,0xE0,0x40,0x40,0x40,0x40,0xE0,0x05,0x06,0x06,0x06,0x00,
0x00,0x38,0x10,0x10,0x10,0x90,0x60,0x04,0x06,0x06,0x06,0x01,0x00,0x90,0xA0,0xC0,
0xA0,0x90,0x90,0x04,0x06,0x06,0x06,0x01,0x00,0x80,0x80,0x80,0x80,0x80,0xF0,0x05,
0x06,0x06,0x06,0x00,0x00,0x88,0xD8,0xA8,0xA8,0x88,0x88,0x04,0x06,0x06,0x06,0x01,
0x00,0x90,0xD0,0xB0,0x90,0x90,0x90,0x05,0x06,0x06,0x06,0x00,0x00,0x70,0x88,0x88,
0x88,0x88,0x70,0x04,0x06,0x06,0x06,0x01,0x00,0xE0,0x90,0x90,0xE0,0x80,0x80,0x04,
0x07,0x07,0x06,0x01,0xFF,0x60,0x90,0x90,0xD0,0xB0,0x60,0x10,0x04,0x06,0x06,0x06,
0x01,0x00,0xE0,0x90,0x90,0xE0,0x90,0x90,0x04,0x06,0x06,0x06,0x01,0x00,0x60,0x90,
0x40,0x20,0x90,0x60,0x05,0x06,0x06,0x06,0x00,0x00,0xF8,0x20,0x20,0x20,0x20,0x20,
0x04,0x06,0x06,0x06,0x01,0x00,0x90,0x90,0x90,0x90,0x90,0x60,0x04,0x06,0x06,0x06,
0x01,0x00,0x90,0x90,0x90,0xF0,0x60,0x60,0x05,0x06,0x06,0x06,0x00,0x00,0x88,0x88,
0xA8,0xA8,0xD8,0x88,0x05,0x06,0x06,0x06,0x00,0x00,0x88,0x50,0x20,0x20,0x50,0x88,
0x05,0x06,0x06,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x04,0x06,0x06,0x06,
0x01,0x00,0xF0,0x10,0x20,0x40,0x80,0xF0,0x03,0x06,0x06,0x06,0x01,0x00,0xE0,0x80,
0x80,0x80,0x80,0xE0,0x04,0x06,0x06,0x06,0x01,0x00,0x80,0x80,0x40,0x20,0x10,0x10,
0x03,0x06,0x06,0x06,0x01,0x00,0xE0,0x20,0x20,0x20,0x20,0xE0,0x05,0x03,0x03,0x06,
0x00,0x03,0x20,0x50,0x88,0x05,0x01,0x01,0x06,0x00,0xFE,0xF8,0x02,0x02,0x02,0x06,
0x02,0x04,0x80,0x40,0x04,0x04,0x04,0x06,0x01,0x00,0x70,0x90,0x90,0x70,0x04,0x06,
0x06,0x06,0x01,0x00,0x80,0x80,0xE0,0x90,0x90,0xE0,0x04,0x04,0x04,0x06,0x01,0x00,
0x70,0x80,0x80,0x70,0x04,0x06,0x06,0x06,0x01,0x00,0x10,0x10,0x70,0x90,0x90,0x70,
0x04,0x04,0x04,0x06,0x01,0x00,0x60,0xB0,0xC0,0x70,0x04,0x06,0x06,0x06,0x01,0x00,
0x20,0x50,0x40,0xE0,0x40,0x40,0x04,0x06,0x06,0x06,0x01,0xFE,0x60,0x90,0x90,0x70,
0x10,0x60,0x04,0x06,0x06,0x06,0x01,0x00,0x80,0x80,0xE0,0x90,0x90,0x90,0x03,0x06,
0x06,0x06,0x01,0x00,0x40,0x00,0xC0,0x40,0x40,0xE0,0x03,0x08,0x08,0x06,0x01,0xFE,
0x20,0x00,0x60,0x20,0x20,0x20,0xA0,0x40,0x04,0x06,0x06,0x06,0x01,0x00,0x80,0x80,
0xA0,0xC0,0xA0,0x90,0x03,0x06,0x06,0x06,0x01,0x00,0xC0,0x40,0x40,0x40,0x40,0xE0,
0x05,0x04,0x04,0x06,0x00,0x00,0xD0,0xA8,0xA8,0x88,0x04,0x04,0x04,0x06,0x01,0x00,
0xE0,0x90,0x90,0x90,0x04,0x04,0x04,0x06,0x01,0x00,0x60,0x90,0x90,0x60,0x04,0x06,
0x06,0x06,0x01,0xFE,0xE0,0x90,0x90,0xE0,0x80,0x80,0x04,0x06,0x06,0x06,0x01,0xFE,
0x70,0x90,0x90,0x70,0x10,0x10,0x04,0x04,0x04,0x06,0x01,0x00,0xA0,0xD0,0x80,0x80,
0x04,0x04,0x04,0x06,0x01,0x00,0x70,0xC0,0x30,0xE0,0x04,0x06,0x06,0x06,0x01,0x00,
0x40,0x40,0xE0,0x40,0x50,0x20,0x04,0x04,0x04,0x06,0x01,0x00,0x90,0x90,0x90,0x70,
0x04,0x04,0x04,0x06,0x01,0x00,0x90,0x90,0x60,0x60,0x05,0x04,0x04,0x06,0x00,0x00,
0x88,0xA8,0xA8,0x50,0x04,0x04,0x04,0x06,0x01,0x00,0x90,0x60,0x60,0x90,0x04,0x06,
0x06,0x06,0x01,0xFE,0x90,0x90,0x90,0x70,0x90,0x60,0x04,0x04,0x04,0x06,0x01,0x00,
0xF0,0x20,0x40,0xF0,0x03,0x07,0x07,0x06,0x01,0x00,0x20,0x40,0x40,0x80,0x40,0x40,
0x20,0x01,0x07,0x07,0x06,0x02,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x03,0x07,
0x07,0x06,0x01,0x00,0x80,0x40,0x40,0x20,0x40,0x40,0x80,0x04,0x02,0x02,0x06,0x01,
0x03,0x50,0xA0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x06,0x05,0xFF,0x01,0x06,0x06,0x06,0x02,0x00,
0x80,0x00,0x80,0x80,0x80,0x80,0x04,0x06,0x06,0x06,0x01,0xFF,0x20,0x70,0xA0,0xA0,
0x70,0x20,0x05,0x07,0x07,0x06,0x00,0xFF,0x30,0x48,0x40,0xF0,0x40,0x40,0xF8,0x05,
0x05,0x05,0x06,0x00,0x00,0xA8,0x50,0x88,0x50,0xA8,0x05,0x06,0x06,0x06,0x00,0x00,
0x88,0x50,0xF8,0x20,0xF8,0x20,0x01,0x07,0x07,0x06,0x02,0xFF,0x80,0x80,0x80,0x00,
0x80,0x80,0x80,0x04,0x07,0x07,0x06,0x01,0xFF,0x70,0x80,0x60,0x90,0x60,0x10,0xE0,
0x03,0x01,0x01,0x06,0x01,0x05,0xA0,0x06,0x07,0x07,0x06,0x00,0x00,0x78,0x84,0x94,
0xA4,0x94,0x84,0x78,0x03,0x05,0x05,0x06,0x01,0x01,0x60,0xA0,0x60,0x00,0xE0,0x05,
0x05,0x05,0x06,0x00,0x00,0x28,0x50,0xA0,0x50,0x28,0x04,0x03,0x03,0x06,0x01,0x00,
0xF0,0x10,0x10,0x04,0x01,0x01,0x06,0x01,0x02,0xF0,0x06,0x07,0x07,0x06,0x00,0x00,
0x78,0x84,0xB4,0xA4,0xA4,0x84,0x78,0x04,0x01,0x01,0x06,0x01,0x05,0xF0,0x04,0x03,
0x03,0x06,0x01,0x02,0x60,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0xFF,0x20,0x20,0xF8,
0x20,0x20,0x00,0xF8,0x03,0x05,0x05,0x06,0x01,0x01,0x40,0xA0,0x20,0x40,0xE0,0x03,
0x05,0x05,0x06,0x01,0x01,0xC0,0x20,0x40,0x20,0xC0,0x02,0x02,0x02,0x06,0x02,0x04,
0x40,0x80,0x04,0x05,0x05,0x06,0x01,0xFF,0x90,0x90,0xB0,0xD0,0x80,0x05,0x06,0x06,
0x06,0x00,0x00,0x78,0xE8,0xE8,0x68,0x28,0x28,0x01,0x01,0x01,0x06,0x02,0x02,0x80,
0x02,0x02,0x02,0x06,0x02,0xFE,0x40,0x80,0x03,0x05,0x05,0x06,0x01,0x01,0x40,0xC0,
0x40,0x40,0xE0,0x03,0x05,0x05,0x06,0x01,0x01,0x40,0xA0,0x40,0x00,0xE0,0x05,0x05,
0x05,0x06,0x00,0x00,0xA0,0x50,0x28,0x50,0xA0,0x05,0x08,0x08,0x06,0x00,0xFF,0x40,
0xC0,0x40,0x50,0x70,0x30,0x78,0x10,0x05,0x08,0x08,0x06,0x00,0xFF,0x40,0xC0,0x40,
0x50,0x68,0x08,0x10,0x38,0x05,0x08,0x08,0x06,0x00,0xFF,0xC0,0x20,0x40,0x30,0xF0,
0x30,0x78,0x10,0x04,0x07,0x07,0x06,0x01,0x00,0x20,0x00,0x20,0x60,0x80,0x90,0x60,
0x05,0x07,0x07,0x06,0x00,0x00,0x40,0x20,0x20,0x50,0x70,0x88,0x88,0x05,0x07,0x07,
0x06,0x00,0x00,0x10,0x20,0x20,0x50,0x70,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,
0x20,0x50,0x20,0x50,0x70,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x28,0x50,0x20,
0x50,0x70,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x50,0x00,0x20,0x50,0x70,0x88,
0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x50,0x20,0x50,0x70,0x88,0x88,0x05,0x06,
0x06,0x06,0x00,0x00,0x78,0xA0,0xF0,0xA0,0xA0,0xB8,0x04,0x08,0x08,0x06,0x01,0xFE,
0x60,0x90,0x80,0x80,0x90,0x60,0x20,0x40,0x04,0x07,0x07,0x06,0x01,0x00,0x40,0x20,
0xF0,0x80,0xE0,0x80,0xF0,0x04,0x07,0x07,0x06,0x01,0x00,0x20,0x40,0xF0,0x80,0xE0,
0x80,0xF0,0x04,0x07,0x07,0x06,0x01,0x00,0x20,0x50,0xF0,0x80,0xE0,0x80,0xF0,0x04,
0x07,0x07,0x06,0x01,0x00,0x50,0x00,0xF0,0x80,0xE0,0x80,0xF0,0x03,0x07,0x07,0x06,
0x01,0x00,0x80,0x40,0xE0,0x40,0x40,0x40,0xE0,0x03,0x07,0x07,0x06,0x01,0x00,0x20,
0x40,0xE0,0x40,0x40,0x40,0xE0,0x03,0x07,0x07,0x06,0x01,0x00,0x40,0xA0,0xE0,0x40,
0x40,0x40,0xE0,0x03,0x07,0x07,0x06,0x01,0x00,0xA0,0x00,0xE0,0x40,0x40,0x40,0xE0,
0x05,0x06,0x06,0x06,0x00,0x00,0x70,0x48,0xE8,0x48,0x48,0x70,0x04,0x07,0x07,0x06,
0x01,0x00,0x50,0xA0,0x90,0xD0,0xB0,0x90,0x90,0x04,0x07,0x07,0x06,0x01,0x00,0x40,
0x20,0x60,0x90,0x90,0x90,0x60,0x04,0x07,0x07,0x06,0x01,0x00,0x20,0x40,0x60,0x90,
0x90,0x90,0x60,0x04,0x07,0x07,0x06,0x01,0x00,0x20,0x50,0x60,0x90,0x90,0x90,0x60,
0x04,0x07,0x07,0x06,0x01,0x00,0x50,0xA0,0x60,0x90,0x90,0x90,0x60,0x04,0x07,0x07,
0x06,0x01,0x00,0x50,0x00,0x60,0x90,0x90,0x90,0x60,0x05,0x05,0x05,0x06,0x00,0x00,
0x88,0x50,0x20,0x50,0x88,0x04,0x08,0x08,0x06,0x01,0xFF,0x10,0x70,0xB0,0xB0,0xD0,
0xD0,0xE0,0x80,0x04,0x07,0x07,0x06,0x01,0x00,0x40,0x20,0x90,0x90,0x90,0x90,0x60,
0x04,0x07,0x07,0x06,0x01,0x00,0x20,0x40,0x90,0x90,0x90,0x90,0x60,0x04,0x07,0x07,
0x06,0x01,0x00,0x20,0x50,0x90,0x90,0x90,0x90,0x60,0x04,0x07,0x07,0x06,0x01,0x00,
0x50,0x00,0x90,0x90,0x90,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x10,0x20,0x88,
0x50,0x20,0x20,0x20,0x04,0x06,0x06,0x06,0x01,0x00,0x80,0xE0,0x90,0x90,0xE0,0x80,
0x04,0x06,0x06,0x06,0x01,0x00,0x60,0x90,0xA0,0xA0,0x90,0xA0,0x04,0x07,0x07,0x06,
0x01,0x00,0x40,0x20,0x00,0x70,0x90,0x90,0x70,0x04,0x07,0x07,0x06,0x01,0x00,0x20,
0x40,0x00,0x70,0x90,0x90,0x70,0x04,0x07,0x07,0x06,0x01,0x00,0x20,0x50,0x00,0x70,
0x90,0x90,0x70,0x04,0x07,0x07,0x06,0x01,0x00,0x50,0xA0,0x00,0x70,0x90,0x90,0x70,
0x04,0x06,0x06,0x06,0x01,0x00,0x50,0x00,0x70,0x90,0x90,0x70,0x04,0x07,0x07,0x06,
0x01,0x00,0x20,0x50,0x20,0x70,0x90,0x90,0x70,0x05,0x04,0x04,0x06,0x00,0x00,0x70,
0xA8,0xB0,0x78,0x04,0x06,0x06,0x06,0x01,0xFE,0x70,0x80,0x80,0x70,0x20,0x40,0x04,
0x07,0x07,0x06,0x01,0x00,0x40,0x20,0x00,0x60,0xB0,0xC0,0x70,0x04,0x07,0x07,0x06,
0x01,0x00,0x20,0x40,0x00,0x60,0xB0,0xC0,0x70,0x04,0x07,0x07,0x06,0x01,0x00,0x20,
0x50,0x00,0x60,0xB0,0xC0,0x70,0x04,0x06,0x06,0x06,0x01,0x00,0x50,0x00,0x60,0xB0,
0xC0,0x70,0x03,0x07,0x07,0x06,0x01,0x00,0x80,0x40,0x00,0xC0,0x40,0x40,0xE0,0x03,
0x07,0x07,0x06,0x01,0x00,0x20,0x40,0x00,0xC0,0x40,0x40,0xE0,0x03,0x07,0x07,0x06,
0x01,0x00,0x40,0xA0,0x00,0xC0,0x40,0x40,0xE0,0x03,0x06,0x06,0x06,0x01,0x00,0xA0,
0x00,0xC0,0x40,0x40,0xE0,0x04,0x07,0x07,0x06,0x01,0x00,0x30,0x60,0x10,0x70,0x90,
0x90,0x60,0x04,0x07,0x07,0x06,0x01,0x00,0x50,0xA0,0x00,0xE0,0x90,0x90,0x90,0x04,
0x07,0x07,0x06,0x01,0x00,0x40,0x20,0x00,0x60,0x90,0x90,0x60,0x04,0x07,0x07,0x06,
0x01,0x00,0x20,0x40,0x00,0x60,0x90,0x90,0x60,0x04,0x07,0x07,0x06,0x01,0x00,0x20,
0x50,0x00,0x60,0x90,0x90,0x60,0x04,0x07,0x07,0x06,0x01,0x00,0x50,0xA0,0x00,0x60,
0x90,0x90,0x60,0x04,0x06,0x06,0x06,0x01,0x00,0x50,0x00,0x60,0x90,0x90,0x60,0x05,
0x05,0x05,0x06,0x00,0x00,0x20,0x00,0xF8,0x00,0x20,0x04,0x04,0x04,0x06,0x01,0x00,
0x70,0xB0,0xD0,0xE0,0x04,0x07,0x07,0x06,0x01,0x00,0x40,0x20,0x00,0x90,0x90,0x90,
0x70,0x04,0x07,0x07,0x06,0x01,0x00,0x20,0x40,0x00,0x90,0x90,0x90,0x70,0x04,0x07,
0x07,0x06,0x01,0x00,0x20,0x50,0x00,0x90,0x90,0x90,0x70,0x04,0x06,0x06,0x06,0x01,
0x00,0x50,0x00,0x90,0x90,0x90,0x70,0x04,0x09,0x09,0x06,0x01,0xFE,0x20,0x40,0x00,
0x90,0x90,0x90,0x70,0x90,0x60,0x04,0x08,0x08,0x06,0x01,0xFE,0x80,0x80,0xE0,0x90,
0x90,0xE0,0x80,0x80,0x04,0x08,0x08,0x06,0x01,0xFE,0x50,0x00,0x90,0x90,0x90,0x70,
0x90,0x60
};
|
2301_81045437/Marlin
|
Marlin/src/lcd/dogm/fontdata/fontdata_6x9_marlin.h
|
C
|
agpl-3.0
| 14,074
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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/>.
*
*/
#include <U8glib-HAL.h>
#if defined(__AVR__) && ENABLED(NOT_EXTENDED_ISO10646_1_5X7)
// reduced font (only symbols 1 - 127) - saves about 1278 bytes of FLASH
/**
* Fontname: -Marlin6x12-Fixed-Medium-R-SemiCondensed--12-90-100-100-C-111-ISO10646-1
* Copyright: Public domain terminal emulator font. Share and enjoy. original font -Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1
* Capital A Height: 7, '1' Height: 7
* Calculated Max Values w= 7 h=10 x= 5 y= 5 dx= 7 dy= 0 ascent= 8 len=10
* Font Bounding box w=12 h=15 x= 0 y=-2
* Calculated Min Values x= 0 y=-2 dx= 0 dy= 0
* Pure Font ascent = 7 descent=-2
* X Font ascent = 8 descent=-2
* Max Font ascent = 8 descent=-2
*/
const u8g_fntpgm_uint8_t ISO10646_1_5x7[1324] U8G_FONT_SECTION("ISO10646_1_5x7") = {
0x00,0x0C,0x0F,0x00,0xFE,0x07,0x02,0x25,0x03,0xBB,0x01,0x7F,0xFE,0x08,0xFE,0x08,
0xFE,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0xF0,0xC8,0x88,0x88,0x98,0x78,0x10,0x05,
0x08,0x08,0x06,0x00,0x00,0xC0,0xF8,0x88,0x88,0x88,0x88,0x88,0xF8,0x05,0x05,0x05,
0x06,0x00,0x01,0x20,0x30,0xF8,0x30,0x20,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x70,
0xF8,0x20,0x20,0x20,0x20,0xE0,0x05,0x09,0x09,0x06,0x00,0xFF,0x20,0x70,0xA8,0xA8,
0xB8,0x88,0x88,0x70,0x20,0x07,0x05,0x05,0x07,0x00,0x01,0xD8,0x6C,0x36,0x6C,0xD8,
0x05,0x09,0x09,0x06,0x00,0xFF,0xF8,0xA8,0x88,0x88,0x88,0x88,0x88,0xA8,0xF8,0x05,
0x0A,0x0A,0x06,0x00,0xFE,0x20,0x50,0x50,0x50,0x50,0x88,0xA8,0xA8,0x88,0x70,0x03,
0x03,0x03,0x06,0x00,0x03,0x40,0xA0,0x40,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,
0x00,0x06,0x05,0xFF,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x80,0x80,0x80,0x80,0x00,
0x80,0x03,0x03,0x03,0x06,0x01,0x05,0xA0,0xA0,0xA0,0x05,0x06,0x06,0x06,0x00,0x00,
0x50,0xF8,0x50,0x50,0xF8,0x50,0x05,0x09,0x09,0x06,0x00,0xFF,0x20,0x70,0xA8,0xA0,
0x70,0x28,0xA8,0x70,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0xC8,0xC8,0x10,0x20,0x40,
0x98,0x98,0x05,0x07,0x07,0x06,0x00,0x00,0x40,0xA0,0xA0,0x40,0xA8,0x90,0x68,0x01,
0x03,0x03,0x06,0x02,0x05,0x80,0x80,0x80,0x03,0x09,0x09,0x06,0x01,0xFF,0x20,0x40,
0x40,0x80,0x80,0x80,0x40,0x40,0x20,0x03,0x09,0x09,0x06,0x01,0xFF,0x80,0x40,0x40,
0x20,0x20,0x20,0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0xA8,0x70,0x20,
0x70,0xA8,0x20,0x05,0x05,0x05,0x06,0x00,0x01,0x20,0x20,0xF8,0x20,0x20,0x02,0x03,
0x03,0x06,0x01,0xFF,0xC0,0x40,0x80,0x05,0x01,0x01,0x06,0x00,0x03,0xF8,0x02,0x02,
0x02,0x06,0x01,0x00,0xC0,0xC0,0x05,0x07,0x07,0x06,0x00,0x00,0x08,0x10,0x10,0x20,
0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x98,0xA8,0xC8,0x88,0x70,
0x03,0x07,0x07,0x06,0x01,0x00,0x40,0xC0,0x40,0x40,0x40,0x40,0xE0,0x05,0x07,0x07,
0x06,0x00,0x00,0x70,0x88,0x08,0x10,0x20,0x40,0xF8,0x05,0x07,0x07,0x06,0x00,0x00,
0xF8,0x08,0x10,0x30,0x08,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x10,0x30,0x50,
0x90,0xF8,0x10,0x10,0x05,0x07,0x07,0x06,0x00,0x00,0xF8,0x80,0xF0,0x08,0x08,0x88,
0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x30,0x40,0x80,0xF0,0x88,0x88,0x70,0x05,0x07,
0x07,0x06,0x00,0x00,0xF8,0x08,0x10,0x10,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,
0x00,0x70,0x88,0x88,0x70,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,
0x88,0x78,0x08,0x10,0x60,0x02,0x05,0x05,0x06,0x01,0x00,0xC0,0xC0,0x00,0xC0,0xC0,
0x02,0x06,0x06,0x06,0x01,0xFF,0xC0,0xC0,0x00,0xC0,0x40,0x80,0x03,0x05,0x05,0x06,
0x01,0x01,0x20,0x40,0x80,0x40,0x20,0x05,0x03,0x03,0x06,0x00,0x02,0xF8,0x00,0xF8,
0x03,0x05,0x05,0x06,0x01,0x01,0x80,0x40,0x20,0x40,0x80,0x05,0x07,0x07,0x06,0x00,
0x00,0x70,0x88,0x10,0x20,0x20,0x00,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,
0xB8,0xA8,0xB8,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xF8,0x88,
0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0xF0,0x48,0x48,0x70,0x48,0x48,0xF0,0x05,
0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x05,0x07,0x07,0x06,
0x00,0x00,0xF0,0x48,0x48,0x48,0x48,0x48,0xF0,0x05,0x07,0x07,0x06,0x00,0x00,0xF8,
0x80,0x80,0xF0,0x80,0x80,0xF8,0x05,0x07,0x07,0x06,0x00,0x00,0xF8,0x80,0x80,0xF0,
0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x80,0x98,0x88,0x70,
0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xF8,0x88,0x88,0x88,0x03,0x07,0x07,
0x06,0x01,0x00,0xE0,0x40,0x40,0x40,0x40,0x40,0xE0,0x05,0x07,0x07,0x06,0x00,0x00,
0x38,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90,0xA0,
0xC0,0xA0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,
0xF8,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xD8,0xA8,0x88,0x88,0x88,0x88,0x05,0x07,
0x07,0x06,0x00,0x00,0x88,0x88,0xC8,0xA8,0x98,0x88,0x88,0x05,0x07,0x07,0x06,0x00,
0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xF0,0x88,
0x88,0xF0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0xA8,
0x90,0x68,0x05,0x07,0x07,0x06,0x00,0x00,0xF0,0x88,0x88,0xF0,0xA0,0x90,0x88,0x05,
0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x05,0x07,0x07,0x06,
0x00,0x00,0xF8,0x20,0x20,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,
0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0x88,
0x50,0x50,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0x88,0xA8,0xA8,0x50,
0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x50,0x88,0x88,0x05,0x07,0x07,
0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,
0xF8,0x08,0x10,0x20,0x40,0x80,0xF8,0x03,0x09,0x09,0x06,0x01,0xFF,0xE0,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0xE0,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x40,0x40,0x20,
0x10,0x10,0x08,0x03,0x09,0x09,0x06,0x01,0xFF,0xE0,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0xE0,0x05,0x03,0x03,0x06,0x00,0x05,0x20,0x50,0x88,0x05,0x01,0x01,0x06,0x00,
0xFE,0xF8,0x03,0x03,0x03,0x06,0x01,0x05,0x80,0x40,0x20,0x05,0x05,0x05,0x06,0x00,
0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0xF0,0x88,
0x88,0x88,0xF0,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x80,0x80,0x88,0x70,0x05,0x07,
0x07,0x06,0x00,0x00,0x08,0x08,0x78,0x88,0x88,0x88,0x78,0x05,0x05,0x05,0x06,0x00,
0x00,0x70,0x88,0xF0,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x30,0x48,0x40,0xE0,
0x40,0x40,0x40,0x05,0x07,0x07,0x06,0x00,0xFE,0x70,0x88,0x88,0x88,0x78,0x08,0x70,
0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x88,0x03,0x07,0x07,
0x06,0x01,0x00,0x40,0x00,0xC0,0x40,0x40,0x40,0xE0,0x04,0x09,0x09,0x06,0x01,0xFE,
0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x80,
0x80,0x88,0x90,0xE0,0x90,0x88,0x03,0x07,0x07,0x06,0x01,0x00,0xC0,0x40,0x40,0x40,
0x40,0x40,0xE0,0x05,0x05,0x05,0x06,0x00,0x00,0xD0,0xA8,0xA8,0xA8,0xA8,0x05,0x05,
0x05,0x06,0x00,0x00,0xB0,0xC8,0x88,0x88,0x88,0x05,0x05,0x05,0x06,0x00,0x00,0x70,
0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0xFE,0xF0,0x88,0x88,0x88,0xF0,0x80,
0x80,0x05,0x07,0x07,0x06,0x00,0xFE,0x78,0x88,0x88,0x88,0x78,0x08,0x08,0x05,0x05,
0x05,0x06,0x00,0x00,0xB0,0xC8,0x80,0x80,0x80,0x05,0x05,0x05,0x06,0x00,0x00,0x78,
0x80,0x70,0x08,0xF0,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0xF8,0x20,0x20,0x20,
0x18,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0x88,0x98,0x68,0x05,0x05,0x05,0x06,
0x00,0x00,0x88,0x88,0x88,0x50,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0xA8,
0xA8,0x50,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x05,0x07,0x07,
0x06,0x00,0xFE,0x88,0x88,0x88,0x50,0x20,0x40,0x80,0x05,0x05,0x05,0x06,0x00,0x00,
0xF8,0x10,0x20,0x40,0xF8,0x03,0x09,0x09,0x06,0x01,0xFF,0x20,0x40,0x40,0x40,0x80,
0x40,0x40,0x40,0x20,0x01,0x09,0x09,0x06,0x02,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x03,0x09,0x09,0x06,0x01,0xFF,0x80,0x40,0x40,0x40,0x20,0x40,0x40,
0x40,0x80,0x05,0x03,0x03,0x06,0x00,0x02,0x48,0xA8,0x90,0xFF};
#else
// extended (original) font (symbols 1 - 255)
/**
* Fontname: -Marlin6x12-Fixed-Medium-R-SemiCondensed--12-90-100-100-C-111-ISO10646-1
* Copyright: Public domain terminal emulator font. Share and enjoy. original font -Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1
* Capital A Height: 7, '1' Height: 7
* Calculated Max Values w= 7 h=10 x= 5 y= 7 dx= 7 dy= 0 ascent=10 len=10
* Font Bounding box w=12 h=15 x= 0 y=-2
* Calculated Min Values x= 0 y=-2 dx= 0 dy= 0
* Pure Font ascent = 7 descent=-2
* X Font ascent = 8 descent=-2
* Max Font ascent =10 descent=-2
*/
const u8g_fntpgm_uint8_t ISO10646_1_5x7[2647] U8G_FONT_SECTION("ISO10646_1_5x7") = {
0x00,0x0C,0x0F,0x00,0xFE,0x07,0x02,0x25,0x03,0xBB,0x01,0xFF,0xFE,0x0A,0xFE,0x08,
0xFE,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0xF0,0xC8,0x88,0x88,0x98,0x78,0x10,0x05,
0x08,0x08,0x06,0x00,0x00,0xC0,0xF8,0x88,0x88,0x88,0x88,0x88,0xF8,0x05,0x05,0x05,
0x06,0x00,0x01,0x20,0x30,0xF8,0x30,0x20,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x70,
0xF8,0x20,0x20,0x20,0x20,0xE0,0x05,0x09,0x09,0x06,0x00,0xFF,0x20,0x70,0xA8,0xA8,
0xB8,0x88,0x88,0x70,0x20,0x07,0x05,0x05,0x07,0x00,0x01,0xD8,0x6C,0x36,0x6C,0xD8,
0x05,0x09,0x09,0x06,0x00,0xFF,0xF8,0xA8,0x88,0x88,0x88,0x88,0x88,0xA8,0xF8,0x05,
0x0A,0x0A,0x06,0x00,0xFE,0x20,0x50,0x50,0x50,0x50,0x88,0xA8,0xA8,0x88,0x70,0x03,
0x03,0x03,0x06,0x00,0x03,0x40,0xA0,0x40,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,
0x00,0x06,0x05,0xFF,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x80,0x80,0x80,0x80,0x00,
0x80,0x03,0x03,0x03,0x06,0x01,0x05,0xA0,0xA0,0xA0,0x05,0x06,0x06,0x06,0x00,0x00,
0x50,0xF8,0x50,0x50,0xF8,0x50,0x05,0x09,0x09,0x06,0x00,0xFF,0x20,0x70,0xA8,0xA0,
0x70,0x28,0xA8,0x70,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0xC8,0xC8,0x10,0x20,0x40,
0x98,0x98,0x05,0x07,0x07,0x06,0x00,0x00,0x40,0xA0,0xA0,0x40,0xA8,0x90,0x68,0x01,
0x03,0x03,0x06,0x02,0x05,0x80,0x80,0x80,0x03,0x09,0x09,0x06,0x01,0xFF,0x20,0x40,
0x40,0x80,0x80,0x80,0x40,0x40,0x20,0x03,0x09,0x09,0x06,0x01,0xFF,0x80,0x40,0x40,
0x20,0x20,0x20,0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0xA8,0x70,0x20,
0x70,0xA8,0x20,0x05,0x05,0x05,0x06,0x00,0x01,0x20,0x20,0xF8,0x20,0x20,0x02,0x03,
0x03,0x06,0x01,0xFF,0xC0,0x40,0x80,0x05,0x01,0x01,0x06,0x00,0x03,0xF8,0x02,0x02,
0x02,0x06,0x01,0x00,0xC0,0xC0,0x05,0x07,0x07,0x06,0x00,0x00,0x08,0x10,0x10,0x20,
0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x98,0xA8,0xC8,0x88,0x70,
0x03,0x07,0x07,0x06,0x01,0x00,0x40,0xC0,0x40,0x40,0x40,0x40,0xE0,0x05,0x07,0x07,
0x06,0x00,0x00,0x70,0x88,0x08,0x10,0x20,0x40,0xF8,0x05,0x07,0x07,0x06,0x00,0x00,
0xF8,0x08,0x10,0x30,0x08,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x10,0x30,0x50,
0x90,0xF8,0x10,0x10,0x05,0x07,0x07,0x06,0x00,0x00,0xF8,0x80,0xF0,0x08,0x08,0x88,
0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x30,0x40,0x80,0xF0,0x88,0x88,0x70,0x05,0x07,
0x07,0x06,0x00,0x00,0xF8,0x08,0x10,0x10,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,
0x00,0x70,0x88,0x88,0x70,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,
0x88,0x78,0x08,0x10,0x60,0x02,0x05,0x05,0x06,0x01,0x00,0xC0,0xC0,0x00,0xC0,0xC0,
0x02,0x06,0x06,0x06,0x01,0xFF,0xC0,0xC0,0x00,0xC0,0x40,0x80,0x03,0x05,0x05,0x06,
0x01,0x01,0x20,0x40,0x80,0x40,0x20,0x05,0x03,0x03,0x06,0x00,0x02,0xF8,0x00,0xF8,
0x03,0x05,0x05,0x06,0x01,0x01,0x80,0x40,0x20,0x40,0x80,0x05,0x07,0x07,0x06,0x00,
0x00,0x70,0x88,0x10,0x20,0x20,0x00,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,
0xB8,0xA8,0xB8,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xF8,0x88,
0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0xF0,0x48,0x48,0x70,0x48,0x48,0xF0,0x05,
0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x05,0x07,0x07,0x06,
0x00,0x00,0xF0,0x48,0x48,0x48,0x48,0x48,0xF0,0x05,0x07,0x07,0x06,0x00,0x00,0xF8,
0x80,0x80,0xF0,0x80,0x80,0xF8,0x05,0x07,0x07,0x06,0x00,0x00,0xF8,0x80,0x80,0xF0,
0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x80,0x98,0x88,0x70,
0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xF8,0x88,0x88,0x88,0x03,0x07,0x07,
0x06,0x01,0x00,0xE0,0x40,0x40,0x40,0x40,0x40,0xE0,0x05,0x07,0x07,0x06,0x00,0x00,
0x38,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90,0xA0,
0xC0,0xA0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,
0xF8,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xD8,0xA8,0x88,0x88,0x88,0x88,0x05,0x07,
0x07,0x06,0x00,0x00,0x88,0x88,0xC8,0xA8,0x98,0x88,0x88,0x05,0x07,0x07,0x06,0x00,
0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xF0,0x88,
0x88,0xF0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0xA8,
0x90,0x68,0x05,0x07,0x07,0x06,0x00,0x00,0xF0,0x88,0x88,0xF0,0xA0,0x90,0x88,0x05,
0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x05,0x07,0x07,0x06,
0x00,0x00,0xF8,0x20,0x20,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,
0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0x88,
0x50,0x50,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0x88,0xA8,0xA8,0x50,
0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x50,0x88,0x88,0x05,0x07,0x07,
0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,
0xF8,0x08,0x10,0x20,0x40,0x80,0xF8,0x03,0x09,0x09,0x06,0x01,0xFF,0xE0,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0xE0,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x40,0x40,0x20,
0x10,0x10,0x08,0x03,0x09,0x09,0x06,0x01,0xFF,0xE0,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0xE0,0x05,0x03,0x03,0x06,0x00,0x05,0x20,0x50,0x88,0x05,0x01,0x01,0x06,0x00,
0xFE,0xF8,0x03,0x03,0x03,0x06,0x01,0x05,0x80,0x40,0x20,0x05,0x05,0x05,0x06,0x00,
0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0xF0,0x88,
0x88,0x88,0xF0,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x80,0x80,0x88,0x70,0x05,0x07,
0x07,0x06,0x00,0x00,0x08,0x08,0x78,0x88,0x88,0x88,0x78,0x05,0x05,0x05,0x06,0x00,
0x00,0x70,0x88,0xF0,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x30,0x48,0x40,0xE0,
0x40,0x40,0x40,0x05,0x07,0x07,0x06,0x00,0xFE,0x70,0x88,0x88,0x88,0x78,0x08,0x70,
0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x88,0x03,0x07,0x07,
0x06,0x01,0x00,0x40,0x00,0xC0,0x40,0x40,0x40,0xE0,0x04,0x09,0x09,0x06,0x01,0xFE,
0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x80,
0x80,0x88,0x90,0xE0,0x90,0x88,0x03,0x07,0x07,0x06,0x01,0x00,0xC0,0x40,0x40,0x40,
0x40,0x40,0xE0,0x05,0x05,0x05,0x06,0x00,0x00,0xD0,0xA8,0xA8,0xA8,0xA8,0x05,0x05,
0x05,0x06,0x00,0x00,0xB0,0xC8,0x88,0x88,0x88,0x05,0x05,0x05,0x06,0x00,0x00,0x70,
0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0xFE,0xF0,0x88,0x88,0x88,0xF0,0x80,
0x80,0x05,0x07,0x07,0x06,0x00,0xFE,0x78,0x88,0x88,0x88,0x78,0x08,0x08,0x05,0x05,
0x05,0x06,0x00,0x00,0xB0,0xC8,0x80,0x80,0x80,0x05,0x05,0x05,0x06,0x00,0x00,0x78,
0x80,0x70,0x08,0xF0,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0xF8,0x20,0x20,0x20,
0x18,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0x88,0x98,0x68,0x05,0x05,0x05,0x06,
0x00,0x00,0x88,0x88,0x88,0x50,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0xA8,
0xA8,0x50,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x05,0x07,0x07,
0x06,0x00,0xFE,0x88,0x88,0x88,0x50,0x20,0x40,0x80,0x05,0x05,0x05,0x06,0x00,0x00,
0xF8,0x10,0x20,0x40,0xF8,0x03,0x09,0x09,0x06,0x01,0xFF,0x20,0x40,0x40,0x40,0x80,
0x40,0x40,0x40,0x20,0x01,0x09,0x09,0x06,0x02,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x03,0x09,0x09,0x06,0x01,0xFF,0x80,0x40,0x40,0x40,0x20,0x40,0x40,
0x40,0x80,0x05,0x03,0x03,0x06,0x00,0x02,0x48,0xA8,0x90,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x06,
0x05,0xFF,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x00,0x80,0x80,0x80,0x80,0x80,0x05,
0x07,0x07,0x06,0x00,0xFF,0x20,0x70,0xA8,0xA0,0xA8,0x70,0x20,0x05,0x07,0x07,0x06,
0x00,0x00,0x30,0x48,0x40,0xE0,0x40,0x48,0xB0,0x05,0x05,0x05,0x06,0x00,0x00,0xA8,
0x50,0x88,0x50,0xA8,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x50,0xF8,0x20,0xF8,0x20,
0x20,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x04,0x08,
0x08,0x06,0x01,0x00,0x70,0x80,0x60,0x90,0x90,0x60,0x10,0xE0,0x03,0x01,0x01,0x06,
0x01,0x07,0xA0,0x06,0x07,0x07,0x06,0x00,0x00,0x78,0x84,0xB4,0xA4,0xB4,0x84,0x78,
0x03,0x05,0x05,0x06,0x01,0x04,0x60,0xA0,0x60,0x00,0xE0,0x05,0x05,0x05,0x06,0x00,
0x00,0x28,0x50,0xA0,0x50,0x28,0x05,0x03,0x03,0x06,0x00,0x01,0xF8,0x08,0x08,0x03,
0x01,0x01,0x06,0x01,0x03,0xE0,0x06,0x07,0x07,0x06,0x00,0x00,0x78,0x84,0xB4,0xA4,
0xA4,0x84,0x78,0x05,0x01,0x01,0x06,0x00,0x07,0xF8,0x04,0x04,0x04,0x06,0x01,0x05,
0x60,0x90,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0xF8,0x20,0x20,0x00,
0xF8,0x03,0x05,0x05,0x06,0x01,0x04,0x40,0xA0,0x20,0x40,0xE0,0x03,0x05,0x05,0x06,
0x01,0x04,0xC0,0x20,0x40,0x20,0xC0,0x03,0x03,0x03,0x06,0x01,0x05,0x20,0x40,0x80,
0x05,0x07,0x07,0x06,0x00,0xFE,0x88,0x88,0x88,0x98,0xE8,0x80,0x80,0x05,0x08,0x08,
0x06,0x00,0x00,0x78,0xE8,0xE8,0xE8,0x68,0x28,0x28,0x28,0x02,0x02,0x02,0x06,0x02,
0x03,0xC0,0xC0,0x03,0x02,0x02,0x06,0x01,0xFE,0x20,0xC0,0x03,0x05,0x05,0x06,0x01,
0x04,0x40,0xC0,0x40,0x40,0xE0,0x03,0x05,0x05,0x06,0x01,0x05,0x40,0xA0,0x40,0x00,
0xE0,0x05,0x05,0x05,0x06,0x00,0x00,0xA0,0x50,0x28,0x50,0xA0,0x05,0x0A,0x0A,0x06,
0x00,0x00,0x40,0xC0,0x48,0x50,0x60,0x50,0xB0,0x50,0x78,0x10,0x05,0x0A,0x0A,0x06,
0x00,0x00,0x40,0xC0,0x48,0x50,0x60,0x50,0xA8,0x08,0x10,0x38,0x05,0x0A,0x0A,0x06,
0x00,0x00,0xC0,0x20,0x48,0x30,0xE0,0x50,0xB0,0x50,0x78,0x10,0x05,0x07,0x07,0x06,
0x00,0x00,0x20,0x00,0x20,0x20,0x40,0x88,0x70,0x05,0x0A,0x0A,0x06,0x00,0x00,0x40,
0x20,0x00,0x70,0x88,0x88,0xF8,0x88,0x88,0x88,0x05,0x0A,0x0A,0x06,0x00,0x00,0x10,
0x20,0x00,0x70,0x88,0x88,0xF8,0x88,0x88,0x88,0x05,0x0A,0x0A,0x06,0x00,0x00,0x20,
0x50,0x00,0x70,0x88,0x88,0xF8,0x88,0x88,0x88,0x05,0x0A,0x0A,0x06,0x00,0x00,0x68,
0xB0,0x00,0x70,0x88,0x88,0xF8,0x88,0x88,0x88,0x05,0x09,0x09,0x06,0x00,0x00,0x50,
0x00,0x70,0x88,0x88,0xF8,0x88,0x88,0x88,0x05,0x0A,0x0A,0x06,0x00,0x00,0x20,0x50,
0x20,0x70,0x88,0x88,0xF8,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x78,0xA0,
0xA0,0xF0,0xA0,0xA0,0xB8,0x05,0x09,0x09,0x06,0x00,0xFE,0x70,0x88,0x80,0x80,0x80,
0x88,0x70,0x10,0x60,0x05,0x0A,0x0A,0x06,0x00,0x00,0x40,0x20,0x00,0xF8,0x80,0x80,
0xF0,0x80,0x80,0xF8,0x05,0x0A,0x0A,0x06,0x00,0x00,0x10,0x20,0x00,0xF8,0x80,0x80,
0xF0,0x80,0x80,0xF8,0x05,0x0A,0x0A,0x06,0x00,0x00,0x20,0x50,0x00,0xF8,0x80,0x80,
0xF0,0x80,0x80,0xF8,0x05,0x09,0x09,0x06,0x00,0x00,0x50,0x00,0xF8,0x80,0x80,0xF0,
0x80,0x80,0xF8,0x03,0x0A,0x0A,0x06,0x01,0x00,0x80,0x40,0x00,0xE0,0x40,0x40,0x40,
0x40,0x40,0xE0,0x03,0x0A,0x0A,0x06,0x01,0x00,0x20,0x40,0x00,0xE0,0x40,0x40,0x40,
0x40,0x40,0xE0,0x03,0x0A,0x0A,0x06,0x01,0x00,0x40,0xA0,0x00,0xE0,0x40,0x40,0x40,
0x40,0x40,0xE0,0x03,0x09,0x09,0x06,0x01,0x00,0xA0,0x00,0xE0,0x40,0x40,0x40,0x40,
0x40,0xE0,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x48,0x48,0xE8,0x48,0x48,0x70,0x05,
0x0A,0x0A,0x06,0x00,0x00,0x68,0xB0,0x00,0x88,0x88,0xC8,0xA8,0x98,0x88,0x88,0x05,
0x0A,0x0A,0x06,0x00,0x00,0x40,0x20,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,
0x0A,0x0A,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,
0x0A,0x0A,0x06,0x00,0x00,0x20,0x50,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,
0x0A,0x0A,0x06,0x00,0x00,0x68,0xB0,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,
0x09,0x09,0x06,0x00,0x00,0x50,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x05,
0x05,0x06,0x00,0x01,0x88,0x50,0x20,0x50,0x88,0x05,0x09,0x09,0x06,0x00,0xFF,0x08,
0x70,0x98,0xA8,0xA8,0xA8,0xC8,0x70,0x80,0x05,0x0A,0x0A,0x06,0x00,0x00,0x40,0x20,
0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x0A,0x0A,0x06,0x00,0x00,0x10,0x20,
0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x0A,0x0A,0x06,0x00,0x00,0x20,0x50,
0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x09,0x09,0x06,0x00,0x00,0x50,0x00,
0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x0A,0x0A,0x06,0x00,0x00,0x10,0x20,0x00,
0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x04,0x07,0x07,0x06,0x01,0x00,0x80,0xE0,0x90,
0x90,0x90,0xE0,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x90,0xA0,0x90,0x88,
0xB0,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0x20,0x00,0x70,0x08,0x78,0x88,0x78,0x05,
0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x08,0x08,
0x06,0x00,0x00,0x20,0x50,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x08,0x08,0x06,0x00,
0x00,0x68,0xB0,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06,0x00,0x00,0x50,
0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x50,0x20,0x70,
0x08,0x78,0x88,0x78,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x28,0x70,0xA0,0x78,0x05,
0x07,0x07,0x06,0x00,0xFE,0x70,0x88,0x80,0x88,0x70,0x10,0x60,0x05,0x08,0x08,0x06,
0x00,0x00,0x40,0x20,0x00,0x70,0x88,0xF0,0x80,0x70,0x05,0x08,0x08,0x06,0x00,0x00,
0x10,0x20,0x00,0x70,0x88,0xF0,0x80,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x50,
0x00,0x70,0x88,0xF0,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x50,0x00,0x70,0x88,
0xF0,0x80,0x70,0x03,0x08,0x08,0x06,0x01,0x00,0x80,0x40,0x00,0xC0,0x40,0x40,0x40,
0xE0,0x03,0x08,0x08,0x06,0x01,0x00,0x20,0x40,0x00,0xC0,0x40,0x40,0x40,0xE0,0x03,
0x08,0x08,0x06,0x01,0x00,0x40,0xA0,0x00,0xC0,0x40,0x40,0x40,0xE0,0x03,0x07,0x07,
0x06,0x01,0x00,0xA0,0x00,0xC0,0x40,0x40,0x40,0xE0,0x05,0x09,0x09,0x06,0x00,0x00,
0x50,0x20,0x50,0x08,0x78,0x88,0x88,0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x68,
0xB0,0x00,0xB0,0xC8,0x88,0x88,0x88,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0x20,0x00,
0x70,0x88,0x88,0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,
0x88,0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x50,0x00,0x70,0x88,0x88,0x88,
0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x68,0xB0,0x00,0x70,0x88,0x88,0x88,0x70,0x05,
0x07,0x07,0x06,0x00,0x00,0x50,0x00,0x70,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,
0x00,0x01,0x20,0x00,0xF8,0x00,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0x78,0x98,0xA8,
0xC8,0xF0,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0x20,0x00,0x88,0x88,0x88,0x88,0x70,
0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x88,0x88,0x88,0x88,0x70,0x05,0x08,
0x08,0x06,0x00,0x00,0x20,0x50,0x00,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,
0x00,0x00,0x50,0x00,0x88,0x88,0x88,0x88,0x70,0x05,0x0A,0x0A,0x06,0x00,0xFE,0x10,
0x20,0x00,0x88,0x88,0x88,0x50,0x20,0x40,0x80,0x05,0x09,0x09,0x06,0x00,0xFE,0x80,
0x80,0xF0,0x88,0x88,0x88,0xF0,0x80,0x80,0x05,0x09,0x09,0x06,0x00,0xFE,0x50,0x00,
0x88,0x88,0x88,0x50,0x20,0x40,0x80};
#endif
|
2301_81045437/Marlin
|
Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h
|
C
|
agpl-3.0
| 22,998
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 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/>.
*
*/
#pragma once
#include <U8glib-HAL.h>
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
|
2301_81045437/Marlin
|
Marlin/src/lcd/dogm/fontdata/langdata.h
|
C
|
agpl-3.0
| 987
|
/**
* Generated automatically by buildroot/share/fonts/uxggenpages.sh
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#pragma once
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_an[] PROGMEM = {};
|
2301_81045437/Marlin
|
Marlin/src/lcd/dogm/fontdata/langdata_an.h
|
C
|
agpl-3.0
| 287
|
/**
* Generated automatically by buildroot/share/fonts/uxggenpages.sh
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_8_144_149[96] U8G_FONT_SECTION("fontpage_8_144_149") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x90,0x95,0x00,0x07,0xFF,0x00,
0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xF8,0x88,0x88,0x88,0x05,0x07,
0x07,0x06,0x00,0x00,0xF0,0x80,0x80,0xF0,0x88,0x88,0xF0,0x05,0x07,0x07,0x06,0x00,
0x00,0xF0,0x88,0x88,0xF0,0x88,0x88,0xF0,0x05,0x07,0x07,0x06,0x00,0x00,0xF8,0x80,
0x80,0x80,0x80,0x80,0x80,0x05,0x08,0x08,0x06,0x00,0xFF,0x30,0x50,0x50,0x50,0x50,
0x50,0xF8,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0xF8,0x80,0x80,0xF0,0x80,0x80,0xF8
};
const u8g_fntpgm_uint8_t fontpage_8_151_152[43] U8G_FONT_SECTION("fontpage_8_151_152") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x97,0x98,0x00,0x07,0x00,0x00,
0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x08,0x70,0x08,0x88,0x70,0x05,0x07,
0x07,0x06,0x00,0x00,0x88,0x88,0x98,0xA8,0xC8,0x88,0x88};
const u8g_fntpgm_uint8_t fontpage_8_154_164[160] U8G_FONT_SECTION("fontpage_8_154_164") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x9A,0xA4,0x00,0x07,0x00,0x00,
0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90,0xA0,0xC0,0xA0,0x90,0x88,0x05,0x07,
0x07,0x06,0x00,0x00,0x38,0x48,0x48,0x48,0x48,0x48,0x88,0x05,0x07,0x07,0x06,0x00,
0x00,0x88,0xD8,0xA8,0x88,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,
0x88,0xF8,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x88,
0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xF8,0x88,0x88,0x88,0x88,0x88,0x88,0x05,
0x07,0x07,0x06,0x00,0x00,0xF0,0x88,0x88,0xF0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,
0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xF8,
0x20,0x20,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0x88,
0x78,0x08,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x70,0xA8,0xA8,0xA8,0x70,0x20
};
const u8g_fntpgm_uint8_t fontpage_8_166_166[32] U8G_FONT_SECTION("fontpage_8_166_166") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xA6,0xA6,0x00,0x07,0xFE,0x00,
0x00,0x05,0x09,0x09,0x06,0x00,0xFE,0x90,0x90,0x90,0x90,0x90,0x90,0xF8,0x08,0x08
};
const u8g_fntpgm_uint8_t fontpage_8_175_195[260] U8G_FONT_SECTION("fontpage_8_175_195") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xAF,0xC3,0x00,0x08,0xFE,0x00,
0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x78,0x88,0x88,0x78,0x28,0x48,0x88,0x05,0x05,
0x05,0x06,0x00,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06,0x00,0x00,0x70,
0x80,0xF0,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xF0,0x88,0xF0,0x88,
0xF0,0x05,0x05,0x05,0x06,0x00,0x00,0xF8,0x80,0x80,0x80,0x80,0x05,0x06,0x06,0x06,
0x00,0xFF,0x30,0x50,0x50,0x50,0xF8,0x88,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,
0xF0,0x80,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xA8,0x70,0x20,0x70,0xA8,0x05,0x05,
0x05,0x06,0x00,0x00,0x70,0x88,0x30,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0x88,
0x98,0xA8,0xC8,0x88,0x05,0x08,0x08,0x06,0x00,0x00,0x88,0x70,0x00,0x88,0x98,0xA8,
0xC8,0x88,0x04,0x05,0x05,0x06,0x01,0x00,0x90,0xA0,0xC0,0xA0,0x90,0x05,0x05,0x05,
0x06,0x00,0x00,0x38,0x48,0x48,0x48,0x88,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0xD8,
0xA8,0x88,0x88,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0xF8,0x88,0x88,0x05,0x05,
0x05,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xF8,
0x88,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0xFE,0xF0,0x88,0x88,0x88,0xF0,0x80,
0x80,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x80,0x88,0x70,0x05,0x05,0x05,0x06,
0x00,0x00,0xF8,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0xFE,0x88,0x88,0x88,
0x88,0x78,0x08,0x70};
const u8g_fntpgm_uint8_t fontpage_8_197_200[63] U8G_FONT_SECTION("fontpage_8_197_200") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xC5,0xC8,0x00,0x05,0xFE,0x00,
0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x05,0x07,0x07,0x06,
0x00,0xFE,0x90,0x90,0x90,0x90,0xF8,0x08,0x08,0x05,0x05,0x05,0x06,0x00,0x00,0x88,
0x88,0x78,0x08,0x08,0x05,0x05,0x05,0x06,0x00,0x00,0xA8,0xA8,0xA8,0xA8,0xF8};
const u8g_fntpgm_uint8_t fontpage_8_202_202[28] U8G_FONT_SECTION("fontpage_8_202_202") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xCA,0xCA,0x00,0x05,0x00,0x00,
0x00,0x05,0x05,0x05,0x06,0x00,0x00,0xC0,0x40,0x70,0x48,0x70};
const u8g_fntpgm_uint8_t fontpage_8_206_207[39] U8G_FONT_SECTION("fontpage_8_206_207") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xCE,0xCF,0x00,0x05,0x00,0x00,
0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x90,0xA8,0xE8,0xA8,0x90,0x04,0x05,0x05,0x06,
0x01,0x00,0x70,0x90,0x70,0x50,0x90};
static const uxg_fontinfo_t g_fontinfo_bg[] PROGMEM = {
FONTDATA_ITEM(8, 144, 149, fontpage_8_144_149), // 'А' -- 'Е'
FONTDATA_ITEM(8, 151, 152, fontpage_8_151_152), // 'З' -- 'И'
FONTDATA_ITEM(8, 154, 164, fontpage_8_154_164), // 'К' -- 'Ф'
FONTDATA_ITEM(8, 166, 166, fontpage_8_166_166), // 'Ц' -- 'Ц'
FONTDATA_ITEM(8, 175, 195, fontpage_8_175_195), // 'Я' -- 'у'
FONTDATA_ITEM(8, 197, 200, fontpage_8_197_200), // 'х' -- 'ш'
FONTDATA_ITEM(8, 202, 202, fontpage_8_202_202), // 'ъ' -- 'ъ'
FONTDATA_ITEM(8, 206, 207, fontpage_8_206_207), // 'ю' -- 'я'
};
|
2301_81045437/Marlin
|
Marlin/src/lcd/dogm/fontdata/langdata_bg.h
|
C
|
agpl-3.0
| 5,310
|
/**
* Generated automatically by buildroot/share/fonts/uxggenpages.sh
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#pragma once
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_ca[] PROGMEM = {};
|
2301_81045437/Marlin
|
Marlin/src/lcd/dogm/fontdata/langdata_ca.h
|
C
|
agpl-3.0
| 287
|