Merge commit 'dabf3939209fd8ea7f6a6327d764c16743aa22aa' into look_at_201

2.0.x
Scott Lahteine 5 years ago
commit 1525c2530e

@ -379,7 +379,8 @@
* 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
* 15 : 100k thermistor calibration for JGAurora A5 hotend * 15 : 100k thermistor calibration for JGAurora A5 hotend
* 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327
* 20 : Pt100 with circuit in the Ultimainboard V2.x * 20 : Pt100 with circuit in the Ultimainboard V2.x with 5v excitation (AVR)
* 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v excitation (STM32 \ LPC176x....)
* 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x
* 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
* 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup

@ -819,7 +819,7 @@
// probing on a screwhead or hollow washer, probe near the edges. // probing on a screwhead or hollow washer, probe near the edges.
//#define CALIBRATION_MEASURE_AT_TOP_EDGES //#define CALIBRATION_MEASURE_AT_TOP_EDGES
// Define pin which is read during calibration // Define the pin to read during calibration
#ifndef CALIBRATION_PIN #ifndef CALIBRATION_PIN
#define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop
#define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin

@ -291,7 +291,7 @@ void quickstop_stepper() {
} }
void enable_e_steppers() { void enable_e_steppers() {
#define _ENA_E(N) enable_E##N(); #define _ENA_E(N) ENABLE_AXIS_E##N();
REPEAT(E_STEPPERS, _ENA_E) REPEAT(E_STEPPERS, _ENA_E)
} }
@ -299,28 +299,28 @@ void enable_all_steppers() {
#if ENABLED(AUTO_POWER_CONTROL) #if ENABLED(AUTO_POWER_CONTROL)
powerManager.power_on(); powerManager.power_on();
#endif #endif
enable_X(); ENABLE_AXIS_X();
enable_Y(); ENABLE_AXIS_Y();
enable_Z(); ENABLE_AXIS_Z();
enable_e_steppers(); enable_e_steppers();
} }
void disable_e_steppers() { void disable_e_steppers() {
#define _DIS_E(N) disable_E##N(); #define _DIS_E(N) DISABLE_AXIS_E##N();
REPEAT(E_STEPPERS, _DIS_E) REPEAT(E_STEPPERS, _DIS_E)
} }
void disable_e_stepper(const uint8_t e) { void disable_e_stepper(const uint8_t e) {
#define _CASE_DIS_E(N) case N: disable_E##N(); break; #define _CASE_DIS_E(N) case N: DISABLE_AXIS_E##N(); break;
switch (e) { switch (e) {
REPEAT(EXTRUDERS, _CASE_DIS_E) REPEAT(EXTRUDERS, _CASE_DIS_E)
} }
} }
void disable_all_steppers() { void disable_all_steppers() {
disable_X(); DISABLE_AXIS_X();
disable_Y(); DISABLE_AXIS_Y();
disable_Z(); DISABLE_AXIS_Z();
disable_e_steppers(); disable_e_steppers();
} }
@ -461,13 +461,13 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
if (!already_shutdown_steppers) { if (!already_shutdown_steppers) {
already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this
#if ENABLED(DISABLE_INACTIVE_X) #if ENABLED(DISABLE_INACTIVE_X)
disable_X(); DISABLE_AXIS_X();
#endif #endif
#if ENABLED(DISABLE_INACTIVE_Y) #if ENABLED(DISABLE_INACTIVE_Y)
disable_Y(); DISABLE_AXIS_Y();
#endif #endif
#if ENABLED(DISABLE_INACTIVE_Z) #if ENABLED(DISABLE_INACTIVE_Z)
disable_Z(); DISABLE_AXIS_Z();
#endif #endif
#if ENABLED(DISABLE_INACTIVE_E) #if ENABLED(DISABLE_INACTIVE_E)
disable_e_steppers(); disable_e_steppers();
@ -542,11 +542,11 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
#if ENABLED(SWITCHING_EXTRUDER) #if ENABLED(SWITCHING_EXTRUDER)
bool oldstatus; bool oldstatus;
switch (active_extruder) { switch (active_extruder) {
default: oldstatus = E0_ENABLE_READ(); enable_E0(); break; default: oldstatus = E0_ENABLE_READ(); ENABLE_AXIS_E0(); break;
#if E_STEPPERS > 1 #if E_STEPPERS > 1
case 2: case 3: oldstatus = E1_ENABLE_READ(); enable_E1(); break; case 2: case 3: oldstatus = E1_ENABLE_READ(); ENABLE_AXIS_E1(); break;
#if E_STEPPERS > 2 #if E_STEPPERS > 2
case 4: case 5: oldstatus = E2_ENABLE_READ(); enable_E2(); break; case 4: case 5: oldstatus = E2_ENABLE_READ(); ENABLE_AXIS_E2(); break;
#endif // E_STEPPERS > 2 #endif // E_STEPPERS > 2
#endif // E_STEPPERS > 1 #endif // E_STEPPERS > 1
} }
@ -554,7 +554,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
bool oldstatus; bool oldstatus;
switch (active_extruder) { switch (active_extruder) {
default: default:
#define _CASE_EN(N) case N: oldstatus = E##N##_ENABLE_READ(); enable_E##N(); break; #define _CASE_EN(N) case N: oldstatus = E##N##_ENABLE_READ(); ENABLE_AXIS_E##N(); break;
REPEAT(E_STEPPERS, _CASE_EN); REPEAT(E_STEPPERS, _CASE_EN);
} }
#endif #endif

@ -332,9 +332,10 @@
// //
// Espressif ESP32 WiFi // Espressif ESP32 WiFi
// //
#define BOARD_ESPRESSIF_ESP32 6000 #define BOARD_ESPRESSIF_ESP32 6000 // Generic ESP32
#define BOARD_MRR_ESPA 6001 #define BOARD_MRR_ESPA 6001
#define BOARD_MRR_ESPE 6002 #define BOARD_MRR_ESPE 6002
#define BOARD_E4D_BOX 6003 // E4d@BOX
// //
// Simulations // Simulations

@ -35,6 +35,17 @@
#define _XMAX_ 101 #define _XMAX_ 101
#define _YMAX_ 201 #define _YMAX_ 201
#define _ZMAX_ 301 #define _ZMAX_ 301
#define _XDIAG_ 102
#define _YDIAG_ 202
#define _ZDIAG_ 302
#define _E0DIAG_ 400
#define _E1DIAG_ 401
#define _E2DIAG_ 402
#define _E3DIAG_ 403
#define _E4DIAG_ 404
#define _E5DIAG_ 405
#define _E6DIAG_ 406
#define _E7DIAG_ 407
#define _FORCE_INLINE_ __attribute__((__always_inline__)) __inline__ #define _FORCE_INLINE_ __attribute__((__always_inline__)) __inline__
#define FORCE_INLINE __attribute__((always_inline)) inline #define FORCE_INLINE __attribute__((always_inline)) inline

@ -78,7 +78,7 @@ void Babystep::add_steps(const AxisEnum axis, const int16_t distance) {
#endif #endif
#if ENABLED(BABYSTEP_ALWAYS_AVAILABLE) #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE)
#define BSA_ENABLE(AXIS) do{ switch (AXIS) { case X_AXIS: enable_X(); break; case Y_AXIS: enable_Y(); break; case Z_AXIS: enable_Z(); break; default: break; } }while(0) #define BSA_ENABLE(AXIS) do{ switch (AXIS) { case X_AXIS: ENABLE_AXIS_X(); break; case Y_AXIS: ENABLE_AXIS_Y(); break; case Z_AXIS: ENABLE_AXIS_Z(); break; default: break; } }while(0)
#else #else
#define BSA_ENABLE(AXIS) NOOP #define BSA_ENABLE(AXIS) NOOP
#endif #endif

@ -242,7 +242,7 @@ public:
uint8_t protocol() { return (meta >> 4) & 0xF; } uint8_t protocol() { return (meta >> 4) & 0xF; }
uint8_t type() { return meta & 0xF; } uint8_t type() { return meta & 0xF; }
void reset() { token = 0; sync = 0; meta = 0; size = 0; checksum = 0; } void reset() { token = 0; sync = 0; meta = 0; size = 0; checksum = 0; }
uint8_t data[1]; uint8_t data[2];
}; };
union Footer { union Footer {

@ -564,7 +564,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
#endif #endif
// Re-enable the heaters if they timed out // Re-enable the heaters if they timed out
HOTEND_LOOP() thermalManager.reset_heater_idle_timer(e); HOTEND_LOOP() thermalManager.reset_hotend_idle_timer(e);
// Wait for the heaters to reach the target temperatures // Wait for the heaters to reach the target temperatures
ensure_safe_temperature(); ensure_safe_temperature();
@ -633,7 +633,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
bool nozzle_timed_out = false; bool nozzle_timed_out = false;
HOTEND_LOOP() { HOTEND_LOOP() {
nozzle_timed_out |= thermalManager.hotend_idle[e].timed_out; nozzle_timed_out |= thermalManager.hotend_idle[e].timed_out;
thermalManager.reset_heater_idle_timer(e); thermalManager.reset_hotend_idle_timer(e);
} }
if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) // Load the new filament if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) // Load the new filament

@ -48,10 +48,10 @@ class ProbeTempComp {
public: public:
static constexpr temp_calib_t cali_info_init[TSI_COUNT] = { static constexpr temp_calib_t cali_info_init[TSI_COUNT] = {
{ 30, 10, 5, 30 + 10 * 5 }, // Probe { 10, 5, 30, 30 + 10 * 5 }, // Probe
{ 60, 10, 5, 60 + 10 * 5 }, // Bed { 10, 5, 60, 60 + 10 * 5 }, // Bed
#if ENABLED(USE_TEMP_EXT_COMPENSATION) #if ENABLED(USE_TEMP_EXT_COMPENSATION)
{ 180, 5, 20, 180 + 5 * 20 } // Extruder { 20, 5, 180, 180 + 5 * 20 } // Extruder
#endif #endif
}; };
static const temp_calib_t cali_info[TSI_COUNT]; static const temp_calib_t cali_info[TSI_COUNT];

@ -448,7 +448,7 @@ void MMU2::tool_change(uint8_t index) {
if (index != extruder) { if (index != extruder) {
disable_E0(); DISABLE_AXIS_E0();
ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
command(MMU_CMD_T0 + index); command(MMU_CMD_T0 + index);
@ -459,7 +459,7 @@ void MMU2::tool_change(uint8_t index) {
extruder = index; //filament change is finished extruder = index; //filament change is finished
active_extruder = 0; active_extruder = 0;
enable_E0(); ENABLE_AXIS_E0();
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, int(extruder)); SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, int(extruder));
@ -497,13 +497,13 @@ void MMU2::tool_change(const char* special) {
case 'x': { case 'x': {
planner.synchronize(); planner.synchronize();
uint8_t index = mmu2_choose_filament(); uint8_t index = mmu2_choose_filament();
disable_E0(); DISABLE_AXIS_E0();
command(MMU_CMD_T0 + index); command(MMU_CMD_T0 + index);
manage_response(true, true); manage_response(true, true);
command(MMU_CMD_C0); command(MMU_CMD_C0);
mmu_loop(); mmu_loop();
enable_E0(); ENABLE_AXIS_E0();
extruder = index; extruder = index;
active_extruder = 0; active_extruder = 0;
} break; } break;
@ -697,7 +697,7 @@ void MMU2::filament_runout() {
LCD_MESSAGEPGM(MSG_MMU2_EJECTING_FILAMENT); LCD_MESSAGEPGM(MSG_MMU2_EJECTING_FILAMENT);
enable_E0(); ENABLE_AXIS_E0();
current_position.e -= MMU2_FILAMENTCHANGE_EJECT_FEED; current_position.e -= MMU2_FILAMENTCHANGE_EJECT_FEED;
line_to_current_position(2500 / 60); line_to_current_position(2500 / 60);
planner.synchronize(); planner.synchronize();
@ -731,7 +731,7 @@ void MMU2::filament_runout() {
BUZZ(200, 404); BUZZ(200, 404);
disable_E0(); DISABLE_AXIS_E0();
return true; return true;
} }
@ -776,7 +776,7 @@ void MMU2::filament_runout() {
void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) { void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) {
planner.synchronize(); planner.synchronize();
enable_E0(); ENABLE_AXIS_E0();
const E_Step* step = sequence; const E_Step* step = sequence;
@ -794,7 +794,7 @@ void MMU2::filament_runout() {
step++; step++;
} }
disable_E0(); DISABLE_AXIS_E0();
} }
#endif // HAS_LCD_MENU && MMU2_MENUS #endif // HAS_LCD_MENU && MMU2_MENUS

@ -439,7 +439,6 @@ void GcodeSuite::G33() {
_opposite_results = (_4p_calibration && !towers_set) || probe_points >= 3, _opposite_results = (_4p_calibration && !towers_set) || probe_points >= 3,
_endstop_results = probe_points != 1 && probe_points != -1 && probe_points != 0, _endstop_results = probe_points != 1 && probe_points != -1 && probe_points != 0,
_angle_results = probe_points >= 3 && towers_set; _angle_results = probe_points >= 3 && towers_set;
static const char save_message[] PROGMEM = "Save with M500 and/or copy to Configuration.h";
int8_t iterations = 0; int8_t iterations = 0;
float test_precision, float test_precision,
zero_std_dev = (verbose_level ? 999.0f : 0.0f), // 0.0 in dry-run mode : forced end zero_std_dev = (verbose_level ? 999.0f : 0.0f), // 0.0 in dry-run mode : forced end
@ -625,8 +624,7 @@ void GcodeSuite::G33() {
sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev_min)); sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev_min));
ui.set_status(mess); ui.set_status(mess);
print_calibration_settings(_endstop_results, _angle_results); print_calibration_settings(_endstop_results, _angle_results);
serialprintPGM(save_message); SERIAL_ECHOLNPGM("Save with M500 and/or copy to Configuration.h");
SERIAL_EOL();
} }
else { // !end iterations else { // !end iterations
char mess[15]; char mess[15];

@ -256,7 +256,7 @@ void GcodeSuite::G76() {
// Initialize temperatures // Initialize temperatures
uint16_t target_bed = temp_comp.probe_calib_bed_temp, uint16_t target_bed = temp_comp.probe_calib_bed_temp,
target_probe = temp_comp.cali_info_init[TSI_BED].start_temp; target_probe = temp_comp.cali_info_init[TSI_PROBE].start_temp;
thermalManager.setTargetBed(target_bed); thermalManager.setTargetBed(target_bed);
SERIAL_ECHOLNPGM("Waiting for bed and probe temperature."); SERIAL_ECHOLNPGM("Waiting for bed and probe temperature.");
while (fabs(thermalManager.degBed() - float(target_bed)) > 0.1f while (fabs(thermalManager.degBed() - float(target_bed)) > 0.1f
@ -332,13 +332,13 @@ void GcodeSuite::G76() {
else else
SERIAL_ECHOLNPAIR_F("Measured: ", measured_z); SERIAL_ECHOLNPAIR_F("Measured: ", measured_z);
if (target_probe == temp_comp.cali_info_init[TSI_BED].start_temp) if (target_probe == temp_comp.cali_info_init[TSI_PROBE].start_temp)
temp_comp.prepare_new_calibration(measured_z); temp_comp.prepare_new_calibration(measured_z);
else else
temp_comp.push_back_new_measurement(TSI_PROBE, measured_z); temp_comp.push_back_new_measurement(TSI_PROBE, measured_z);
target_probe += temp_comp.cali_info_init[TSI_BED].temp_res; target_probe += temp_comp.cali_info_init[TSI_PROBE].temp_res;
if (target_probe > temp_comp.cali_info_init[TSI_BED].end_temp) break; if (target_probe > temp_comp.cali_info_init[TSI_PROBE].end_temp) break;
} }
SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index()); SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index());

@ -53,6 +53,9 @@
* *
* This function requires the machine to be homed before invocation. * This function requires the machine to be homed before invocation.
*/ */
extern const char SP_Y_STR[];
void GcodeSuite::M48() { void GcodeSuite::M48() {
if (axis_unhomed_error()) return; if (axis_unhomed_error()) return;

@ -34,9 +34,9 @@
*/ */
void GcodeSuite::M17() { void GcodeSuite::M17() {
if (parser.seen("XYZE")) { if (parser.seen("XYZE")) {
if (parser.seen('X')) enable_X(); if (parser.seen('X')) ENABLE_AXIS_X();
if (parser.seen('Y')) enable_Y(); if (parser.seen('Y')) ENABLE_AXIS_Y();
if (parser.seen('Z')) enable_Z(); if (parser.seen('Z')) ENABLE_AXIS_Z();
#if HAS_E_STEPPER_ENABLE #if HAS_E_STEPPER_ENABLE
if (parser.seen('E')) enable_e_steppers(); if (parser.seen('E')) enable_e_steppers();
#endif #endif
@ -57,9 +57,9 @@ void GcodeSuite::M18_M84() {
else { else {
if (parser.seen("XYZE")) { if (parser.seen("XYZE")) {
planner.synchronize(); planner.synchronize();
if (parser.seen('X')) disable_X(); if (parser.seen('X')) DISABLE_AXIS_X();
if (parser.seen('Y')) disable_Y(); if (parser.seen('Y')) DISABLE_AXIS_Y();
if (parser.seen('Z')) disable_Z(); if (parser.seen('Z')) DISABLE_AXIS_Z();
#if HAS_E_STEPPER_ENABLE #if HAS_E_STEPPER_ENABLE
if (parser.seen('E')) disable_e_steppers(); if (parser.seen('E')) disable_e_steppers();
#endif #endif

@ -45,7 +45,7 @@ void GcodeSuite::G60() {
} }
stored_position[slot] = current_position; stored_position[slot] = current_position;
SBI(saved_slots, slot); SBI(saved_slots[slot >> 3], slot & 0x07);
#if ENABLED(SAVED_POSITIONS_DEBUG) #if ENABLED(SAVED_POSITIONS_DEBUG)
const xyze_pos_t &pos = stored_position[slot]; const xyze_pos_t &pos = stored_position[slot];

@ -25,7 +25,7 @@
#if SAVED_POSITIONS #if SAVED_POSITIONS
#include "../../../core/language.h" #include "../../../core/language.h"
#include "../../module/planner.h" #include "../../../module/planner.h"
#include "../../gcode.h" #include "../../gcode.h"
#include "../../../module/motion.h" #include "../../../module/motion.h"
@ -48,7 +48,7 @@ void GcodeSuite::G61(void) {
#endif #endif
// No saved position? No axes being restored? // No saved position? No axes being restored?
if (!TEST(saved_slots, slot) || !parser.seen("XYZ")) return; if (!TEST(saved_slots[slot >> 3], slot & 0x07) || !parser.seen("XYZ")) return;
// Apply any given feedrate over 0.0 // Apply any given feedrate over 0.0
const float fr = parser.linearval('F'); const float fr = parser.linearval('F');

@ -20,12 +20,14 @@
* *
*/ */
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfigPre.h"
#if HAS_RESUME_CONTINUE #if HAS_RESUME_CONTINUE
#include "../gcode.h" #include "../gcode.h"
#include "../../module/stepper.h" #include "../../module/planner.h"
#include "../../inc/MarlinConfig.h"
#if HAS_LCD_MENU #if HAS_LCD_MENU
#include "../../lcd/ultralcd.h" #include "../../lcd/ultralcd.h"
@ -35,8 +37,6 @@
#include "../../lcd/extensible_ui/ui_api.h" #include "../../lcd/extensible_ui/ui_api.h"
#endif #endif
#include "../../sd/cardreader.h"
#if HAS_LEDS_OFF_FLAG #if HAS_LEDS_OFF_FLAG
#include "../../feature/leds/printer_event_leds.h" #include "../../feature/leds/printer_event_leds.h"
#endif #endif

@ -20,6 +20,12 @@
* *
*/ */
/**
* gcode/temperature/M104_M109.cpp
*
* Hotend target temperature control
*/
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if EXTRUDERS #if EXTRUDERS
@ -73,14 +79,11 @@ void GcodeSuite::M104() {
#if ENABLED(PRINTJOB_TIMER_AUTOSTART) #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
/** /**
* Stop the timer at the end of print. Start is managed by 'heat and wait' M109. * Stop the timer at the end of print. Start is managed by 'heat and wait' M109.
* We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot * Hotends use EXTRUDE_MINTEMP / 2 to allow nozzles to be put into hot standby
* standby mode, for instance in a dual extruder setup, without affecting * mode, for instance in a dual extruder setup, without affecting the running
* the running print timer. * print timer.
*/ */
if (temp <= (EXTRUDE_MINTEMP) / 2) { thermalManager.check_timer_autostart(false, true);
print_job_timer.stop();
ui.reset_status();
}
#endif #endif
} }
@ -90,8 +93,10 @@ void GcodeSuite::M104() {
} }
/** /**
* M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating. * M109: Sxxx Wait for hotend(s) to reach temperature. Waits only when heating.
* Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling. * Rxxx Wait for hotend(s) to reach temperature. Waits when heating and cooling.
*
* With PRINTJOB_TIMER_AUTOSTART also start the job timer on heating and stop it if turned off.
*/ */
void GcodeSuite::M109() { void GcodeSuite::M109() {
@ -125,12 +130,7 @@ void GcodeSuite::M109() {
* standby mode, (e.g., in a dual extruder setup) without affecting * standby mode, (e.g., in a dual extruder setup) without affecting
* the running print timer. * the running print timer.
*/ */
if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) { thermalManager.check_timer_autostart(true, true);
print_job_timer.stop();
ui.reset_status();
}
else
startOrResumeJob();
#endif #endif
#if HAS_DISPLAY #if HAS_DISPLAY

@ -20,6 +20,12 @@
* *
*/ */
/**
* gcode/temperature/M140_M190.cpp
*
* Bed target temperature control
*/
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if HAS_HEATED_BED #if HAS_HEATED_BED
@ -50,6 +56,8 @@ void GcodeSuite::M140() {
/** /**
* M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating * M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating
* Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling * Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
*
* With PRINTJOB_TIMER_AUTOSTART also start the job timer on heating.
*/ */
void GcodeSuite::M190() { void GcodeSuite::M190() {
if (DEBUGGING(DRYRUN)) return; if (DEBUGGING(DRYRUN)) return;
@ -58,8 +66,7 @@ void GcodeSuite::M190() {
if (no_wait_for_cooling || parser.seenval('R')) { if (no_wait_for_cooling || parser.seenval('R')) {
thermalManager.setTargetBed(parser.value_celsius()); thermalManager.setTargetBed(parser.value_celsius());
#if ENABLED(PRINTJOB_TIMER_AUTOSTART) #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
if (parser.value_celsius() > BED_MINTEMP) thermalManager.check_timer_autostart(true, false);
startOrResumeJob();
#endif #endif
} }
else return; else return;

@ -20,6 +20,12 @@
* *
*/ */
/**
* gcode/temperature/M141_M191.cpp
*
* Chamber target temperature control
*/
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if HAS_HEATED_CHAMBER #if HAS_HEATED_CHAMBER
@ -59,8 +65,7 @@ void GcodeSuite::M191() {
if (no_wait_for_cooling || parser.seenval('R')) { if (no_wait_for_cooling || parser.seenval('R')) {
thermalManager.setTargetChamber(parser.value_celsius()); thermalManager.setTargetChamber(parser.value_celsius());
#if ENABLED(PRINTJOB_TIMER_AUTOSTART) #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
if (parser.value_celsius() > CHAMBER_MINTEMP) thermalManager.check_timer_autostart(true, false);
startOrResumeJob();
#endif #endif
} }
else return; else return;

@ -679,48 +679,110 @@
#if X_HOME_DIR > 0 #if X_HOME_DIR > 0
#if X2_USE_ENDSTOP == _XMIN_ #if X2_USE_ENDSTOP == _XMIN_
#define X2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING #define X2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
#define X2_MAX_PIN X_MIN_PIN
#elif X2_USE_ENDSTOP == _XMAX_ #elif X2_USE_ENDSTOP == _XMAX_
#define X2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING #define X2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
#define X2_MAX_PIN X_MAX_PIN
#elif X2_USE_ENDSTOP == _YMIN_ #elif X2_USE_ENDSTOP == _YMIN_
#define X2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING #define X2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
#define X2_MAX_PIN Y_MIN_PIN
#elif X2_USE_ENDSTOP == _YMAX_ #elif X2_USE_ENDSTOP == _YMAX_
#define X2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING #define X2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
#define X2_MAX_PIN Y_MAX_PIN
#elif X2_USE_ENDSTOP == _ZMIN_ #elif X2_USE_ENDSTOP == _ZMIN_
#define X2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define X2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#define X2_MAX_PIN Z_MIN_PIN
#elif X2_USE_ENDSTOP == _ZMAX_ #elif X2_USE_ENDSTOP == _ZMAX_
#define X2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define X2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#define X2_MAX_PIN Z_MAX_PIN
#else #else
#define X2_MAX_ENDSTOP_INVERTING false #define X2_MAX_ENDSTOP_INVERTING false
#endif #endif
#ifndef X2_MAX_PIN
#if X2_USE_ENDSTOP == _XMIN_
#define X2_MAX_PIN X_MIN_PIN
#elif X2_USE_ENDSTOP == _XMAX_
#define X2_MAX_PIN X_MAX_PIN
#elif X2_USE_ENDSTOP == _YMIN_
#define X2_MAX_PIN Y_MIN_PIN
#elif X2_USE_ENDSTOP == _YMAX_
#define X2_MAX_PIN Y_MAX_PIN
#elif X2_USE_ENDSTOP == _ZMIN_
#define X2_MAX_PIN Z_MIN_PIN
#elif X2_USE_ENDSTOP == _ZMAX_
#define X2_MAX_PIN Z_MAX_PIN
#elif X2_USE_ENDSTOP == _XDIAG_
#define X2_MAX_PIN X_DIAG_PIN
#elif X2_USE_ENDSTOP == _YDIAG_
#define X2_MAX_PIN Y_DIAG_PIN
#elif X2_USE_ENDSTOP == _ZDIAG_
#define X2_MAX_PIN Z_DIAG_PIN
#elif X2_USE_ENDSTOP == _E0DIAG_
#define X2_MAX_PIN E0_DIAG_PIN
#elif X2_USE_ENDSTOP == _E1DIAG_
#define X2_MAX_PIN E1_DIAG_PIN
#elif X2_USE_ENDSTOP == _E2DIAG_
#define X2_MAX_PIN E2_DIAG_PIN
#elif X2_USE_ENDSTOP == _E3DIAG_
#define X2_MAX_PIN E3_DIAG_PIN
#elif X2_USE_ENDSTOP == _E4DIAG_
#define X2_MAX_PIN E4_DIAG_PIN
#elif X2_USE_ENDSTOP == _E5DIAG_
#define X2_MAX_PIN E5_DIAG_PIN
#elif X2_USE_ENDSTOP == _E6DIAG_
#define X2_MAX_PIN E6_DIAG_PIN
#elif X2_USE_ENDSTOP == _E7DIAG_
#define X2_MAX_PIN E7_DIAG_PIN
#endif
#endif
#define X2_MIN_ENDSTOP_INVERTING false #define X2_MIN_ENDSTOP_INVERTING false
#else #else
#if X2_USE_ENDSTOP == _XMIN_ #if X2_USE_ENDSTOP == _XMIN_
#define X2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING #define X2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
#define X2_MIN_PIN X_MIN_PIN
#elif X2_USE_ENDSTOP == _XMAX_ #elif X2_USE_ENDSTOP == _XMAX_
#define X2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING #define X2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
#define X2_MIN_PIN X_MAX_PIN
#elif X2_USE_ENDSTOP == _YMIN_ #elif X2_USE_ENDSTOP == _YMIN_
#define X2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING #define X2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
#define X2_MIN_PIN Y_MIN_PIN
#elif X2_USE_ENDSTOP == _YMAX_ #elif X2_USE_ENDSTOP == _YMAX_
#define X2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING #define X2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
#define X2_MIN_PIN Y_MAX_PIN
#elif X2_USE_ENDSTOP == _ZMIN_ #elif X2_USE_ENDSTOP == _ZMIN_
#define X2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define X2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#define X2_MIN_PIN Z_MIN_PIN
#elif X2_USE_ENDSTOP == _ZMAX_ #elif X2_USE_ENDSTOP == _ZMAX_
#define X2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define X2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#define X2_MIN_PIN Z_MAX_PIN
#else #else
#define X2_MIN_ENDSTOP_INVERTING false #define X2_MIN_ENDSTOP_INVERTING false
#endif #endif
#ifndef X2_MIN_PIN
#if X2_USE_ENDSTOP == _XMIN_
#define X2_MIN_PIN X_MIN_PIN
#elif X2_USE_ENDSTOP == _XMAX_
#define X2_MIN_PIN X_MAX_PIN
#elif X2_USE_ENDSTOP == _YMIN_
#define X2_MIN_PIN Y_MIN_PIN
#elif X2_USE_ENDSTOP == _YMAX_
#define X2_MIN_PIN Y_MAX_PIN
#elif X2_USE_ENDSTOP == _ZMIN_
#define X2_MIN_PIN Z_MIN_PIN
#elif X2_USE_ENDSTOP == _ZMAX_
#define X2_MIN_PIN Z_MAX_PIN
#elif X2_USE_ENDSTOP == _XDIAG_
#define X2_MIN_PIN X_DIAG_PIN
#elif X2_USE_ENDSTOP == _YDIAG_
#define X2_MIN_PIN Y_DIAG_PIN
#elif X2_USE_ENDSTOP == _ZDIAG_
#define X2_MIN_PIN Z_DIAG_PIN
#elif X2_USE_ENDSTOP == _E0DIAG_
#define X2_MIN_PIN E0_DIAG_PIN
#elif X2_USE_ENDSTOP == _E1DIAG_
#define X2_MIN_PIN E1_DIAG_PIN
#elif X2_USE_ENDSTOP == _E2DIAG_
#define X2_MIN_PIN E2_DIAG_PIN
#elif X2_USE_ENDSTOP == _E3DIAG_
#define X2_MIN_PIN E3_DIAG_PIN
#elif X2_USE_ENDSTOP == _E4DIAG_
#define X2_MIN_PIN E4_DIAG_PIN
#elif X2_USE_ENDSTOP == _E5DIAG_
#define X2_MIN_PIN E5_DIAG_PIN
#elif X2_USE_ENDSTOP == _E6DIAG_
#define X2_MIN_PIN E6_DIAG_PIN
#elif X2_USE_ENDSTOP == _E7DIAG_
#define X2_MIN_PIN E7_DIAG_PIN
#endif
#endif
#define X2_MAX_ENDSTOP_INVERTING false #define X2_MAX_ENDSTOP_INVERTING false
#endif #endif
#endif #endif
@ -732,48 +794,110 @@
#if Y_HOME_DIR > 0 #if Y_HOME_DIR > 0
#if Y2_USE_ENDSTOP == _XMIN_ #if Y2_USE_ENDSTOP == _XMIN_
#define Y2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING #define Y2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
#define Y2_MAX_PIN X_MIN_PIN
#elif Y2_USE_ENDSTOP == _XMAX_ #elif Y2_USE_ENDSTOP == _XMAX_
#define Y2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING #define Y2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
#define Y2_MAX_PIN X_MAX_PIN
#elif Y2_USE_ENDSTOP == _YMIN_ #elif Y2_USE_ENDSTOP == _YMIN_
#define Y2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING #define Y2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
#define Y2_MAX_PIN Y_MIN_PIN
#elif Y2_USE_ENDSTOP == _YMAX_ #elif Y2_USE_ENDSTOP == _YMAX_
#define Y2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING #define Y2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
#define Y2_MAX_PIN Y_MAX_PIN
#elif Y2_USE_ENDSTOP == _ZMIN_ #elif Y2_USE_ENDSTOP == _ZMIN_
#define Y2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Y2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#define Y2_MAX_PIN Z_MIN_PIN
#elif Y2_USE_ENDSTOP == _ZMAX_ #elif Y2_USE_ENDSTOP == _ZMAX_
#define Y2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Y2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#define Y2_MAX_PIN Z_MAX_PIN
#else #else
#define Y2_MAX_ENDSTOP_INVERTING false #define Y2_MAX_ENDSTOP_INVERTING false
#endif #endif
#ifndef Y2_MAX_PIN
#if Y2_USE_ENDSTOP == _XMIN_
#define Y2_MAX_PIN X_MIN_PIN
#elif Y2_USE_ENDSTOP == _XMAX_
#define Y2_MAX_PIN X_MAX_PIN
#elif Y2_USE_ENDSTOP == _YMIN_
#define Y2_MAX_PIN Y_MIN_PIN
#elif Y2_USE_ENDSTOP == _YMAX_
#define Y2_MAX_PIN Y_MAX_PIN
#elif Y2_USE_ENDSTOP == _ZMIN_
#define Y2_MAX_PIN Z_MIN_PIN
#elif Y2_USE_ENDSTOP == _ZMAX_
#define Y2_MAX_PIN Z_MAX_PIN
#elif Y2_USE_ENDSTOP == _XDIAG_
#define Y2_MAX_PIN X_DIAG_PIN
#elif Y2_USE_ENDSTOP == _YDIAG_
#define Y2_MAX_PIN Y_DIAG_PIN
#elif Y2_USE_ENDSTOP == _ZDIAG_
#define Y2_MAX_PIN Z_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E0DIAG_
#define Y2_MAX_PIN E0_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E1DIAG_
#define Y2_MAX_PIN E1_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E2DIAG_
#define Y2_MAX_PIN E2_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E3DIAG_
#define Y2_MAX_PIN E3_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E4DIAG_
#define Y2_MAX_PIN E4_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E5DIAG_
#define Y2_MAX_PIN E5_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E6DIAG_
#define Y2_MAX_PIN E6_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E7DIAG_
#define Y2_MAX_PIN E7_DIAG_PIN
#endif
#endif
#define Y2_MIN_ENDSTOP_INVERTING false #define Y2_MIN_ENDSTOP_INVERTING false
#else #else
#if Y2_USE_ENDSTOP == _XMIN_ #if Y2_USE_ENDSTOP == _XMIN_
#define Y2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING #define Y2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
#define Y2_MIN_PIN X_MIN_PIN
#elif Y2_USE_ENDSTOP == _XMAX_ #elif Y2_USE_ENDSTOP == _XMAX_
#define Y2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING #define Y2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
#define Y2_MIN_PIN X_MAX_PIN
#elif Y2_USE_ENDSTOP == _YMIN_ #elif Y2_USE_ENDSTOP == _YMIN_
#define Y2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING #define Y2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
#define Y2_MIN_PIN Y_MIN_PIN
#elif Y2_USE_ENDSTOP == _YMAX_ #elif Y2_USE_ENDSTOP == _YMAX_
#define Y2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING #define Y2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
#define Y2_MIN_PIN Y_MAX_PIN
#elif Y2_USE_ENDSTOP == _ZMIN_ #elif Y2_USE_ENDSTOP == _ZMIN_
#define Y2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Y2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#define Y2_MIN_PIN Z_MIN_PIN
#elif Y2_USE_ENDSTOP == _ZMAX_ #elif Y2_USE_ENDSTOP == _ZMAX_
#define Y2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Y2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#define Y2_MIN_PIN Z_MAX_PIN
#else #else
#define Y2_MIN_ENDSTOP_INVERTING false #define Y2_MIN_ENDSTOP_INVERTING false
#endif #endif
#ifndef Y2_MIN_PIN
#if Y2_USE_ENDSTOP == _XMIN_
#define Y2_MIN_PIN X_MIN_PIN
#elif Y2_USE_ENDSTOP == _XMAX_
#define Y2_MIN_PIN X_MAX_PIN
#elif Y2_USE_ENDSTOP == _YMIN_
#define Y2_MIN_PIN Y_MIN_PIN
#elif Y2_USE_ENDSTOP == _YMAX_
#define Y2_MIN_PIN Y_MAX_PIN
#elif Y2_USE_ENDSTOP == _ZMIN_
#define Y2_MIN_PIN Z_MIN_PIN
#elif Y2_USE_ENDSTOP == _ZMAX_
#define Y2_MIN_PIN Z_MAX_PIN
#elif Y2_USE_ENDSTOP == _XDIAG_
#define Y2_MIN_PIN X_DIAG_PIN
#elif Y2_USE_ENDSTOP == _YDIAG_
#define Y2_MIN_PIN Y_DIAG_PIN
#elif Y2_USE_ENDSTOP == _ZDIAG_
#define Y2_MIN_PIN Z_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E0DIAG_
#define Y2_MIN_PIN E0_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E1DIAG_
#define Y2_MIN_PIN E1_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E2DIAG_
#define Y2_MIN_PIN E2_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E3DIAG_
#define Y2_MIN_PIN E3_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E4DIAG_
#define Y2_MIN_PIN E4_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E5DIAG_
#define Y2_MIN_PIN E5_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E6DIAG_
#define Y2_MIN_PIN E6_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E7DIAG_
#define Y2_MIN_PIN E7_DIAG_PIN
#endif
#endif
#define Y2_MAX_ENDSTOP_INVERTING false #define Y2_MAX_ENDSTOP_INVERTING false
#endif #endif
#endif #endif
@ -786,48 +910,110 @@
#if Z_HOME_DIR > 0 #if Z_HOME_DIR > 0
#if Z2_USE_ENDSTOP == _XMIN_ #if Z2_USE_ENDSTOP == _XMIN_
#define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING #define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
#define Z2_MAX_PIN X_MIN_PIN
#elif Z2_USE_ENDSTOP == _XMAX_ #elif Z2_USE_ENDSTOP == _XMAX_
#define Z2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING #define Z2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
#define Z2_MAX_PIN X_MAX_PIN
#elif Z2_USE_ENDSTOP == _YMIN_ #elif Z2_USE_ENDSTOP == _YMIN_
#define Z2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING #define Z2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
#define Z2_MAX_PIN Y_MIN_PIN
#elif Z2_USE_ENDSTOP == _YMAX_ #elif Z2_USE_ENDSTOP == _YMAX_
#define Z2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING #define Z2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
#define Z2_MAX_PIN Y_MAX_PIN
#elif Z2_USE_ENDSTOP == _ZMIN_ #elif Z2_USE_ENDSTOP == _ZMIN_
#define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#define Z2_MAX_PIN Z_MIN_PIN
#elif Z2_USE_ENDSTOP == _ZMAX_ #elif Z2_USE_ENDSTOP == _ZMAX_
#define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#define Z2_MAX_PIN Z_MAX_PIN
#else #else
#define Z2_MAX_ENDSTOP_INVERTING false #define Z2_MAX_ENDSTOP_INVERTING false
#endif #endif
#ifndef Z2_MAX_PIN
#if Z2_USE_ENDSTOP == _XMIN_
#define Z2_MAX_PIN X_MIN_PIN
#elif Z2_USE_ENDSTOP == _XMAX_
#define Z2_MAX_PIN X_MAX_PIN
#elif Z2_USE_ENDSTOP == _YMIN_
#define Z2_MAX_PIN Y_MIN_PIN
#elif Z2_USE_ENDSTOP == _YMAX_
#define Z2_MAX_PIN Y_MAX_PIN
#elif Z2_USE_ENDSTOP == _ZMIN_
#define Z2_MAX_PIN Z_MIN_PIN
#elif Z2_USE_ENDSTOP == _ZMAX_
#define Z2_MAX_PIN Z_MAX_PIN
#elif Z2_USE_ENDSTOP == _XDIAG_
#define Z2_MAX_PIN X_DIAG_PIN
#elif Z2_USE_ENDSTOP == _YDIAG_
#define Z2_MAX_PIN Y_DIAG_PIN
#elif Z2_USE_ENDSTOP == _ZDIAG_
#define Z2_MAX_PIN Z_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E0DIAG_
#define Z2_MAX_PIN E0_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E1DIAG_
#define Z2_MAX_PIN E1_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E2DIAG_
#define Z2_MAX_PIN E2_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E3DIAG_
#define Z2_MAX_PIN E3_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E4DIAG_
#define Z2_MAX_PIN E4_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E5DIAG_
#define Z2_MAX_PIN E5_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E6DIAG_
#define Z2_MAX_PIN E6_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E7DIAG_
#define Z2_MAX_PIN E7_DIAG_PIN
#endif
#endif
#define Z2_MIN_ENDSTOP_INVERTING false #define Z2_MIN_ENDSTOP_INVERTING false
#else #else
#if Z2_USE_ENDSTOP == _XMIN_ #if Z2_USE_ENDSTOP == _XMIN_
#define Z2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING #define Z2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
#define Z2_MIN_PIN X_MIN_PIN
#elif Z2_USE_ENDSTOP == _XMAX_ #elif Z2_USE_ENDSTOP == _XMAX_
#define Z2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING #define Z2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
#define Z2_MIN_PIN X_MAX_PIN
#elif Z2_USE_ENDSTOP == _YMIN_ #elif Z2_USE_ENDSTOP == _YMIN_
#define Z2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING #define Z2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
#define Z2_MIN_PIN Y_MIN_PIN
#elif Z2_USE_ENDSTOP == _YMAX_ #elif Z2_USE_ENDSTOP == _YMAX_
#define Z2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING #define Z2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
#define Z2_MIN_PIN Y_MAX_PIN
#elif Z2_USE_ENDSTOP == _ZMIN_ #elif Z2_USE_ENDSTOP == _ZMIN_
#define Z2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Z2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#define Z2_MIN_PIN Z_MIN_PIN
#elif Z2_USE_ENDSTOP == _ZMAX_ #elif Z2_USE_ENDSTOP == _ZMAX_
#define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#define Z2_MIN_PIN Z_MAX_PIN
#else #else
#define Z2_MIN_ENDSTOP_INVERTING false #define Z2_MIN_ENDSTOP_INVERTING false
#endif #endif
#ifndef Z2_MIN_PIN
#if Z2_USE_ENDSTOP == _XMIN_
#define Z2_MIN_PIN X_MIN_PIN
#elif Z2_USE_ENDSTOP == _XMAX_
#define Z2_MIN_PIN X_MAX_PIN
#elif Z2_USE_ENDSTOP == _YMIN_
#define Z2_MIN_PIN Y_MIN_PIN
#elif Z2_USE_ENDSTOP == _YMAX_
#define Z2_MIN_PIN Y_MAX_PIN
#elif Z2_USE_ENDSTOP == _ZMIN_
#define Z2_MIN_PIN Z_MIN_PIN
#elif Z2_USE_ENDSTOP == _ZMAX_
#define Z2_MIN_PIN Z_MAX_PIN
#elif Z2_USE_ENDSTOP == _XDIAG_
#define Z2_MIN_PIN X_DIAG_PIN
#elif Z2_USE_ENDSTOP == _YDIAG_
#define Z2_MIN_PIN Y_DIAG_PIN
#elif Z2_USE_ENDSTOP == _ZDIAG_
#define Z2_MIN_PIN Z_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E0DIAG_
#define Z2_MIN_PIN E0_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E1DIAG_
#define Z2_MIN_PIN E1_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E2DIAG_
#define Z2_MIN_PIN E2_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E3DIAG_
#define Z2_MIN_PIN E3_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E4DIAG_
#define Z2_MIN_PIN E4_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E5DIAG_
#define Z2_MIN_PIN E5_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E6DIAG_
#define Z2_MIN_PIN E6_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E7DIAG_
#define Z2_MIN_PIN E7_DIAG_PIN
#endif
#endif
#define Z2_MAX_ENDSTOP_INVERTING false #define Z2_MAX_ENDSTOP_INVERTING false
#endif #endif
@ -835,48 +1021,110 @@
#if Z_HOME_DIR > 0 #if Z_HOME_DIR > 0
#if Z3_USE_ENDSTOP == _XMIN_ #if Z3_USE_ENDSTOP == _XMIN_
#define Z3_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING #define Z3_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
#define Z3_MAX_PIN X_MIN_PIN
#elif Z3_USE_ENDSTOP == _XMAX_ #elif Z3_USE_ENDSTOP == _XMAX_
#define Z3_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING #define Z3_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
#define Z3_MAX_PIN X_MAX_PIN
#elif Z3_USE_ENDSTOP == _YMIN_ #elif Z3_USE_ENDSTOP == _YMIN_
#define Z3_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING #define Z3_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
#define Z3_MAX_PIN Y_MIN_PIN
#elif Z3_USE_ENDSTOP == _YMAX_ #elif Z3_USE_ENDSTOP == _YMAX_
#define Z3_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING #define Z3_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
#define Z3_MAX_PIN Y_MAX_PIN
#elif Z3_USE_ENDSTOP == _ZMIN_ #elif Z3_USE_ENDSTOP == _ZMIN_
#define Z3_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Z3_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#define Z3_MAX_PIN Z_MIN_PIN
#elif Z3_USE_ENDSTOP == _ZMAX_ #elif Z3_USE_ENDSTOP == _ZMAX_
#define Z3_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Z3_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#define Z3_MAX_PIN Z_MAX_PIN
#else #else
#define Z3_MAX_ENDSTOP_INVERTING false #define Z3_MAX_ENDSTOP_INVERTING false
#endif #endif
#ifndef Z3_MAX_PIN
#if Z3_USE_ENDSTOP == _XMIN_
#define Z3_MAX_PIN X_MIN_PIN
#elif Z3_USE_ENDSTOP == _XMAX_
#define Z3_MAX_PIN X_MAX_PIN
#elif Z3_USE_ENDSTOP == _YMIN_
#define Z3_MAX_PIN Y_MIN_PIN
#elif Z3_USE_ENDSTOP == _YMAX_
#define Z3_MAX_PIN Y_MAX_PIN
#elif Z3_USE_ENDSTOP == _ZMIN_
#define Z3_MAX_PIN Z_MIN_PIN
#elif Z3_USE_ENDSTOP == _ZMAX_
#define Z3_MAX_PIN Z_MAX_PIN
#elif Z3_USE_ENDSTOP == _XDIAG_
#define Z3_MAX_PIN X_DIAG_PIN
#elif Z3_USE_ENDSTOP == _YDIAG_
#define Z3_MAX_PIN Y_DIAG_PIN
#elif Z3_USE_ENDSTOP == _ZDIAG_
#define Z3_MAX_PIN Z_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E0DIAG_
#define Z3_MAX_PIN E0_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E1DIAG_
#define Z3_MAX_PIN E1_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E2DIAG_
#define Z3_MAX_PIN E2_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E3DIAG_
#define Z3_MAX_PIN E3_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E4DIAG_
#define Z3_MAX_PIN E4_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E5DIAG_
#define Z3_MAX_PIN E5_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E6DIAG_
#define Z3_MAX_PIN E6_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E7DIAG_
#define Z3_MAX_PIN E7_DIAG_PIN
#endif
#endif
#define Z3_MIN_ENDSTOP_INVERTING false #define Z3_MIN_ENDSTOP_INVERTING false
#else #else
#if Z3_USE_ENDSTOP == _XMIN_ #if Z3_USE_ENDSTOP == _XMIN_
#define Z3_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING #define Z3_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
#define Z3_MIN_PIN X_MIN_PIN
#elif Z3_USE_ENDSTOP == _XMAX_ #elif Z3_USE_ENDSTOP == _XMAX_
#define Z3_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING #define Z3_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
#define Z3_MIN_PIN X_MAX_PIN
#elif Z3_USE_ENDSTOP == _YMIN_ #elif Z3_USE_ENDSTOP == _YMIN_
#define Z3_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING #define Z3_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
#define Z3_MIN_PIN Y_MIN_PIN
#elif Z3_USE_ENDSTOP == _YMAX_ #elif Z3_USE_ENDSTOP == _YMAX_
#define Z3_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING #define Z3_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
#define Z3_MIN_PIN Y_MAX_PIN
#elif Z3_USE_ENDSTOP == _ZMIN_ #elif Z3_USE_ENDSTOP == _ZMIN_
#define Z3_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Z3_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#define Z3_MIN_PIN Z_MIN_PIN
#elif Z3_USE_ENDSTOP == _ZMAX_ #elif Z3_USE_ENDSTOP == _ZMAX_
#define Z3_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Z3_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#define Z3_MIN_PIN Z_MAX_PIN
#else #else
#define Z3_MIN_ENDSTOP_INVERTING false #define Z3_MIN_ENDSTOP_INVERTING false
#endif #endif
#ifndef Z3_MIN_PIN
#if Z3_USE_ENDSTOP == _XMIN_
#define Z3_MIN_PIN X_MIN_PIN
#elif Z3_USE_ENDSTOP == _XMAX_
#define Z3_MIN_PIN X_MAX_PIN
#elif Z3_USE_ENDSTOP == _YMIN_
#define Z3_MIN_PIN Y_MIN_PIN
#elif Z3_USE_ENDSTOP == _YMAX_
#define Z3_MIN_PIN Y_MAX_PIN
#elif Z3_USE_ENDSTOP == _ZMIN_
#define Z3_MIN_PIN Z_MIN_PIN
#elif Z3_USE_ENDSTOP == _ZMAX_
#define Z3_MIN_PIN Z_MAX_PIN
#elif Z3_USE_ENDSTOP == _XDIAG_
#define Z3_MIN_PIN X_DIAG_PIN
#elif Z3_USE_ENDSTOP == _YDIAG_
#define Z3_MIN_PIN Y_DIAG_PIN
#elif Z3_USE_ENDSTOP == _ZDIAG_
#define Z3_MIN_PIN Z_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E0DIAG_
#define Z3_MIN_PIN E0_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E1DIAG_
#define Z3_MIN_PIN E1_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E2DIAG_
#define Z3_MIN_PIN E2_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E3DIAG_
#define Z3_MIN_PIN E3_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E4DIAG_
#define Z3_MIN_PIN E4_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E5DIAG_
#define Z3_MIN_PIN E5_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E6DIAG_
#define Z3_MIN_PIN E6_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E7DIAG_
#define Z3_MIN_PIN E7_DIAG_PIN
#endif
#endif
#define Z3_MAX_ENDSTOP_INVERTING false #define Z3_MAX_ENDSTOP_INVERTING false
#endif #endif
#endif #endif
@ -885,48 +1133,110 @@
#if Z_HOME_DIR > 0 #if Z_HOME_DIR > 0
#if Z4_USE_ENDSTOP == _XMIN_ #if Z4_USE_ENDSTOP == _XMIN_
#define Z4_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING #define Z4_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
#define Z4_MAX_PIN X_MIN_PIN
#elif Z4_USE_ENDSTOP == _XMAX_ #elif Z4_USE_ENDSTOP == _XMAX_
#define Z4_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING #define Z4_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
#define Z4_MAX_PIN X_MAX_PIN
#elif Z4_USE_ENDSTOP == _YMIN_ #elif Z4_USE_ENDSTOP == _YMIN_
#define Z4_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING #define Z4_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
#define Z4_MAX_PIN Y_MIN_PIN
#elif Z4_USE_ENDSTOP == _YMAX_ #elif Z4_USE_ENDSTOP == _YMAX_
#define Z4_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING #define Z4_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
#define Z4_MAX_PIN Y_MAX_PIN
#elif Z4_USE_ENDSTOP == _ZMIN_ #elif Z4_USE_ENDSTOP == _ZMIN_
#define Z4_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Z4_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#define Z4_MAX_PIN Z_MIN_PIN
#elif Z4_USE_ENDSTOP == _ZMAX_ #elif Z4_USE_ENDSTOP == _ZMAX_
#define Z4_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Z4_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#define Z4_MAX_PIN Z_MAX_PIN
#else #else
#define Z4_MAX_ENDSTOP_INVERTING false #define Z4_MAX_ENDSTOP_INVERTING false
#endif #endif
#ifndef Z4_MAX_PIN
#if Z4_USE_ENDSTOP == _XMIN_
#define Z4_MAX_PIN X_MIN_PIN
#elif Z4_USE_ENDSTOP == _XMAX_
#define Z4_MAX_PIN X_MAX_PIN
#elif Z4_USE_ENDSTOP == _YMIN_
#define Z4_MAX_PIN Y_MIN_PIN
#elif Z4_USE_ENDSTOP == _YMAX_
#define Z4_MAX_PIN Y_MAX_PIN
#elif Z4_USE_ENDSTOP == _ZMIN_
#define Z4_MAX_PIN Z_MIN_PIN
#elif Z4_USE_ENDSTOP == _ZMAX_
#define Z4_MAX_PIN Z_MAX_PIN
#elif Z4_USE_ENDSTOP == _XDIAG_
#define Z4_MAX_PIN X_DIAG_PIN
#elif Z4_USE_ENDSTOP == _YDIAG_
#define Z4_MAX_PIN Y_DIAG_PIN
#elif Z4_USE_ENDSTOP == _ZDIAG_
#define Z4_MAX_PIN Z_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E0DIAG_
#define Z4_MAX_PIN E0_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E1DIAG_
#define Z4_MAX_PIN E1_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E2DIAG_
#define Z4_MAX_PIN E2_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E3DIAG_
#define Z4_MAX_PIN E3_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E4DIAG_
#define Z4_MAX_PIN E4_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E5DIAG_
#define Z4_MAX_PIN E5_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E6DIAG_
#define Z4_MAX_PIN E6_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E7DIAG_
#define Z4_MAX_PIN E7_DIAG_PIN
#endif
#endif
#define Z4_MIN_ENDSTOP_INVERTING false #define Z4_MIN_ENDSTOP_INVERTING false
#else #else
#if Z4_USE_ENDSTOP == _XMIN_ #if Z4_USE_ENDSTOP == _XMIN_
#define Z4_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING #define Z4_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
#define Z4_MIN_PIN X_MIN_PIN
#elif Z4_USE_ENDSTOP == _XMAX_ #elif Z4_USE_ENDSTOP == _XMAX_
#define Z4_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING #define Z4_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
#define Z4_MIN_PIN X_MAX_PIN
#elif Z4_USE_ENDSTOP == _YMIN_ #elif Z4_USE_ENDSTOP == _YMIN_
#define Z4_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING #define Z4_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
#define Z4_MIN_PIN Y_MIN_PIN
#elif Z4_USE_ENDSTOP == _YMAX_ #elif Z4_USE_ENDSTOP == _YMAX_
#define Z4_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING #define Z4_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
#define Z4_MIN_PIN Y_MAX_PIN
#elif Z4_USE_ENDSTOP == _ZMIN_ #elif Z4_USE_ENDSTOP == _ZMIN_
#define Z4_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Z4_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#define Z4_MIN_PIN Z_MIN_PIN
#elif Z4_USE_ENDSTOP == _ZMAX_ #elif Z4_USE_ENDSTOP == _ZMAX_
#define Z4_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Z4_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#define Z4_MIN_PIN Z_MAX_PIN
#else #else
#define Z4_MIN_ENDSTOP_INVERTING false #define Z4_MIN_ENDSTOP_INVERTING false
#endif #endif
#ifndef Z4_MIN_PIN
#if Z4_USE_ENDSTOP == _XMIN_
#define Z4_MIN_PIN X_MIN_PIN
#elif Z4_USE_ENDSTOP == _XMAX_
#define Z4_MIN_PIN X_MAX_PIN
#elif Z4_USE_ENDSTOP == _YMIN_
#define Z4_MIN_PIN Y_MIN_PIN
#elif Z4_USE_ENDSTOP == _YMAX_
#define Z4_MIN_PIN Y_MAX_PIN
#elif Z4_USE_ENDSTOP == _ZMIN_
#define Z4_MIN_PIN Z_MIN_PIN
#elif Z4_USE_ENDSTOP == _ZMAX_
#define Z4_MIN_PIN Z_MAX_PIN
#elif Z4_USE_ENDSTOP == _XDIAG_
#define Z4_MIN_PIN X_DIAG_PIN
#elif Z4_USE_ENDSTOP == _YDIAG_
#define Z4_MIN_PIN Y_DIAG_PIN
#elif Z4_USE_ENDSTOP == _ZDIAG_
#define Z4_MIN_PIN Z_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E0DIAG_
#define Z4_MIN_PIN E0_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E1DIAG_
#define Z4_MIN_PIN E1_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E2DIAG_
#define Z4_MIN_PIN E2_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E3DIAG_
#define Z4_MIN_PIN E3_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E4DIAG_
#define Z4_MIN_PIN E4_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E5DIAG_
#define Z4_MIN_PIN E5_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E6DIAG_
#define Z4_MIN_PIN E6_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E7DIAG_
#define Z4_MIN_PIN E7_DIAG_PIN
#endif
#endif
#define Z4_MAX_ENDSTOP_INVERTING false #define Z4_MAX_ENDSTOP_INVERTING false
#endif #endif
#endif #endif
@ -1220,7 +1530,7 @@
// Other fans // Other fans
#define HAS_FAN0 (PIN_EXISTS(FAN)) #define HAS_FAN0 (PIN_EXISTS(FAN))
#define _HAS_FAN(P) (PIN_EXISTS(FAN_##P) && CONTROLLER_FAN_PIN != FAN_##P##_PIN && E0_AUTO_FAN_PIN != FAN_##P##_PIN && E1_AUTO_FAN_PIN != FAN_##P##_PIN && E2_AUTO_FAN_PIN != FAN_##P##_PIN && E3_AUTO_FAN_PIN != FAN_##P##_PIN && E4_AUTO_FAN_PIN != FAN_##P##_PIN && E5_AUTO_FAN_PIN != FAN_##P##_PIN && E6_AUTO_FAN_PIN != FAN_##P##_PIN && E7_AUTO_FAN_PIN != FAN_##P##_PIN) #define _HAS_FAN(P) (PIN_EXISTS(FAN##P) && CONTROLLER_FAN_PIN != FAN##P##_PIN && E0_AUTO_FAN_PIN != FAN##P##_PIN && E1_AUTO_FAN_PIN != FAN##P##_PIN && E2_AUTO_FAN_PIN != FAN##P##_PIN && E3_AUTO_FAN_PIN != FAN##P##_PIN && E4_AUTO_FAN_PIN != FAN##P##_PIN && E5_AUTO_FAN_PIN != FAN##P##_PIN && E6_AUTO_FAN_PIN != FAN##P##_PIN && E7_AUTO_FAN_PIN != FAN##P##_PIN)
#define HAS_FAN1 _HAS_FAN(1) #define HAS_FAN1 _HAS_FAN(1)
#define HAS_FAN2 _HAS_FAN(2) #define HAS_FAN2 _HAS_FAN(2)
#define HAS_FAN3 _HAS_FAN(3) #define HAS_FAN3 _HAS_FAN(3)

@ -42,7 +42,7 @@
* version was tagged. * version was tagged.
*/ */
#ifndef STRING_DISTRIBUTION_DATE #ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2020-01-27" #define STRING_DISTRIBUTION_DATE "2020-01-31"
#endif #endif
/** /**

@ -171,7 +171,7 @@ namespace ExtUI {
void enableHeater(const extruder_t extruder) { void enableHeater(const extruder_t extruder) {
#if HOTENDS && HEATER_IDLE_HANDLER #if HOTENDS && HEATER_IDLE_HANDLER
thermalManager.reset_heater_idle_timer(extruder - E0); thermalManager.reset_hotend_idle_timer(extruder - E0);
#else #else
UNUSED(extruder); UNUSED(extruder);
#endif #endif
@ -190,7 +190,7 @@ namespace ExtUI {
#endif #endif
default: default:
#if HOTENDS #if HOTENDS
thermalManager.reset_heater_idle_timer(heater - H0); thermalManager.reset_hotend_idle_timer(heater - H0);
#endif #endif
break; break;
} }

@ -119,7 +119,7 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
SUBMENU_N_P(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); }); SUBMENU_N_P(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); });
else { else {
ACTION_ITEM_N_P(s, msg, []{ ACTION_ITEM_N_P(s, msg, []{
char cmd[12]; char cmd[13];
sprintf_P(cmd, PSTR("M600 B0 T%i"), int(MenuItemBase::itemIndex)); sprintf_P(cmd, PSTR("M600 B0 T%i"), int(MenuItemBase::itemIndex));
lcd_enqueue_one_now(cmd); lcd_enqueue_one_now(cmd);
}); });

@ -85,7 +85,9 @@
#elif THERMISTOR_ID == 18 #elif THERMISTOR_ID == 18
#define THERMISTOR_NAME "ATC Semitec 204GT-2" #define THERMISTOR_NAME "ATC Semitec 204GT-2"
#elif THERMISTOR_ID == 20 #elif THERMISTOR_ID == 20
#define THERMISTOR_NAME "Pt100 UltiMB" #define THERMISTOR_NAME "Pt100 UltiMB 5v"
#elif THERMISTOR_ID == 21
#define THERMISTOR_NAME "Pt100 UltiMB 3.3v"
#elif THERMISTOR_ID == 201 #elif THERMISTOR_ID == 201
#define THERMISTOR_NAME "Pt100 OverLord" #define THERMISTOR_NAME "Pt100 OverLord"
#elif THERMISTOR_ID == 60 #elif THERMISTOR_ID == 60

@ -777,13 +777,12 @@ void MarlinUI::update() {
static bool wait_for_unclick; // = false static bool wait_for_unclick; // = false
#if ENABLED(TOUCH_BUTTONS) #if ENABLED(TOUCH_BUTTONS)
if (touch_buttons) { if (touch_buttons) {
RESET_STATUS_TIMEOUT(); RESET_STATUS_TIMEOUT();
if (buttons & (EN_A | EN_B)) { // Menu arrows, in priority if (touch_buttons & (EN_A | EN_B)) { // Menu arrows, in priority
if (ELAPSED(ms, next_button_update_ms)) { if (ELAPSED(ms, next_button_update_ms)) {
encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * (ENCODER_PULSES_PER_STEP) * encoderDirection; encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * (ENCODER_PULSES_PER_STEP) * encoderDirection;
if (buttons & EN_A) encoderDiff *= -1; if (touch_buttons & EN_A) encoderDiff *= -1;
#if ENABLED(AUTO_BED_LEVELING_UBL) #if ENABLED(AUTO_BED_LEVELING_UBL)
if (external_control) ubl.encoder_diff = encoderDiff; if (external_control) ubl.encoder_diff = encoderDiff;
#endif #endif
@ -1246,7 +1245,11 @@ void MarlinUI::update() {
| slow_buttons | slow_buttons
#endif #endif
#if ENABLED(TOUCH_BUTTONS) && HAS_ENCODER_ACTION #if ENABLED(TOUCH_BUTTONS) && HAS_ENCODER_ACTION
| touch_buttons | (touch_buttons
#if HAS_ENCODER_WHEEL
& (~(EN_A | EN_B))
#endif
)
#endif #endif
); );
@ -1277,7 +1280,7 @@ void MarlinUI::update() {
} // next_button_update_ms } // next_button_update_ms
#if HAS_ENCODER_WHEEL && DISABLED(TOUCH_BUTTONS) #if HAS_ENCODER_WHEEL
static uint8_t lastEncoderBits; static uint8_t lastEncoderBits;
#define encrot0 0 #define encrot0 0

@ -39,39 +39,40 @@ L64XX_Marlin L64xxManager;
void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); } void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); }
char L64XX_Marlin::index_to_axis[MAX_L64XX][3] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "Z4", "E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7" }; static const char str_X[] PROGMEM = "X ", str_Y[] PROGMEM = "Y ", str_Z[] PROGMEM = "Z ",
str_X2[] PROGMEM = "X2", str_Y2[] PROGMEM = "Y2",
str_Z2[] PROGMEM = "Z2", str_Z3[] PROGMEM = "Z3", str_Z4[] PROGMEM = "Z4",
str_E0[] PROGMEM = "E0", str_E1[] PROGMEM = "E1",
str_E2[] PROGMEM = "E2", str_E3[] PROGMEM = "E3",
str_E4[] PROGMEM = "E4", str_E5[] PROGMEM = "E5",
str_E6[] PROGMEM = "E6", str_E7[] PROGMEM = "E7"
;
PGM_P const L64XX_Marlin::index_to_axis[] PROGMEM = {
str_X, str_Y, str_Z, str_X2, str_Y2, str_Z2, str_Z3, str_Z4,
str_E0, str_E1, str_E2, str_E3, str_E4, str_E5, str_E6, str_E7
};
#define DEBUG_OUT ENABLED(L6470_CHITCHAT) #define DEBUG_OUT ENABLED(L6470_CHITCHAT)
#include "../../core/debug_out.h" #include "../../core/debug_out.h"
uint8_t L64XX_Marlin::dir_commands[MAX_L64XX]; // array to hold direction command for each driver uint8_t L64XX_Marlin::dir_commands[MAX_L64XX]; // array to hold direction command for each driver
uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = { (INVERT_X_DIR), // 0 X const uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = {
(INVERT_Y_DIR), // 1 Y INVERT_X_DIR, INVERT_Y_DIR, INVERT_Z_DIR
(INVERT_Z_DIR), // 2 Z , (INVERT_X_DIR) // X2
#if ENABLED(X_DUAL_STEPPER_DRIVERS) // 3 X2 #if ENABLED(X_DUAL_STEPPER_DRIVERS)
(INVERT_X_DIR) ^ (INVERT_X2_VS_X_DIR), ^ (INVERT_X2_VS_X_DIR)
#else #endif
(INVERT_X_DIR), , (INVERT_Y_DIR) // Y2
#endif #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
#if ENABLED(Y_DUAL_STEPPER_DRIVERS) // 4 Y2 ^ (INVERT_Y2_VS_Y_DIR)
(INVERT_Y_DIR) ^ (INVERT_Y2_VS_Y_DIR), #endif
#else , INVERT_Z_DIR, INVERT_Z_DIR, INVERT_Z_DIR // Z2,Z3,Z4
(INVERT_Y_DIR),
#endif , INVERT_E0_DIR, INVERT_E1_DIR, INVERT_E2_DIR, INVERT_E3_DIR
(INVERT_Z_DIR), // 5 Z2 , INVERT_E4_DIR, INVERT_E5_DIR, INVERT_E6_DIR, INVERT_E7_DIR
(INVERT_Z_DIR), // 6 Z3 };
(INVERT_Z_DIR), // 7 Z4
(INVERT_E0_DIR), // 8 E0
(INVERT_E1_DIR), // 9 E1
(INVERT_E2_DIR), // 10 E2
(INVERT_E3_DIR), // 11 E3
(INVERT_E4_DIR), // 12 E4
(INVERT_E5_DIR), // 13 E5
(INVERT_E6_DIR), // 14 E6
(INVERT_E7_DIR) // 15 E7
};
volatile uint8_t L64XX_Marlin::spi_abort = false; volatile uint8_t L64XX_Marlin::spi_abort = false;
uint8_t L64XX_Marlin::spi_active = false; uint8_t L64XX_Marlin::spi_active = false;
@ -379,35 +380,27 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
found_displacement = true; found_displacement = true;
displacement = _displacement; displacement = _displacement;
uint8_t axis_offset = parser.byteval('J'); uint8_t axis_offset = parser.byteval('J');
axis_mon[0][0] = axis_codes[i]; // axis ASCII value (target character) axis_mon[0][0] = axis_codes[i]; // Axis first character, one of XYZE
const bool single_or_e = axis_offset >= 2 || axis_mon[0][0] == 'E',
one_or_more = !single_or_e && axis_offset == 0;
uint8_t driver_count_local = 0; // Can't use "driver_count" directly as a subscript because it's passed by reference uint8_t driver_count_local = 0; // Can't use "driver_count" directly as a subscript because it's passed by reference
if (axis_offset >= 2 || axis_mon[0][0] == 'E') { // Single axis, E0, or E1 if (single_or_e) // Single axis, E0, or E1
axis_mon[0][1] = axis_offset + '0'; axis_mon[0][1] = axis_offset + '0'; // Index given by 'J' parameter
for (j = 0; j < MAX_L64XX; j++) { // See how many drivers on this axis
const char * const str = index_to_axis[j]; if (single_or_e || one_or_more) {
if (axis_mon[0][0] == str[0]) { for (j = 0; j < MAX_L64XX; j++) { // Count up the drivers on this axis
char * const mon = axis_mon[driver_count_local]; PGM_P str = (PGM_P)pgm_read_ptr(&index_to_axis[j]); // Get a PGM_P from progmem
mon[0] = str[0]; const char c = pgm_read_byte(str); // Get a char from progmem
mon[1] = str[1]; if (axis_mon[0][0] == c) { // For each stepper on this axis...
mon[2] = str[2]; // append end of string char *mon = axis_mon[driver_count_local];
axis_index[driver_count_local] = (L64XX_axis_t)j; // set axis index *mon++ = c; // Copy the 3 letter axis name
driver_count_local++; *mon++ = pgm_read_byte(&str[1]); // to the axis_mon array
} *mon = pgm_read_byte(&str[2]);
} axis_index[driver_count_local] = (L64XX_axis_t)j; // And store the L64XX axis index
}
else if (axis_offset == 0) { // One or more axes
for (j = 0; j < MAX_L64XX; j++) { // See how many drivers on this axis
const char * const str = index_to_axis[j];
if (axis_mon[0][0] == str[0]) {
char * const mon = axis_mon[driver_count_local];
mon[0] = str[0];
mon[1] = str[1];
mon[2] = str[2]; // append end of string
axis_index[driver_count_local] = (L64XX_axis_t)j; // set axis index
driver_count_local++; driver_count_local++;
} }
} }
driver_count = driver_count_local; if (one_or_more) driver_count = driver_count_local;
} }
break; // only take first axis found break; // only take first axis found
} }
@ -494,8 +487,8 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
for (uint8_t k = 0; k < driver_count; k++) { for (uint8_t k = 0; k < driver_count; k++) {
uint8_t not_found = true; uint8_t not_found = true;
for (j = 1; j <= L64XX::chain[0]; j++) { for (j = 1; j <= L64XX::chain[0]; j++) {
const char * const ind_axis = index_to_axis[L64XX::chain[j]]; PGM_P const str = (PGM_P)pgm_read_ptr(&index_to_axis[L64XX::chain[j]]);
if (ind_axis[0] == axis_mon[k][0] && ind_axis[1] == axis_mon[k][1]) { // See if a L6470 driver if (pgm_read_byte(&str[0]) == axis_mon[k][0] && pgm_read_byte(&str[1]) == axis_mon[k][1]) { // See if a L6470 driver
not_found = false; not_found = false;
break; break;
} }
@ -724,7 +717,8 @@ void L64XX_Marlin::say_axis(const L64XX_axis_t axis, const uint8_t label/*=true*
}; };
void L64XX_Marlin::append_stepper_err(char* &p, const uint8_t stepper_index, const char * const err/*=nullptr*/) { void L64XX_Marlin::append_stepper_err(char* &p, const uint8_t stepper_index, const char * const err/*=nullptr*/) {
p += sprintf_P(p, PSTR("Stepper %c%c "), index_to_axis[stepper_index][0], index_to_axis[stepper_index][1]); PGM_P const str = (PGM_P)pgm_read_ptr(&index_to_axis[stepper_index]);
p += sprintf_P(p, PSTR("Stepper %c%c "), pgm_read_byte(&str[0]), pgm_read_byte(&str[1]));
if (err) p += sprintf_P(p, err); if (err) p += sprintf_P(p, err);
} }

@ -39,9 +39,10 @@ enum L64XX_axis_t : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E
class L64XX_Marlin : public L64XXHelper { class L64XX_Marlin : public L64XXHelper {
public: public:
static char index_to_axis[MAX_L64XX][3]; static PGM_P const index_to_axis[MAX_L64XX];
static const uint8_t index_to_dir[MAX_L64XX];
static uint8_t index_to_dir[MAX_L64XX];
static uint8_t dir_commands[MAX_L64XX]; static uint8_t dir_commands[MAX_L64XX];
// Flags to guarantee graceful switch if stepper interrupts L6470 SPI transfer // Flags to guarantee graceful switch if stepper interrupts L6470 SPI transfer
@ -69,7 +70,6 @@ public:
static void transfer(uint8_t L6470_buf[], const uint8_t length); static void transfer(uint8_t L6470_buf[], const uint8_t length);
//static char* index_to_axis(const uint8_t index);
static void say_axis(const L64XX_axis_t axis, const uint8_t label=true); static void say_axis(const L64XX_axis_t axis, const uint8_t label=true);
#if ENABLED(L6470_CHITCHAT) #if ENABLED(L6470_CHITCHAT)
static void error_status_decode( static void error_status_decode(

@ -111,7 +111,7 @@ xyze_pos_t destination; // {0}
// G60/G61 Position Save and Return // G60/G61 Position Save and Return
#if SAVED_POSITIONS #if SAVED_POSITIONS
uint8_t saved_slots; uint8_t saved_slots[(SAVED_POSITIONS + 7) >> 3];
xyz_pos_t stored_position[SAVED_POSITIONS]; xyz_pos_t stored_position[SAVED_POSITIONS];
#endif #endif

@ -67,7 +67,7 @@ extern xyze_pos_t current_position, // High-level current tool position
// G60/G61 Position Save and Return // G60/G61 Position Save and Return
#if SAVED_POSITIONS #if SAVED_POSITIONS
extern uint8_t saved_slots; extern uint8_t saved_slots[(SAVED_POSITIONS + 7) >> 3];
extern xyz_pos_t stored_position[SAVED_POSITIONS]; extern xyz_pos_t stored_position[SAVED_POSITIONS];
#endif #endif

@ -1252,13 +1252,13 @@ void Planner::check_axes_activity() {
// Disable inactive axes // Disable inactive axes
// //
#if ENABLED(DISABLE_X) #if ENABLED(DISABLE_X)
if (!axis_active.x) disable_X(); if (!axis_active.x) DISABLE_AXIS_X();
#endif #endif
#if ENABLED(DISABLE_Y) #if ENABLED(DISABLE_Y)
if (!axis_active.y) disable_Y(); if (!axis_active.y) DISABLE_AXIS_Y();
#endif #endif
#if ENABLED(DISABLE_Z) #if ENABLED(DISABLE_Z)
if (!axis_active.z) disable_Z(); if (!axis_active.z) DISABLE_AXIS_Z();
#endif #endif
#if ENABLED(DISABLE_E) #if ENABLED(DISABLE_E)
if (!axis_active.e) disable_e_steppers(); if (!axis_active.e) disable_e_steppers();
@ -1905,29 +1905,29 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
// Enable active axes // Enable active axes
#if CORE_IS_XY #if CORE_IS_XY
if (block->steps.a || block->steps.b) { if (block->steps.a || block->steps.b) {
enable_X(); ENABLE_AXIS_X();
enable_Y(); ENABLE_AXIS_Y();
} }
#if DISABLED(Z_LATE_ENABLE) #if DISABLED(Z_LATE_ENABLE)
if (block->steps.z) enable_Z(); if (block->steps.z) ENABLE_AXIS_Z();
#endif #endif
#elif CORE_IS_XZ #elif CORE_IS_XZ
if (block->steps.a || block->steps.c) { if (block->steps.a || block->steps.c) {
enable_X(); ENABLE_AXIS_X();
enable_Z(); ENABLE_AXIS_Z();
} }
if (block->steps.y) enable_Y(); if (block->steps.y) ENABLE_AXIS_Y();
#elif CORE_IS_YZ #elif CORE_IS_YZ
if (block->steps.b || block->steps.c) { if (block->steps.b || block->steps.c) {
enable_Y(); ENABLE_AXIS_Y();
enable_Z(); ENABLE_AXIS_Z();
} }
if (block->steps.x) enable_X(); if (block->steps.x) ENABLE_AXIS_X();
#else #else
if (block->steps.x) enable_X(); if (block->steps.x) ENABLE_AXIS_X();
if (block->steps.y) enable_Y(); if (block->steps.y) ENABLE_AXIS_Y();
#if DISABLED(Z_LATE_ENABLE) #if DISABLED(Z_LATE_ENABLE)
if (block->steps.z) enable_Z(); if (block->steps.z) ENABLE_AXIS_Z();
#endif #endif
#endif #endif
@ -1945,27 +1945,27 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
#if HAS_DUPLICATION_MODE #if HAS_DUPLICATION_MODE
if (extruder_duplication_enabled && extruder == 0) { if (extruder_duplication_enabled && extruder == 0) {
enable_E1(); ENABLE_AXIS_E1();
g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2; g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
} }
#endif #endif
#define ENABLE_ONE_E(N) do{ \ #define ENABLE_ONE_E(N) do{ \
if (extruder == N) { \ if (extruder == N) { \
enable_E##N(); \ ENABLE_AXIS_E##N(); \
g_uc_extruder_last_move[N] = (BLOCK_BUFFER_SIZE) * 2; \ g_uc_extruder_last_move[N] = (BLOCK_BUFFER_SIZE) * 2; \
} \ } \
else if (!g_uc_extruder_last_move[N]) \ else if (!g_uc_extruder_last_move[N]) \
disable_E##N(); \ DISABLE_AXIS_E##N(); \
}while(0); }while(0);
#else #else
#define ENABLE_ONE_E(N) enable_E##N(); #define ENABLE_ONE_E(N) ENABLE_AXIS_E##N();
#endif #endif
REPEAT(EXTRUDERS, ENABLE_ONE_E); REPEAT(EXTRUDERS, ENABLE_ONE_E); // (ENABLE_ONE_E must end with semicolon)
} }
#endif // EXTRUDERS #endif // EXTRUDERS

@ -251,7 +251,7 @@ xyz_pos_t probe_offset; // Initialized by settings.load()
#if ENABLED(PROBING_STEPPERS_OFF) #if ENABLED(PROBING_STEPPERS_OFF)
disable_e_steppers(); disable_e_steppers();
#if NONE(DELTA, HOME_AFTER_DEACTIVATE) #if NONE(DELTA, HOME_AFTER_DEACTIVATE)
disable_X(); disable_Y(); DISABLE_AXIS_X(); DISABLE_AXIS_Y();
#endif #endif
#endif #endif
if (p) safe_delay( if (p) safe_delay(

@ -1927,7 +1927,7 @@ uint32_t Stepper::stepper_block_phase_isr() {
// If delayed Z enable, enable it now. This option will severely interfere with // If delayed Z enable, enable it now. This option will severely interfere with
// timing between pulses when chaining motion between blocks, and it could lead // timing between pulses when chaining motion between blocks, and it could lead
// to lost steps in both X and Y axis, so avoid using it unless strictly necessary!! // to lost steps in both X and Y axis, so avoid using it unless strictly necessary!!
if (current_block->steps.z) enable_Z(); if (current_block->steps.z) ENABLE_AXIS_Z();
#endif #endif
// Mark the time_nominal as not calculated yet // Mark the time_nominal as not calculated yet
@ -2215,12 +2215,12 @@ void Stepper::init() {
#define _STEP_INIT(AXIS) AXIS ##_STEP_INIT() #define _STEP_INIT(AXIS) AXIS ##_STEP_INIT()
#define _WRITE_STEP(AXIS, HIGHLOW) AXIS ##_STEP_WRITE(HIGHLOW) #define _WRITE_STEP(AXIS, HIGHLOW) AXIS ##_STEP_WRITE(HIGHLOW)
#define _DISABLE(AXIS) disable_## AXIS() #define _DISABLE_AXIS(AXIS) DISABLE_AXIS_## AXIS()
#define AXIS_INIT(AXIS, PIN) \ #define AXIS_INIT(AXIS, PIN) \
_STEP_INIT(AXIS); \ _STEP_INIT(AXIS); \
_WRITE_STEP(AXIS, _INVERT_STEP_PIN(PIN)); \ _WRITE_STEP(AXIS, _INVERT_STEP_PIN(PIN)); \
_DISABLE(AXIS) _DISABLE_AXIS(AXIS)
#define E_AXIS_INIT(NUM) AXIS_INIT(E## NUM, E) #define E_AXIS_INIT(NUM) AXIS_INIT(E## NUM, E)
@ -2437,7 +2437,7 @@ void Stepper::report_positions() {
#endif #endif
#define EXTRA_CYCLES_BABYSTEP (STEP_PULSE_CYCLES - (CYCLES_EATEN_BABYSTEP)) #define EXTRA_CYCLES_BABYSTEP (STEP_PULSE_CYCLES - (CYCLES_EATEN_BABYSTEP))
#define _ENABLE(AXIS) enable_## AXIS() #define _ENABLE_AXIS(AXIS) ENABLE_AXIS_## AXIS()
#define _READ_DIR(AXIS) AXIS ##_DIR_READ() #define _READ_DIR(AXIS) AXIS ##_DIR_READ()
#define _INVERT_DIR(AXIS) INVERT_## AXIS ##_DIR #define _INVERT_DIR(AXIS) INVERT_## AXIS ##_DIR
#define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true) #define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true)
@ -2460,7 +2460,7 @@ void Stepper::report_positions() {
#define BABYSTEP_AXIS(AXIS, INVERT, DIR) { \ #define BABYSTEP_AXIS(AXIS, INVERT, DIR) { \
const uint8_t old_dir = _READ_DIR(AXIS); \ const uint8_t old_dir = _READ_DIR(AXIS); \
_ENABLE(AXIS); \ _ENABLE_AXIS(AXIS); \
DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY); \ DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY); \
_APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT); \ _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT); \
DELAY_NS(MINIMUM_STEPPER_POST_DIR_DELAY); \ DELAY_NS(MINIMUM_STEPPER_POST_DIR_DELAY); \
@ -2523,9 +2523,9 @@ void Stepper::report_positions() {
const bool z_direction = direction ^ BABYSTEP_INVERT_Z; const bool z_direction = direction ^ BABYSTEP_INVERT_Z;
enable_X(); ENABLE_AXIS_X();
enable_Y(); ENABLE_AXIS_Y();
enable_Z(); ENABLE_AXIS_Z();
#if MINIMUM_STEPPER_PRE_DIR_DELAY > 0 #if MINIMUM_STEPPER_PRE_DIR_DELAY > 0
DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY); DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY);

@ -55,6 +55,9 @@
#define X_DIR_INIT() NOOP #define X_DIR_INIT() NOOP
#define X_DIR_WRITE(STATE) L64XX_DIR_WRITE(X, STATE) #define X_DIR_WRITE(STATE) L64XX_DIR_WRITE(X, STATE)
#define X_DIR_READ() (stepper##X.getStatus() & STATUS_DIR); #define X_DIR_READ() (stepper##X.getStatus() & STATUS_DIR);
#if AXIS_DRIVER_TYPE_X(L6470)
#define DISABLE_STEPPER_X() stepperX.free()
#endif
#endif #endif
#endif #endif
@ -72,6 +75,9 @@
#define Y_DIR_INIT() NOOP #define Y_DIR_INIT() NOOP
#define Y_DIR_WRITE(STATE) L64XX_DIR_WRITE(Y, STATE) #define Y_DIR_WRITE(STATE) L64XX_DIR_WRITE(Y, STATE)
#define Y_DIR_READ() (stepper##Y.getStatus() & STATUS_DIR); #define Y_DIR_READ() (stepper##Y.getStatus() & STATUS_DIR);
#if AXIS_DRIVER_TYPE_Y(L6470)
#define DISABLE_STEPPER_Y() stepperY.free()
#endif
#endif #endif
#endif #endif
@ -89,6 +95,9 @@
#define Z_DIR_INIT() NOOP #define Z_DIR_INIT() NOOP
#define Z_DIR_WRITE(STATE) L64XX_DIR_WRITE(Z, STATE) #define Z_DIR_WRITE(STATE) L64XX_DIR_WRITE(Z, STATE)
#define Z_DIR_READ() (stepper##Z.getStatus() & STATUS_DIR); #define Z_DIR_READ() (stepper##Z.getStatus() & STATUS_DIR);
#if AXIS_DRIVER_TYPE_Z(L6470)
#define DISABLE_STEPPER_Z() stepperZ.free()
#endif
#endif #endif
#endif #endif
@ -109,6 +118,10 @@
#endif #endif
#endif #endif
#if AXIS_DRIVER_TYPE_X2(L6470)
#define DISABLE_STEPPER_X2() stepperX2.free()
#endif
// Y2 Stepper // Y2 Stepper
#if HAS_Y2_ENABLE && AXIS_IS_L64XX(Y2) #if HAS_Y2_ENABLE && AXIS_IS_L64XX(Y2)
extern L64XX_CLASS(Y2) stepperY2; extern L64XX_CLASS(Y2) stepperY2;
@ -126,6 +139,10 @@
#endif #endif
#endif #endif
#if AXIS_DRIVER_TYPE_Y2(L6470)
#define DISABLE_STEPPER_Y2() stepperY2.free()
#endif
// Z2 Stepper // Z2 Stepper
#if HAS_Z2_ENABLE && AXIS_IS_L64XX(Z2) #if HAS_Z2_ENABLE && AXIS_IS_L64XX(Z2)
extern L64XX_CLASS(Z2) stepperZ2; extern L64XX_CLASS(Z2) stepperZ2;
@ -143,6 +160,10 @@
#endif #endif
#endif #endif
#if AXIS_DRIVER_TYPE_Z2(L6470)
#define DISABLE_STEPPER_Z2() stepperZ2.free()
#endif
// Z3 Stepper // Z3 Stepper
#if HAS_Z3_ENABLE && AXIS_IS_L64XX(Z3) #if HAS_Z3_ENABLE && AXIS_IS_L64XX(Z3)
extern L64XX_CLASS(Z3) stepperZ3; extern L64XX_CLASS(Z3) stepperZ3;
@ -160,6 +181,10 @@
#endif #endif
#endif #endif
#if AXIS_DRIVER_TYPE_Z3(L6470)
#define DISABLE_STEPPER_Z3() stepperZ3.free()
#endif
// Z4 Stepper // Z4 Stepper
#if HAS_Z4_ENABLE && AXIS_IS_L64XX(Z4) #if HAS_Z4_ENABLE && AXIS_IS_L64XX(Z4)
extern L64XX_CLASS(Z4) stepperZ4; extern L64XX_CLASS(Z4) stepperZ4;
@ -177,6 +202,10 @@
#endif #endif
#endif #endif
#if AXIS_DRIVER_TYPE_Z4(L6470)
#define DISABLE_STEPPER_Z4() stepperZ4.free()
#endif
// E0 Stepper // E0 Stepper
#if AXIS_IS_L64XX(E0) #if AXIS_IS_L64XX(E0)
extern L64XX_CLASS(E0) stepperE0; extern L64XX_CLASS(E0) stepperE0;
@ -191,6 +220,9 @@
#define E0_DIR_INIT() NOOP #define E0_DIR_INIT() NOOP
#define E0_DIR_WRITE(STATE) L64XX_DIR_WRITE(E0, STATE) #define E0_DIR_WRITE(STATE) L64XX_DIR_WRITE(E0, STATE)
#define E0_DIR_READ() (stepper##E0.getStatus() & STATUS_DIR); #define E0_DIR_READ() (stepper##E0.getStatus() & STATUS_DIR);
#if AXIS_DRIVER_TYPE_E0(L6470)
#define DISABLE_STEPPER_E0() do{ stepperE0.free(); CBI(axis_known_position, E_AXIS); }while(0)
#endif
#endif #endif
#endif #endif
@ -208,6 +240,9 @@
#define E1_DIR_INIT() NOOP #define E1_DIR_INIT() NOOP
#define E1_DIR_WRITE(STATE) L64XX_DIR_WRITE(E1, STATE) #define E1_DIR_WRITE(STATE) L64XX_DIR_WRITE(E1, STATE)
#define E1_DIR_READ() (stepper##E1.getStatus() & STATUS_DIR); #define E1_DIR_READ() (stepper##E1.getStatus() & STATUS_DIR);
#if AXIS_DRIVER_TYPE_E1(L6470)
#define DISABLE_STEPPER_E1() do{ stepperE1.free(); CBI(axis_known_position, E_AXIS); }while(0)
#endif
#endif #endif
#endif #endif
@ -225,6 +260,9 @@
#define E2_DIR_INIT() NOOP #define E2_DIR_INIT() NOOP
#define E2_DIR_WRITE(STATE) L64XX_DIR_WRITE(E2, STATE) #define E2_DIR_WRITE(STATE) L64XX_DIR_WRITE(E2, STATE)
#define E2_DIR_READ() (stepper##E2.getStatus() & STATUS_DIR); #define E2_DIR_READ() (stepper##E2.getStatus() & STATUS_DIR);
#if AXIS_DRIVER_TYPE_E2(L6470)
#define DISABLE_STEPPER_E2() do{ stepperE2.free(); CBI(axis_known_position, E_AXIS); }while(0)
#endif
#endif #endif
#endif #endif
@ -259,6 +297,9 @@
#define E4_DIR_INIT() NOOP #define E4_DIR_INIT() NOOP
#define E4_DIR_WRITE(STATE) L64XX_DIR_WRITE(E4, STATE) #define E4_DIR_WRITE(STATE) L64XX_DIR_WRITE(E4, STATE)
#define E4_DIR_READ() (stepper##E4.getStatus() & STATUS_DIR); #define E4_DIR_READ() (stepper##E4.getStatus() & STATUS_DIR);
#if AXIS_DRIVER_TYPE_E4(L6470)
#define DISABLE_STEPPER_E4() do{ stepperE4.free(); CBI(axis_known_position, E_AXIS); }while(0)
#endif
#endif #endif
#endif #endif
@ -276,6 +317,9 @@
#define E5_DIR_INIT() NOOP #define E5_DIR_INIT() NOOP
#define E5_DIR_WRITE(STATE) L64XX_DIR_WRITE(E5, STATE) #define E5_DIR_WRITE(STATE) L64XX_DIR_WRITE(E5, STATE)
#define E5_DIR_READ() (stepper##E5.getStatus() & STATUS_DIR); #define E5_DIR_READ() (stepper##E5.getStatus() & STATUS_DIR);
#if AXIS_DRIVER_TYPE_E5(L6470)
#define DISABLE_STEPPER_E5() do{ stepperE5.free(); CBI(axis_known_position, E_AXIS); }while(0)
#endif
#endif #endif
#endif #endif
@ -293,6 +337,9 @@
#define E6_DIR_INIT() NOOP #define E6_DIR_INIT() NOOP
#define E6_DIR_WRITE(STATE) L64XX_DIR_WRITE(E6, STATE) #define E6_DIR_WRITE(STATE) L64XX_DIR_WRITE(E6, STATE)
#define E6_DIR_READ() (stepper##E6.getStatus() & STATUS_DIR); #define E6_DIR_READ() (stepper##E6.getStatus() & STATUS_DIR);
#if AXIS_DRIVER_TYPE_E6(L6470)
#define DISABLE_STEPPER_E6() do{ stepperE6.free(); CBI(axis_known_position, E_AXIS); }while(0)
#endif
#endif #endif
#endif #endif
@ -310,5 +357,8 @@
#define E7_DIR_INIT() NOOP #define E7_DIR_INIT() NOOP
#define E7_DIR_WRITE(STATE) L64XX_DIR_WRITE(E7, STATE) #define E7_DIR_WRITE(STATE) L64XX_DIR_WRITE(E7, STATE)
#define E7_DIR_READ() (stepper##E7.getStatus() & STATUS_DIR); #define E7_DIR_READ() (stepper##E7.getStatus() & STATUS_DIR);
#if AXIS_DRIVER_TYPE_E7(L6470)
#define DISABLE_STEPPER_E7() do{ stepperE7.free(); CBI(axis_known_position, E_AXIS); }while(0)
#endif
#endif #endif
#endif #endif

@ -594,320 +594,412 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#endif #endif
// //
// X, Y, Z Stepper enable / disable // Individual stepper enable / disable macros
// //
#if AXIS_DRIVER_TYPE_X(L6470)
extern L6470 stepperX;
#define X_enable() NOOP
#define X_disable() stepperX.free()
#elif HAS_X_ENABLE
#define X_enable() X_ENABLE_WRITE( X_ENABLE_ON)
#define X_disable() X_ENABLE_WRITE(!X_ENABLE_ON)
#else
#define X_enable() NOOP
#define X_disable() NOOP
#endif
#if AXIS_DRIVER_TYPE_X2(L6470) #ifndef ENABLE_STEPPER_X
extern L6470 stepperX2; #if HAS_X_ENABLE
#define X2_enable() NOOP #define ENABLE_STEPPER_X() X_ENABLE_WRITE( X_ENABLE_ON)
#define X2_disable() stepperX2.free() #else
#elif HAS_X2_ENABLE #define ENABLE_STEPPER_X() NOOP
#define X2_enable() X2_ENABLE_WRITE( X_ENABLE_ON) #endif
#define X2_disable() X2_ENABLE_WRITE(!X_ENABLE_ON)
#else
#define X2_enable() NOOP
#define X2_disable() NOOP
#endif #endif
#ifndef DISABLE_STEPPER_X
#define enable_X() do{ X_enable(); X2_enable(); }while(0) #if HAS_X_ENABLE
#define disable_X() do{ X_disable(); X2_disable(); CBI(axis_known_position, X_AXIS); }while(0) #define DISABLE_STEPPER_X() X_ENABLE_WRITE(!X_ENABLE_ON)
#else
#if AXIS_DRIVER_TYPE_Y(L6470) #define DISABLE_STEPPER_X() NOOP
extern L6470 stepperY; #endif
#define Y_enable() NOOP
#define Y_disable() stepperY.free()
#elif HAS_Y_ENABLE
#define Y_enable() Y_ENABLE_WRITE( Y_ENABLE_ON)
#define Y_disable() Y_ENABLE_WRITE(!Y_ENABLE_ON)
#else
#define Y_enable() NOOP
#define Y_disable() NOOP
#endif #endif
#if AXIS_DRIVER_TYPE_Y2(L6470) #ifndef ENABLE_STEPPER_X2
extern L6470 stepperY2; #if HAS_X2_ENABLE
#define Y2_enable() NOOP #define ENABLE_STEPPER_X2() X2_ENABLE_WRITE( X_ENABLE_ON)
#define Y2_disable() stepperY2.free() #else
#elif HAS_Y2_ENABLE #define ENABLE_STEPPER_X2() NOOP
#define Y2_enable() Y2_ENABLE_WRITE( Y_ENABLE_ON) #endif
#define Y2_disable() Y2_ENABLE_WRITE(!Y_ENABLE_ON) #endif
#else #ifndef DISABLE_STEPPER_X2
#define Y2_enable() NOOP #if HAS_X2_ENABLE
#define Y2_disable() NOOP #define DISABLE_STEPPER_X2() X2_ENABLE_WRITE(!X_ENABLE_ON)
#else
#define DISABLE_STEPPER_X2() NOOP
#endif
#endif #endif
#define enable_Y() do{ Y_enable(); Y2_enable(); }while(0) #ifndef ENABLE_STEPPER_Y
#define disable_Y() do{ Y_disable(); Y2_disable(); CBI(axis_known_position, Y_AXIS); }while(0) #if HAS_Y_ENABLE
#define ENABLE_STEPPER_Y() Y_ENABLE_WRITE( Y_ENABLE_ON)
#if AXIS_DRIVER_TYPE_Z(L6470) #else
extern L6470 stepperZ; #define ENABLE_STEPPER_Y() NOOP
#define Z_enable() NOOP #endif
#define Z_disable() stepperZ.free() #endif
#elif HAS_Z_ENABLE #ifndef DISABLE_STEPPER_Y
#define Z_enable() Z_ENABLE_WRITE( Z_ENABLE_ON) #if HAS_Y_ENABLE
#define Z_disable() Z_ENABLE_WRITE(!Z_ENABLE_ON) #define DISABLE_STEPPER_Y() Y_ENABLE_WRITE(!Y_ENABLE_ON)
#else #else
#define Z_enable() NOOP #define DISABLE_STEPPER_Y() NOOP
#define Z_disable() NOOP #endif
#endif #endif
#if AXIS_DRIVER_TYPE_Z2(L6470) #ifndef ENABLE_STEPPER_Y2
extern L6470 stepperZ2; #if HAS_Y2_ENABLE
#define Z2_enable() NOOP #define ENABLE_STEPPER_Y2() Y2_ENABLE_WRITE( Y_ENABLE_ON)
#define Z2_disable() stepperZ2.free() #else
#elif HAS_Z2_ENABLE #define ENABLE_STEPPER_Y2() NOOP
#define Z2_enable() Z2_ENABLE_WRITE( Z_ENABLE_ON) #endif
#define Z2_disable() Z2_ENABLE_WRITE(!Z_ENABLE_ON) #endif
#else #ifndef DISABLE_STEPPER_Y2
#define Z2_enable() NOOP #if HAS_Y2_ENABLE
#define Z2_disable() NOOP #define DISABLE_STEPPER_Y2() Y2_ENABLE_WRITE(!Y_ENABLE_ON)
#else
#define DISABLE_STEPPER_Y2() NOOP
#endif
#endif #endif
#if AXIS_DRIVER_TYPE_Z3(L6470) #ifndef ENABLE_STEPPER_Z
extern L6470 stepperZ3; #if HAS_Z_ENABLE
#define Z3_enable() NOOP #define ENABLE_STEPPER_Z() Z_ENABLE_WRITE( Z_ENABLE_ON)
#define Z3_disable() stepperZ3.free() #else
#elif HAS_Z3_ENABLE #define ENABLE_STEPPER_Z() NOOP
#define Z3_enable() Z3_ENABLE_WRITE( Z_ENABLE_ON) #endif
#define Z3_disable() Z3_ENABLE_WRITE(!Z_ENABLE_ON) #endif
#else #ifndef DISABLE_STEPPER_Z
#define Z3_enable() NOOP #if HAS_Z_ENABLE
#define Z3_disable() NOOP #define DISABLE_STEPPER_Z() Z_ENABLE_WRITE(!Z_ENABLE_ON)
#else
#define DISABLE_STEPPER_Z() NOOP
#endif
#endif #endif
#if AXIS_DRIVER_TYPE_Z4(L6470) #ifndef ENABLE_STEPPER_Z2
extern L6470 stepperZ4; #if HAS_Z2_ENABLE
#define Z4_enable() NOOP #define ENABLE_STEPPER_Z2() Z2_ENABLE_WRITE( Z_ENABLE_ON)
#define Z4_disable() stepperZ4.free() #else
#elif HAS_Z4_ENABLE #define ENABLE_STEPPER_Z2() NOOP
#define Z4_enable() Z4_ENABLE_WRITE( Z_ENABLE_ON) #endif
#define Z4_disable() Z4_ENABLE_WRITE(!Z_ENABLE_ON) #endif
#else #ifndef DISABLE_STEPPER_Z2
#define Z4_enable() NOOP #if HAS_Z2_ENABLE
#define Z4_disable() NOOP #define DISABLE_STEPPER_Z2() Z2_ENABLE_WRITE(!Z_ENABLE_ON)
#else
#define DISABLE_STEPPER_Z2() NOOP
#endif
#endif #endif
#define enable_Z() do{ Z_enable(); Z2_enable(); Z3_enable(); Z4_enable(); }while(0) #ifndef ENABLE_STEPPER_Z3
#define disable_Z() do{ Z_disable(); Z2_disable(); Z3_disable(); Z4_disable(); CBI(axis_known_position, Z_AXIS); }while(0) #if HAS_Z3_ENABLE
#define ENABLE_STEPPER_Z3() Z3_ENABLE_WRITE( Z_ENABLE_ON)
#else
#define ENABLE_STEPPER_Z3() NOOP
#endif
#endif
#ifndef DISABLE_STEPPER_Z3
#if HAS_Z3_ENABLE
#define DISABLE_STEPPER_Z3() Z3_ENABLE_WRITE(!Z_ENABLE_ON)
#else
#define DISABLE_STEPPER_Z3() NOOP
#endif
#endif
// #ifndef ENABLE_STEPPER_Z4
// Extruder Stepper enable / disable #if HAS_Z4_ENABLE
// #define ENABLE_STEPPER_Z4() Z4_ENABLE_WRITE( Z_ENABLE_ON)
#else
#define ENABLE_STEPPER_Z4() NOOP
#endif
#endif
#ifndef DISABLE_STEPPER_Z4
#if HAS_Z4_ENABLE
#define DISABLE_STEPPER_Z4() Z4_ENABLE_WRITE(!Z_ENABLE_ON)
#else
#define DISABLE_STEPPER_Z4() NOOP
#endif
#endif
// define the individual enables/disables #ifndef ENABLE_STEPPER_E0
#if AXIS_DRIVER_TYPE_E0(L6470) #if HAS_E0_ENABLE
extern L6470 stepperE0; #define ENABLE_STEPPER_E0() E0_ENABLE_WRITE( E_ENABLE_ON)
#define E0_enable() NOOP #else
#define E0_disable() do{ stepperE0.free(); CBI(axis_known_position, E_AXIS); }while(0) #define ENABLE_STEPPER_E0() NOOP
#elif HAS_E0_ENABLE #endif
#define E0_enable() E0_ENABLE_WRITE( E_ENABLE_ON) #endif
#define E0_disable() E0_ENABLE_WRITE(!E_ENABLE_ON) #ifndef DISABLE_STEPPER_E0
#else #if HAS_E0_ENABLE
#define E0_enable() NOOP #define DISABLE_STEPPER_E0() E0_ENABLE_WRITE(!E_ENABLE_ON)
#define E0_disable() NOOP #else
#define DISABLE_STEPPER_E0() NOOP
#endif
#endif #endif
#if AXIS_DRIVER_TYPE_E1(L6470) #ifndef ENABLE_STEPPER_E1
extern L6470 stepperE1; #if E_STEPPERS > 1 && HAS_E1_ENABLE
#define E1_enable() NOOP #define ENABLE_STEPPER_E1() E1_ENABLE_WRITE( E_ENABLE_ON)
#define E1_disable() do{ stepperE1.free(); CBI(axis_known_position, E_AXIS); }while(0) #else
#elif E_STEPPERS > 1 && HAS_E1_ENABLE #define ENABLE_STEPPER_E1() NOOP
#define E1_enable() E1_ENABLE_WRITE( E_ENABLE_ON) #endif
#define E1_disable() E1_ENABLE_WRITE(!E_ENABLE_ON) #endif
#else #ifndef DISABLE_STEPPER_E1
#define E1_enable() NOOP #if E_STEPPERS > 1 && HAS_E1_ENABLE
#define E1_disable() NOOP #define DISABLE_STEPPER_E1() E1_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define DISABLE_STEPPER_E1() NOOP
#endif
#endif #endif
#if AXIS_DRIVER_TYPE_E2(L6470) #ifndef ENABLE_STEPPER_E2
extern L6470 stepperE2; #if E_STEPPERS > 2 && HAS_E2_ENABLE
#define E2_enable() NOOP #define ENABLE_STEPPER_E2() E2_ENABLE_WRITE( E_ENABLE_ON)
#define E2_disable() do{ stepperE2.free(); CBI(axis_known_position, E_AXIS); }while(0) #else
#elif E_STEPPERS > 2 && HAS_E2_ENABLE #define ENABLE_STEPPER_E2() NOOP
#define E2_enable() E2_ENABLE_WRITE( E_ENABLE_ON) #endif
#define E2_disable() E2_ENABLE_WRITE(!E_ENABLE_ON) #endif
#else #ifndef DISABLE_STEPPER_E2
#define E2_enable() NOOP #if E_STEPPERS > 2 && HAS_E2_ENABLE
#define E2_disable() NOOP #define DISABLE_STEPPER_E2() E2_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define DISABLE_STEPPER_E2() NOOP
#endif
#endif #endif
#if AXIS_DRIVER_TYPE_E3(L6470) #ifndef ENABLE_STEPPER_E3
extern L6470 stepperE3; #if E_STEPPERS > 3 && HAS_E3_ENABLE
#define E3_enable() NOOP #define ENABLE_STEPPER_E3() E3_ENABLE_WRITE( E_ENABLE_ON)
#define E3_disable() do{ stepperE3.free(); CBI(axis_known_position, E_AXIS); }while(0) #else
#elif E_STEPPERS > 3 && HAS_E3_ENABLE #define ENABLE_STEPPER_E3() NOOP
#define E3_enable() E3_ENABLE_WRITE( E_ENABLE_ON) #endif
#define E3_disable() E3_ENABLE_WRITE(!E_ENABLE_ON) #endif
#else #ifndef DISABLE_STEPPER_E3
#define E3_enable() NOOP #if E_STEPPERS > 3 && HAS_E3_ENABLE
#define E3_disable() NOOP #define DISABLE_STEPPER_E3() E3_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define DISABLE_STEPPER_E3() NOOP
#endif
#endif #endif
#if AXIS_DRIVER_TYPE_E4(L6470) #ifndef ENABLE_STEPPER_E4
extern L6470 stepperE4; #if E_STEPPERS > 4 && HAS_E4_ENABLE
#define E4_enable() NOOP #define ENABLE_STEPPER_E4() E4_ENABLE_WRITE( E_ENABLE_ON)
#define E4_disable() do{ stepperE4.free(); CBI(axis_known_position, E_AXIS); }while(0) #else
#elif E_STEPPERS > 4 && HAS_E4_ENABLE #define ENABLE_STEPPER_E4() NOOP
#define E4_enable() E4_ENABLE_WRITE( E_ENABLE_ON) #endif
#define E4_disable() E4_ENABLE_WRITE(!E_ENABLE_ON) #endif
#else #ifndef DISABLE_STEPPER_E4
#define E4_enable() NOOP #if E_STEPPERS > 4 && HAS_E4_ENABLE
#define E4_disable() NOOP #define DISABLE_STEPPER_E4() E4_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define DISABLE_STEPPER_E4() NOOP
#endif
#endif #endif
#if AXIS_DRIVER_TYPE_E5(L6470) #ifndef ENABLE_STEPPER_E5
extern L6470 stepperE5; #if E_STEPPERS > 5 && HAS_E5_ENABLE
#define E5_enable() NOOP #define ENABLE_STEPPER_E5() E5_ENABLE_WRITE( E_ENABLE_ON)
#define E5_disable() do{ stepperE5.free(); CBI(axis_known_position, E_AXIS); }while(0) #else
#elif E_STEPPERS > 5 && HAS_E5_ENABLE #define ENABLE_STEPPER_E5() NOOP
#define E5_enable() E5_ENABLE_WRITE( E_ENABLE_ON) #endif
#define E5_disable() E5_ENABLE_WRITE(!E_ENABLE_ON) #endif
#else #ifndef DISABLE_STEPPER_E5
#define E5_enable() NOOP #if E_STEPPERS > 5 && HAS_E5_ENABLE
#define E5_disable() NOOP #define DISABLE_STEPPER_E5() E5_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define DISABLE_STEPPER_E5() NOOP
#endif
#endif #endif
#if AXIS_DRIVER_TYPE_E6(L6470) #ifndef ENABLE_STEPPER_E6
extern L6470 stepperE6; #if E_STEPPERS > 6 && HAS_E6_ENABLE
#define E6_enable() NOOP #define ENABLE_STEPPER_E6() E6_ENABLE_WRITE( E_ENABLE_ON)
#define E6_disable() do{ stepperE6.free(); CBI(axis_known_position, E_AXIS); }while(0) #else
#elif E_STEPPERS > 6 && HAS_E6_ENABLE #define ENABLE_STEPPER_E6() NOOP
#define E6_enable() E6_ENABLE_WRITE( E_ENABLE_ON) #endif
#define E6_disable() E6_ENABLE_WRITE(!E_ENABLE_ON) #endif
#else #ifndef DISABLE_STEPPER_E6
#define E6_enable() NOOP #if E_STEPPERS > 6 && HAS_E6_ENABLE
#define E6_disable() NOOP #define DISABLE_STEPPER_E6() E6_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define DISABLE_STEPPER_E6() NOOP
#endif
#endif #endif
#if AXIS_DRIVER_TYPE_E7(L6470) #ifndef ENABLE_STEPPER_E7
extern L6470 stepperE7; #if E_STEPPERS > 7 && HAS_E7_ENABLE
#define E7_enable() NOOP #define ENABLE_STEPPER_E7() E7_ENABLE_WRITE( E_ENABLE_ON)
#define E7_disable() do{ stepperE7.free(); CBI(axis_known_position, E_AXIS); }while(0) #else
#elif E_STEPPERS > 7 && HAS_E7_ENABLE #define ENABLE_STEPPER_E7() NOOP
#define E7_enable() E7_ENABLE_WRITE( E_ENABLE_ON) #endif
#define E7_disable() E7_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define E7_enable() NOOP
#define E7_disable() NOOP
#endif #endif
#ifndef DISABLE_STEPPER_E7
#if E_STEPPERS > 7 && HAS_E7_ENABLE
#define DISABLE_STEPPER_E7() E7_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define DISABLE_STEPPER_E7() NOOP
#endif
#endif
//
// Axis steppers enable / disable macros
//
#define ENABLE_AXIS_X() do{ ENABLE_STEPPER_X(); ENABLE_STEPPER_X2(); }while(0)
#define DISABLE_AXIS_X() do{ DISABLE_STEPPER_X(); DISABLE_STEPPER_X2(); CBI(axis_known_position, X_AXIS); }while(0)
#define ENABLE_AXIS_Y() do{ ENABLE_STEPPER_Y(); ENABLE_STEPPER_Y2(); }while(0)
#define DISABLE_AXIS_Y() do{ DISABLE_STEPPER_Y(); DISABLE_STEPPER_Y2(); CBI(axis_known_position, Y_AXIS); }while(0)
#define ENABLE_AXIS_Z() do{ ENABLE_STEPPER_Z(); ENABLE_STEPPER_Z2(); ENABLE_STEPPER_Z3(); ENABLE_STEPPER_Z4(); }while(0)
#define DISABLE_AXIS_Z() do{ DISABLE_STEPPER_Z(); DISABLE_STEPPER_Z2(); DISABLE_STEPPER_Z3(); DISABLE_STEPPER_Z4(); CBI(axis_known_position, Z_AXIS); }while(0)
//
// Extruder steppers enable / disable macros
//
#if ENABLED(MIXING_EXTRUDER) #if ENABLED(MIXING_EXTRUDER)
/** /**
* Mixing steppers synchronize their enable (and direction) together * Mixing steppers keep all their enable (and direction) states synchronized
*/ */
#if MIXING_STEPPERS > 7 #if MIXING_STEPPERS > 7
#define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); E5_enable(); E6_enable(); E7_enable(); } #define ENABLE_AXIS_E0() { ENABLE_STEPPER_E0(); ENABLE_STEPPER_E1(); ENABLE_STEPPER_E2(); ENABLE_STEPPER_E3(); ENABLE_STEPPER_E4(); ENABLE_STEPPER_E5(); ENABLE_STEPPER_E6(); ENABLE_STEPPER_E7(); }
#define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); E6_disable(); E7_disable(); } #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); DISABLE_STEPPER_E3(); DISABLE_STEPPER_E4(); DISABLE_STEPPER_E5(); DISABLE_STEPPER_E6(); DISABLE_STEPPER_E7(); }
#elif MIXING_STEPPERS > 6 #elif MIXING_STEPPERS > 6
#define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); E5_enable(); E6_enable(); } #define ENABLE_AXIS_E0() { ENABLE_STEPPER_E0(); ENABLE_STEPPER_E1(); ENABLE_STEPPER_E2(); ENABLE_STEPPER_E3(); ENABLE_STEPPER_E4(); ENABLE_STEPPER_E5(); ENABLE_STEPPER_E6(); }
#define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); E6_disable(); } #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); DISABLE_STEPPER_E3(); DISABLE_STEPPER_E4(); DISABLE_STEPPER_E5(); DISABLE_STEPPER_E6(); }
#elif MIXING_STEPPERS > 5 #elif MIXING_STEPPERS > 5
#define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); E5_enable(); } #define ENABLE_AXIS_E0() { ENABLE_STEPPER_E0(); ENABLE_STEPPER_E1(); ENABLE_STEPPER_E2(); ENABLE_STEPPER_E3(); ENABLE_STEPPER_E4(); ENABLE_STEPPER_E5(); }
#define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); } #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); DISABLE_STEPPER_E3(); DISABLE_STEPPER_E4(); DISABLE_STEPPER_E5(); }
#elif MIXING_STEPPERS > 4 #elif MIXING_STEPPERS > 4
#define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); } #define ENABLE_AXIS_E0() { ENABLE_STEPPER_E0(); ENABLE_STEPPER_E1(); ENABLE_STEPPER_E2(); ENABLE_STEPPER_E3(); ENABLE_STEPPER_E4(); }
#define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); } #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); DISABLE_STEPPER_E3(); DISABLE_STEPPER_E4(); }
#elif MIXING_STEPPERS > 3 #elif MIXING_STEPPERS > 3
#define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); } #define ENABLE_AXIS_E0() { ENABLE_STEPPER_E0(); ENABLE_STEPPER_E1(); ENABLE_STEPPER_E2(); ENABLE_STEPPER_E3(); }
#define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); } #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); DISABLE_STEPPER_E3(); }
#elif MIXING_STEPPERS > 2 #elif MIXING_STEPPERS > 2
#define enable_E0() { E0_enable(); E1_enable(); E2_enable(); } #define ENABLE_AXIS_E0() { ENABLE_STEPPER_E0(); ENABLE_STEPPER_E1(); ENABLE_STEPPER_E2(); }
#define disable_E0() { E0_disable(); E1_disable(); E2_disable(); } #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); }
#else #else
#define enable_E0() { E0_enable(); E1_enable(); } #define ENABLE_AXIS_E0() { ENABLE_STEPPER_E0(); ENABLE_STEPPER_E1(); }
#define disable_E0() { E0_disable(); E1_disable(); } #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); }
#endif #endif
#define enable_E1() NOOP
#define disable_E1() NOOP
#define enable_E2() NOOP
#define disable_E2() NOOP
#define enable_E3() NOOP
#define disable_E3() NOOP
#define enable_E4() NOOP
#define disable_E4() NOOP
#define enable_E5() NOOP
#define disable_E5() NOOP
#define enable_E6() NOOP
#define disable_E6() NOOP
#define enable_E7() NOOP
#define disable_E7() NOOP
#else // !MIXING_EXTRUDER
#if HAS_E0_ENABLE #endif // !MIXING_EXTRUDER
#define enable_E0() E0_enable()
#define disable_E0() E0_disable() #ifndef ENABLE_AXIS_E0
#if E_STEPPERS > 0 && HAS_E0_ENABLE
#define ENABLE_AXIS_E0() ENABLE_STEPPER_E0()
#else #else
#define enable_E0() NOOP #define ENABLE_AXIS_E0() NOOP
#define disable_E0() NOOP
#endif #endif
#endif
#ifndef DISABLE_AXIS_E0
#if E_STEPPERS > 0 && HAS_E0_DISABLE
#define DISABLE_AXIS_E0() DISABLE_STEPPER_E0()
#else
#define DISABLE_AXIS_E0() NOOP
#endif
#endif
#ifndef ENABLE_AXIS_E1
#if E_STEPPERS > 1 && HAS_E1_ENABLE #if E_STEPPERS > 1 && HAS_E1_ENABLE
#define enable_E1() E1_enable() #define ENABLE_AXIS_E1() ENABLE_STEPPER_E1()
#define disable_E1() E1_disable()
#else #else
#define enable_E1() NOOP #define ENABLE_AXIS_E1() NOOP
#define disable_E1() NOOP
#endif #endif
#endif
#ifndef DISABLE_AXIS_E1
#if E_STEPPERS > 1 && HAS_E1_DISABLE
#define DISABLE_AXIS_E1() DISABLE_STEPPER_E1()
#else
#define DISABLE_AXIS_E1() NOOP
#endif
#endif
#ifndef ENABLE_AXIS_E2
#if E_STEPPERS > 2 && HAS_E2_ENABLE #if E_STEPPERS > 2 && HAS_E2_ENABLE
#define enable_E2() E2_enable() #define ENABLE_AXIS_E2() ENABLE_STEPPER_E2()
#define disable_E2() E2_disable() #else
#define ENABLE_AXIS_E2() NOOP
#endif
#endif
#ifndef DISABLE_AXIS_E2
#if E_STEPPERS > 2 && HAS_E2_DISABLE
#define DISABLE_AXIS_E2() DISABLE_STEPPER_E2()
#else #else
#define enable_E2() NOOP #define DISABLE_AXIS_E2() NOOP
#define disable_E2() NOOP
#endif #endif
#endif
#ifndef ENABLE_AXIS_E3
#if E_STEPPERS > 3 && HAS_E3_ENABLE #if E_STEPPERS > 3 && HAS_E3_ENABLE
#define enable_E3() E3_enable() #define ENABLE_AXIS_E3() ENABLE_STEPPER_E3()
#define disable_E3() E3_disable()
#else #else
#define enable_E3() NOOP #define ENABLE_AXIS_E3() NOOP
#define disable_E3() NOOP
#endif #endif
#endif
#ifndef DISABLE_AXIS_E3
#if E_STEPPERS > 3 && HAS_E3_DISABLE
#define DISABLE_AXIS_E3() DISABLE_STEPPER_E3()
#else
#define DISABLE_AXIS_E3() NOOP
#endif
#endif
#ifndef ENABLE_AXIS_E4
#if E_STEPPERS > 4 && HAS_E4_ENABLE #if E_STEPPERS > 4 && HAS_E4_ENABLE
#define enable_E4() E4_enable() #define ENABLE_AXIS_E4() ENABLE_STEPPER_E4()
#define disable_E4() E4_disable() #else
#define ENABLE_AXIS_E4() NOOP
#endif
#endif
#ifndef DISABLE_AXIS_E4
#if E_STEPPERS > 4 && HAS_E4_DISABLE
#define DISABLE_AXIS_E4() DISABLE_STEPPER_E4()
#else #else
#define enable_E4() NOOP #define DISABLE_AXIS_E4() NOOP
#define disable_E4() NOOP
#endif #endif
#endif
#ifndef ENABLE_AXIS_E5
#if E_STEPPERS > 5 && HAS_E5_ENABLE #if E_STEPPERS > 5 && HAS_E5_ENABLE
#define enable_E5() E5_enable() #define ENABLE_AXIS_E5() ENABLE_STEPPER_E5()
#define disable_E5() E5_disable()
#else #else
#define enable_E5() NOOP #define ENABLE_AXIS_E5() NOOP
#define disable_E5() NOOP
#endif #endif
#endif
#ifndef DISABLE_AXIS_E5
#if E_STEPPERS > 5 && HAS_E5_DISABLE
#define DISABLE_AXIS_E5() DISABLE_STEPPER_E5()
#else
#define DISABLE_AXIS_E5() NOOP
#endif
#endif
#ifndef ENABLE_AXIS_E6
#if E_STEPPERS > 6 && HAS_E6_ENABLE #if E_STEPPERS > 6 && HAS_E6_ENABLE
#define enable_E6() E6_enable() #define ENABLE_AXIS_E6() ENABLE_STEPPER_E6()
#define disable_E6() E6_disable()
#else #else
#define enable_E6() NOOP #define ENABLE_AXIS_E6() NOOP
#define disable_E6() NOOP
#endif #endif
#endif
#ifndef DISABLE_AXIS_E6
#if E_STEPPERS > 6 && HAS_E6_DISABLE
#define DISABLE_AXIS_E6() DISABLE_STEPPER_E6()
#else
#define DISABLE_AXIS_E6() NOOP
#endif
#endif
#ifndef ENABLE_AXIS_E7
#if E_STEPPERS > 7 && HAS_E7_ENABLE #if E_STEPPERS > 7 && HAS_E7_ENABLE
#define enable_E7() E7_enable() #define ENABLE_AXIS_E7() ENABLE_STEPPER_E7()
#define disable_E7() E7_disable()
#else #else
#define enable_E7() NOOP #define ENABLE_AXIS_E7() NOOP
#define disable_E7() NOOP
#endif #endif
#endif
#endif // !MIXING_EXTRUDER #ifndef DISABLE_AXIS_E7
#if E_STEPPERS > 7 && HAS_E7_DISABLE
#define DISABLE_AXIS_E7() DISABLE_STEPPER_E7()
#else
#define DISABLE_AXIS_E7() NOOP
#endif
#endif

@ -220,10 +220,10 @@ Temperature thermalManager;
#endif // FAN_COUNT > 0 #endif // FAN_COUNT > 0
#if WATCH_HOTENDS #if WATCH_HOTENDS
heater_watch_t Temperature::watch_hotend[HOTENDS]; // = { { 0 } } hotend_watch_t Temperature::watch_hotend[HOTENDS]; // = { { 0 } }
#endif #endif
#if HEATER_IDLE_HANDLER #if HEATER_IDLE_HANDLER
heater_idle_t Temperature::hotend_idle[HOTENDS]; // = { { 0 } } hotend_idle_t Temperature::hotend_idle[HOTENDS]; // = { { 0 } }
#endif #endif
#if HAS_HEATED_BED #if HAS_HEATED_BED
@ -236,13 +236,13 @@ Temperature thermalManager;
int16_t Temperature::maxtemp_raw_BED = HEATER_BED_RAW_HI_TEMP; int16_t Temperature::maxtemp_raw_BED = HEATER_BED_RAW_HI_TEMP;
#endif #endif
#if WATCH_BED #if WATCH_BED
heater_watch_t Temperature::watch_bed; // = { 0 } bed_watch_t Temperature::watch_bed; // = { 0 }
#endif #endif
#if DISABLED(PIDTEMPBED) #if DISABLED(PIDTEMPBED)
millis_t Temperature::next_bed_check_ms; millis_t Temperature::next_bed_check_ms;
#endif #endif
#if HEATER_IDLE_HANDLER #if HEATER_IDLE_HANDLER
heater_idle_t Temperature::bed_idle; // = { 0 } hotend_idle_t Temperature::bed_idle; // = { 0 }
#endif #endif
#endif // HAS_HEATED_BED #endif // HAS_HEATED_BED
@ -256,7 +256,7 @@ Temperature thermalManager;
int16_t Temperature::maxtemp_raw_CHAMBER = HEATER_CHAMBER_RAW_HI_TEMP; int16_t Temperature::maxtemp_raw_CHAMBER = HEATER_CHAMBER_RAW_HI_TEMP;
#endif #endif
#if WATCH_CHAMBER #if WATCH_CHAMBER
heater_watch_t Temperature::watch_chamber{0}; chamber_watch_t Temperature::watch_chamber{0};
#endif #endif
millis_t Temperature::next_chamber_check_ms; millis_t Temperature::next_chamber_check_ms;
#endif // HAS_HEATED_CHAMBER #endif // HAS_HEATED_CHAMBER
@ -1974,12 +1974,7 @@ void Temperature::init() {
*/ */
void Temperature::start_watching_hotend(const uint8_t E_NAME) { void Temperature::start_watching_hotend(const uint8_t E_NAME) {
const uint8_t ee = HOTEND_INDEX; const uint8_t ee = HOTEND_INDEX;
if (degTargetHotend(ee) && degHotend(ee) < degTargetHotend(ee) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) { watch_hotend[ee].restart(degHotend(ee), degTargetHotend(ee));
watch_hotend[ee].target = degHotend(ee) + WATCH_TEMP_INCREASE;
watch_hotend[ee].next_ms = millis() + (WATCH_TEMP_PERIOD) * 1000UL;
}
else
watch_hotend[ee].next_ms = 0;
} }
#endif #endif
@ -1990,12 +1985,7 @@ void Temperature::init() {
* This is called when the temperature is set. (M140, M190) * This is called when the temperature is set. (M140, M190)
*/ */
void Temperature::start_watching_bed() { void Temperature::start_watching_bed() {
if (degTargetBed() && degBed() < degTargetBed() - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) { watch_bed.restart(degBed(), degTargetBed());
watch_bed.target = degBed() + WATCH_BED_TEMP_INCREASE;
watch_bed.next_ms = millis() + (WATCH_BED_TEMP_PERIOD) * 1000UL;
}
else
watch_bed.next_ms = 0;
} }
#endif #endif
@ -2006,12 +1996,7 @@ void Temperature::init() {
* This is called when the temperature is set. (M141, M191) * This is called when the temperature is set. (M141, M191)
*/ */
void Temperature::start_watching_chamber() { void Temperature::start_watching_chamber() {
if (degChamber() < degTargetChamber() - (WATCH_CHAMBER_TEMP_INCREASE + TEMP_CHAMBER_HYSTERESIS + 1)) { watch_chamber.restart(degChamber(), degTargetChamber());
watch_chamber.target = degChamber() + WATCH_CHAMBER_TEMP_INCREASE;
watch_chamber.next_ms = millis() + (WATCH_CHAMBER_TEMP_PERIOD) * 1000UL;
}
else
watch_chamber.next_ms = 0;
} }
#endif #endif
@ -2154,6 +2139,34 @@ void Temperature::disable_all_heaters() {
#endif #endif
} }
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
bool Temperature::over_autostart_threshold() {
#if HOTENDS
HOTEND_LOOP() if (degTargetHotend(e) < (EXTRUDE_MINTEMP) / 2) return true;
#endif
#if HAS_HEATED_BED
if (degTargetBed() > BED_MINTEMP) return true;
#endif
#if HAS_HEATED_CHAMBER
if (degTargetChamber() > CHAMBER_MINTEMP) return true;
#endif
return false;
}
void Temperature::check_timer_autostart(const bool can_start, const bool can_stop) {
if (over_autostart_threshold()) {
if (can_start) startOrResumeJob();
}
else if (can_stop) {
print_job_timer.stop();
ui.reset_status();
}
}
#endif
#if ENABLED(PROBING_HEATERS_OFF) #if ENABLED(PROBING_HEATERS_OFF)
void Temperature::pause(const bool p) { void Temperature::pause(const bool p) {
@ -2166,7 +2179,7 @@ void Temperature::disable_all_heaters() {
#endif #endif
} }
else { else {
HOTEND_LOOP() reset_heater_idle_timer(e); HOTEND_LOOP() reset_hotend_idle_timer(e);
#if HAS_HEATED_BED #if HAS_HEATED_BED
reset_bed_idle_timer(); reset_bed_idle_timer();
#endif #endif

@ -228,15 +228,38 @@ typedef struct {
inline void start(const millis_t &ms) { timeout_ms = millis() + ms; timed_out = false; } inline void start(const millis_t &ms) { timeout_ms = millis() + ms; timed_out = false; }
inline void reset() { timeout_ms = 0; timed_out = false; } inline void reset() { timeout_ms = 0; timed_out = false; }
inline void expire() { start(0); } inline void expire() { start(0); }
} heater_idle_t; } hotend_idle_t;
// Heater watch handling // Heater watch handling
typedef struct { template <int INCREASE, int HYSTERESIS, millis_t PERIOD>
struct HeaterWatch {
uint16_t target; uint16_t target;
millis_t next_ms; millis_t next_ms;
inline bool elapsed(const millis_t &ms) { return next_ms && ELAPSED(ms, next_ms); } inline bool elapsed(const millis_t &ms) { return next_ms && ELAPSED(ms, next_ms); }
inline bool elapsed() { return elapsed(millis()); } inline bool elapsed() { return elapsed(millis()); }
} heater_watch_t;
inline void restart(const int16_t curr, const int16_t tgt) {
if (tgt) {
const int16_t newtarget = curr + INCREASE;
if (newtarget < tgt - HYSTERESIS - 1) {
target = newtarget;
next_ms = millis() + PERIOD * 1000UL;
return;
}
}
next_ms = 0;
}
};
#if WATCH_HOTENDS
typedef struct HeaterWatch<WATCH_TEMP_INCREASE, TEMP_HYSTERESIS, WATCH_TEMP_PERIOD> hotend_watch_t;
#endif
#if WATCH_BED
typedef struct HeaterWatch<WATCH_BED_TEMP_INCREASE, TEMP_BED_HYSTERESIS, WATCH_BED_TEMP_PERIOD> bed_watch_t;
#endif
#if WATCH_CHAMBER
typedef struct HeaterWatch<WATCH_CHAMBER_TEMP_INCREASE, TEMP_CHAMBER_HYSTERESIS, WATCH_CHAMBER_TEMP_PERIOD> chamber_watch_t;
#endif
// Temperature sensor read value ranges // Temperature sensor read value ranges
typedef struct { int16_t raw_min, raw_max; } raw_range_t; typedef struct { int16_t raw_min, raw_max; } raw_range_t;
@ -345,12 +368,12 @@ class Temperature {
FORCE_INLINE static bool targetHotEnoughToExtrude(const uint8_t e) { return !targetTooColdToExtrude(e); } FORCE_INLINE static bool targetHotEnoughToExtrude(const uint8_t e) { return !targetTooColdToExtrude(e); }
#if HEATER_IDLE_HANDLER #if HEATER_IDLE_HANDLER
static heater_idle_t hotend_idle[HOTENDS]; static hotend_idle_t hotend_idle[HOTENDS];
#if HAS_HEATED_BED #if HAS_HEATED_BED
static heater_idle_t bed_idle; static hotend_idle_t bed_idle;
#endif #endif
#if HAS_HEATED_CHAMBER #if HAS_HEATED_CHAMBER
static heater_idle_t chamber_idle; static hotend_idle_t chamber_idle;
#endif #endif
#endif #endif
@ -363,7 +386,7 @@ class Temperature {
static volatile bool raw_temps_ready; static volatile bool raw_temps_ready;
#if WATCH_HOTENDS #if WATCH_HOTENDS
static heater_watch_t watch_hotend[HOTENDS]; static hotend_watch_t watch_hotend[HOTENDS];
#endif #endif
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
@ -382,7 +405,7 @@ class Temperature {
#if HAS_HEATED_BED #if HAS_HEATED_BED
#if WATCH_BED #if WATCH_BED
static heater_watch_t watch_bed; static bed_watch_t watch_bed;
#endif #endif
#if DISABLED(PIDTEMPBED) #if DISABLED(PIDTEMPBED)
static millis_t next_bed_check_ms; static millis_t next_bed_check_ms;
@ -397,7 +420,7 @@ class Temperature {
#if HAS_HEATED_CHAMBER #if HAS_HEATED_CHAMBER
#if WATCH_CHAMBER #if WATCH_CHAMBER
static heater_watch_t watch_chamber; static chamber_watch_t watch_chamber;
#endif #endif
static millis_t next_chamber_check_ms; static millis_t next_chamber_check_ms;
#ifdef CHAMBER_MINTEMP #ifdef CHAMBER_MINTEMP
@ -736,6 +759,14 @@ class Temperature {
*/ */
static void disable_all_heaters(); static void disable_all_heaters();
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
/**
* Methods to check if heaters are enabled, indicating an active job
*/
static bool over_autostart_threshold();
static void check_timer_autostart(const bool can_start, const bool can_stop);
#endif
/** /**
* Perform auto-tuning for hotend or bed in response to M303 * Perform auto-tuning for hotend or bed in response to M303
*/ */
@ -768,7 +799,7 @@ class Temperature {
#if HEATER_IDLE_HANDLER #if HEATER_IDLE_HANDLER
static void reset_heater_idle_timer(const uint8_t E_NAME) { static void reset_hotend_idle_timer(const uint8_t E_NAME) {
hotend_idle[HOTEND_INDEX].reset(); hotend_idle[HOTEND_INDEX].reset();
start_watching_hotend(HOTEND_INDEX); start_watching_hotend(HOTEND_INDEX);
} }

@ -0,0 +1,77 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#define REVERSE_TEMP_SENSOR_RANGE
#undef OV_SCALE
#define OV_SCALE(N) (float((N) * 5) / 3.3f)
// Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics"
const short temptable_21[][2] PROGMEM = {
{ OV( 0), 0 },
{ OV(227), 1 },
{ OV(236), 10 },
{ OV(245), 20 },
{ OV(253), 30 },
{ OV(262), 40 },
{ OV(270), 50 },
{ OV(279), 60 },
{ OV(287), 70 },
{ OV(295), 80 },
{ OV(304), 90 },
{ OV(312), 100 },
{ OV(320), 110 },
{ OV(329), 120 },
{ OV(337), 130 },
{ OV(345), 140 },
{ OV(353), 150 },
{ OV(361), 160 },
{ OV(369), 170 },
{ OV(377), 180 },
{ OV(385), 190 },
{ OV(393), 200 },
{ OV(401), 210 },
{ OV(409), 220 },
{ OV(417), 230 },
{ OV(424), 240 },
{ OV(432), 250 },
{ OV(440), 260 },
{ OV(447), 270 },
{ OV(455), 280 },
{ OV(463), 290 },
{ OV(470), 300 },
{ OV(478), 310 },
{ OV(485), 320 },
{ OV(493), 330 },
{ OV(500), 340 },
{ OV(507), 350 },
{ OV(515), 360 },
{ OV(522), 370 },
{ OV(529), 380 },
{ OV(537), 390 },
{ OV(544), 400 },
{ OV(614), 500 }
};
#undef OV_SCALE
#define OV_SCALE(N) (N)

@ -37,7 +37,8 @@
#error "MAX_RAW_THERMISTOR_VALUE is too large for int16_t. Reduce OVERSAMPLENR or HAL_ADC_RESOLUTION." #error "MAX_RAW_THERMISTOR_VALUE is too large for int16_t. Reduce OVERSAMPLENR or HAL_ADC_RESOLUTION."
#endif #endif
#define OV(N) int16_t((N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE)) #define OV_SCALE(N) (N)
#define OV(N) int16_t(OV_SCALE(N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE))
#define ANY_THERMISTOR_IS(n) (THERMISTOR_HEATER_0 == n || THERMISTOR_HEATER_1 == n || THERMISTOR_HEATER_2 == n || THERMISTOR_HEATER_3 == n || THERMISTOR_HEATER_4 == n || THERMISTOR_HEATER_5 == n || THERMISTOR_HEATER_6 == n || THERMISTOR_HEATER_7 == n || THERMISTORBED == n || THERMISTORCHAMBER == n || THERMISTORPROBE == n) #define ANY_THERMISTOR_IS(n) (THERMISTOR_HEATER_0 == n || THERMISTOR_HEATER_1 == n || THERMISTOR_HEATER_2 == n || THERMISTOR_HEATER_3 == n || THERMISTOR_HEATER_4 == n || THERMISTOR_HEATER_5 == n || THERMISTOR_HEATER_6 == n || THERMISTOR_HEATER_7 == n || THERMISTORBED == n || THERMISTORCHAMBER == n || THERMISTORPROBE == n)
@ -105,6 +106,9 @@
#if ANY_THERMISTOR_IS(20) // Pt100 with INA826 amp on Ultimaker v2.0 electronics #if ANY_THERMISTOR_IS(20) // Pt100 with INA826 amp on Ultimaker v2.0 electronics
#include "thermistor_20.h" #include "thermistor_20.h"
#endif #endif
#if ANY_THERMISTOR_IS(21) // Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics"
#include "thermistor_21.h"
#endif
#if ANY_THERMISTOR_IS(51) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 1 kOhm, "EPCOS" #if ANY_THERMISTOR_IS(51) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 1 kOhm, "EPCOS"
#include "thermistor_51.h" #include "thermistor_51.h"
#endif #endif

@ -822,7 +822,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
} }
#if HAS_LCD_MENU #if HAS_LCD_MENU
ui.return_to_status(); if (!no_move) ui.return_to_status();
#endif #endif
#if ENABLED(DUAL_X_CARRIAGE) #if ENABLED(DUAL_X_CARRIAGE)

@ -0,0 +1,90 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* E4d@Box pin assignments
* E4d@Box is a small factor 3D printer control board based on the ESP32 microcontroller for Laser, CNC and 3d printers
* for more info check http://atbox.tech/ and join to Facebook page E4d@box.
*/
#ifndef ARDUINO_ARCH_ESP32
#error "Oops! Select an ESP32 board in 'Tools > Board.'"
#elif EXTRUDERS > 1 || E_STEPPERS > 1
#error "E4d@box only supports one E Stepper. Comment out this line to continue."
#elif HOTENDS > 2
#error "E4d@box currently supports only one hotend. Comment out this line to continue."
#endif
#define BOARD_INFO_NAME "E4D@BOX"
#define BOARD_WEBSITE_URL "github.com/Exilaus/E4d@box"
#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME
//
// Limit Switches
//
#define X_MIN_PIN 34
#define Y_MIN_PIN 35
#define Z_MIN_PIN 16 // 15
//
// Steppers
//
#define X_STEP_PIN 12 // 34//27
#define X_DIR_PIN 13 // 35//26
#define X_ENABLE_PIN 17 // 0//17//25 // used free pin
//#define X_CS_PIN 0
#define Y_STEP_PIN 32 // 33
#define Y_DIR_PIN 33 // 32
#define Y_ENABLE_PIN X_ENABLE_PIN
//#define Y_CS_PIN 13
#define Z_STEP_PIN 25 // 14
#define Z_DIR_PIN 26 // 12
#define Z_ENABLE_PIN X_ENABLE_PIN
//#define Z_CS_PIN 5 // SS_PIN
#define E0_STEP_PIN 27 // 16
#define E0_DIR_PIN 14 // 17
#define E0_ENABLE_PIN X_ENABLE_PIN
//#define E0_CS_PIN 21
//
// Temperature Sensors
//
#define TEMP_0_PIN 36 // Analog Input
#define TEMP_BED_PIN 39 // Analog Input
//
// Heaters / Fans
//
#define HEATER_0_PIN 2 // 4//2//(D8)
#define FAN_PIN 0 // 2//15//13 (D9)
#define HEATER_BED_PIN 15 // 15//0 //(D10)
// SPI
#define SDSS 5
#define I2S_STEPPER_STREAM
#define I2S_WS 23
#define I2S_BCK 22
#define I2S_DATA 21

@ -363,6 +363,24 @@
#ifndef E4_SERIAL_RX_PIN #ifndef E4_SERIAL_RX_PIN
#define E4_SERIAL_RX_PIN -1 #define E4_SERIAL_RX_PIN -1
#endif #endif
#ifndef E5_SERIAL_TX_PIN
#define E5_SERIAL_TX_PIN -1
#endif
#ifndef E5_SERIAL_RX_PIN
#define E5_SERIAL_RX_PIN -1
#endif
#ifndef E6_SERIAL_TX_PIN
#define E6_SERIAL_TX_PIN -1
#endif
#ifndef E6_SERIAL_RX_PIN
#define E6_SERIAL_RX_PIN -1
#endif
#ifndef E7_SERIAL_TX_PIN
#define E7_SERIAL_TX_PIN -1
#endif
#ifndef E7_SERIAL_RX_PIN
#define E7_SERIAL_RX_PIN -1
#endif
#endif #endif
////////////////////////// //////////////////////////

@ -23,33 +23,52 @@
#define BOARD_INFO_NAME "BIGTREE SKR 1.3" #define BOARD_INFO_NAME "BIGTREE SKR 1.3"
/**
* Trinamic Stallguard pins
*/
#define X_DIAG_PIN P1_29 // X-
#define Y_DIAG_PIN P1_27 // Y-
#define Z_DIAG_PIN P1_25 // Z-
#define E0_DIAG_PIN P1_28 // X+
#define E1_DIAG_PIN P1_26 // Y+
/** /**
* Limit Switches * Limit Switches
*/ */
#if X_HOME_DIR > 0 && X_STALL_SENSITIVITY && !defined(USE_XMAX_PLUG) #if X_STALL_SENSITIVITY
// For StallGuard homing to MAX swap the MIN / MAX pins #define X_STOP_PIN X_DIAG_PIN
// so the MAX physical connectors may be used for other things. #if X_HOME_DIR < 0
#define X_MIN_PIN P1_28 // X_MAX (free) #define X_MAX_PIN P1_28 // X+
#define X_MAX_PIN P1_29 // X_MIN #else
#else // else, non-endstop is free and appears in M43 output #define X_MIN_PIN P1_28 // X+
#define X_MIN_PIN P1_29 // X_MIN #endif
#define X_MAX_PIN P1_28 // X_MAX #else
#define X_MIN_PIN P1_29 // X-
#define X_MAX_PIN P1_28 // X+
#endif #endif
#if Y_HOME_DIR > 0 && Y_STALL_SENSITIVITY && !defined(USE_YMAX_PLUG) #if Y_STALL_SENSITIVITY
#define Y_MIN_PIN P1_26 // Y_MAX (free) #define Y_STOP_PIN Y_DIAG_PIN
#define Y_MAX_PIN P1_27 // Y_MIN #if Y_HOME_DIR < 0
#define Y_MAX_PIN P1_26 // Y+
#else
#define Y_MIN_PIN P1_26 // Y+
#endif
#else #else
#define Y_MIN_PIN P1_27 // Y_MIN #define Y_MIN_PIN P1_27 // Y-
#define Y_MAX_PIN P1_26 // Y_MAX #define Y_MAX_PIN P1_26 // Y+
#endif #endif
#if Z_HOME_DIR > 0 && Z_STALL_SENSITIVITY && !defined(USE_ZMAX_PLUG) #if Z_STALL_SENSITIVITY
#define Z_MIN_PIN P1_24 // Z_MAX (free) #define Z_STOP_PIN Z_DIAG_PIN
#define Z_MAX_PIN P1_25 // Z_MIN #if Z_HOME_DIR < 0
#define Z_MAX_PIN P1_24 // Z+
#else
#define Z_MIN_PIN P1_24 // Z+
#endif
#else #else
#define Z_MIN_PIN P1_25 // Z_MIN #define Z_MIN_PIN P1_25 // Z-
#define Z_MAX_PIN P1_24 // Z_MAX #define Z_MAX_PIN P1_24 // Z+
#endif #endif
#define ONBOARD_ENDSTOPPULLUPS // Board has built-in pullups #define ONBOARD_ENDSTOPPULLUPS // Board has built-in pullups
@ -162,9 +181,6 @@
#define E1_SERIAL_TX_PIN P1_04 #define E1_SERIAL_TX_PIN P1_04
#define E1_SERIAL_RX_PIN P1_01 #define E1_SERIAL_RX_PIN P1_01
#define Z2_SERIAL_TX_PIN P1_04
#define Z2_SERIAL_RX_PIN P1_01
// Reduce baud rate to improve software serial reliability // Reduce baud rate to improve software serial reliability
#define TMC_BAUD_RATE 19200 #define TMC_BAUD_RATE 19200
#endif #endif

@ -37,12 +37,50 @@
// //
#define SERVO0_PIN P2_00 #define SERVO0_PIN P2_00
//
// TMC StallGuard DIAG pins
//
#define X_DIAG_PIN P1_29 // X-STOP
#define Y_DIAG_PIN P1_28 // Y-STOP
#define Z_DIAG_PIN P1_27 // Z-STOP
#define E0_DIAG_PIN P1_26 // E0DET
#define E1_DIAG_PIN P1_25 // E1DET
// //
// Limit Switches // Limit Switches
// //
#define X_STOP_PIN P1_29 #if X_STALL_SENSITIVITY
#define Y_STOP_PIN P1_28 #define X_STOP_PIN X_DIAG_PIN
#define Z_STOP_PIN P1_27 #if X_HOME_DIR < 0
#define X_MAX_PIN P1_26 // E0DET
#else
#define X_MIN_PIN P1_26 // E0DET
#endif
#else
#define X_STOP_PIN P1_29 // X-STOP
#endif
#if Y_STALL_SENSITIVITY
#define Y_STOP_PIN Y_DIAG_PIN
#if Y_HOME_DIR < 0
#define Y_MAX_PIN P1_25 // E1DET
#else
#define Y_MIN_PIN P1_25 // E1DET
#endif
#else
#define Y_STOP_PIN P1_28 // Y-STOP
#endif
#if Z_STALL_SENSITIVITY
#define Z_STOP_PIN Z_DIAG_PIN
#if Z_HOME_DIR < 0
#define Z_MAX_PIN P1_24 // PWRDET
#else
#define Z_MIN_PIN P1_24 // PWRDET
#endif
#else
#define Z_STOP_PIN P1_27 // Z-STOP
#endif
// //
// Z Probe (when not Z_MIN_PIN) // Z Probe (when not Z_MIN_PIN)
@ -54,21 +92,21 @@
// //
// Filament Runout Sensor // Filament Runout Sensor
// //
#define FIL_RUNOUT_PIN P1_26 #define FIL_RUNOUT_PIN P1_26 // E0DET
#define FIL_RUNOUT2_PIN P1_25 #define FIL_RUNOUT2_PIN P1_25 // E1DET
// //
// Power Supply Control // Power Supply Control
// //
#ifndef PS_ON_PIN #ifndef PS_ON_PIN
#define PS_ON_PIN P1_00 #define PS_ON_PIN P1_00 // PWRDET
#endif #endif
// //
// Power Loss Detection // Power Loss Detection
// //
#ifndef POWER_LOSS_PIN #ifndef POWER_LOSS_PIN
#define POWER_LOSS_PIN P1_00 #define POWER_LOSS_PIN P1_00 // PWRDET
#endif #endif
// //

@ -571,6 +571,8 @@
#include "esp32/pins_MRR_ESPA.h" // ESP32 env:esp32 #include "esp32/pins_MRR_ESPA.h" // ESP32 env:esp32
#elif MB(MRR_ESPE) #elif MB(MRR_ESPE)
#include "esp32/pins_MRR_ESPE.h" // ESP32 env:esp32 #include "esp32/pins_MRR_ESPE.h" // ESP32 env:esp32
#elif MB(E4D_BOX)
#include "esp32/pins_E4D.h" // ESP32 env:esp32
// //
// Linux Native Debug board // Linux Native Debug board
@ -1024,10 +1026,14 @@
#ifdef X_STOP_PIN #ifdef X_STOP_PIN
#if X_HOME_DIR < 0 #if X_HOME_DIR < 0
#define X_MIN_PIN X_STOP_PIN #define X_MIN_PIN X_STOP_PIN
#ifndef X_MAX_PIN
#define X_MAX_PIN -1 #define X_MAX_PIN -1
#endif
#else #else
#define X_MIN_PIN -1
#define X_MAX_PIN X_STOP_PIN #define X_MAX_PIN X_STOP_PIN
#ifndef X_MIN_PIN
#define X_MIN_PIN -1
#endif
#endif #endif
#elif X_HOME_DIR < 0 #elif X_HOME_DIR < 0
#define X_STOP_PIN X_MIN_PIN #define X_STOP_PIN X_MIN_PIN
@ -1038,10 +1044,14 @@
#ifdef Y_STOP_PIN #ifdef Y_STOP_PIN
#if Y_HOME_DIR < 0 #if Y_HOME_DIR < 0
#define Y_MIN_PIN Y_STOP_PIN #define Y_MIN_PIN Y_STOP_PIN
#ifndef Y_MAX_PIN
#define Y_MAX_PIN -1 #define Y_MAX_PIN -1
#endif
#else #else
#define Y_MIN_PIN -1
#define Y_MAX_PIN Y_STOP_PIN #define Y_MAX_PIN Y_STOP_PIN
#ifndef Y_MIN_PIN
#define Y_MIN_PIN -1
#endif
#endif #endif
#elif Y_HOME_DIR < 0 #elif Y_HOME_DIR < 0
#define Y_STOP_PIN Y_MIN_PIN #define Y_STOP_PIN Y_MIN_PIN
@ -1052,10 +1062,14 @@
#ifdef Z_STOP_PIN #ifdef Z_STOP_PIN
#if Z_HOME_DIR < 0 #if Z_HOME_DIR < 0
#define Z_MIN_PIN Z_STOP_PIN #define Z_MIN_PIN Z_STOP_PIN
#ifndef Z_MAX_PIN
#define Z_MAX_PIN -1 #define Z_MAX_PIN -1
#endif
#else #else
#define Z_MIN_PIN -1
#define Z_MAX_PIN Z_STOP_PIN #define Z_MAX_PIN Z_STOP_PIN
#ifndef Z_MIN_PIN
#define Z_MIN_PIN -1
#endif
#endif #endif
#elif Z_HOME_DIR < 0 #elif Z_HOME_DIR < 0
#define Z_STOP_PIN Z_MIN_PIN #define Z_STOP_PIN Z_MIN_PIN
@ -1125,42 +1139,72 @@
* overridden in Configuration.h or Configuration_adv.h. * overridden in Configuration.h or Configuration_adv.h.
*/ */
#define __PEXI(p,q) PIN_EXISTS(E##p##_##q)
#define _PEXI(p,q) __PEXI(p,q)
#define __EPIN(p,q) E##p##_##q##_PIN #define __EPIN(p,q) E##p##_##q##_PIN
#define _EPIN(p,q) __EPIN(p,q) #define _EPIN(p,q) __EPIN(p,q)
#define DIAG_REMAPPED(p,q) (PIN_EXISTS(q) && _EPIN(p##_E_INDEX, DIAG) == q##_PIN)
// The X2 axis, if any, should be the next open extruder port // The X2 axis, if any, should be the next open extruder port
#define X2_E_INDEX E_STEPPERS
#if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS) #if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
#ifndef X2_STEP_PIN #ifndef X2_STEP_PIN
#define X2_STEP_PIN _EPIN(E_STEPPERS, STEP) #define X2_STEP_PIN _EPIN(X2_E_INDEX, STEP)
#define X2_DIR_PIN _EPIN(E_STEPPERS, DIR) #define X2_DIR_PIN _EPIN(X2_E_INDEX, DIR)
#define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE) #define X2_ENABLE_PIN _EPIN(X2_E_INDEX, ENABLE)
#if E_STEPPERS >= MAX_EXTRUDERS || !PIN_EXISTS(X2_STEP) #if X2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(X2_STEP)
#error "No E stepper plug left for X2!" #error "No E stepper plug left for X2!"
#endif #endif
#endif #endif
#ifndef X2_MS1_PIN #ifndef X2_MS1_PIN
#define X2_MS1_PIN _EPIN(E_STEPPERS, MS1) #define X2_MS1_PIN _EPIN(X2_E_INDEX, MS1)
#endif #endif
#ifndef X2_MS2_PIN #ifndef X2_MS2_PIN
#define X2_MS2_PIN _EPIN(E_STEPPERS, MS2) #define X2_MS2_PIN _EPIN(X2_E_INDEX, MS2)
#endif #endif
#ifndef X2_MS3_PIN #ifndef X2_MS3_PIN
#define X2_MS3_PIN _EPIN(E_STEPPERS, MS3) #define X2_MS3_PIN _EPIN(X2_E_INDEX, MS3)
#endif #endif
#if AXIS_HAS_SPI(X2) && !defined(X2_CS_PIN) #if AXIS_HAS_SPI(X2) && !defined(X2_CS_PIN)
#define X2_CS_PIN _EPIN(E_STEPPERS, CS) #define X2_CS_PIN _EPIN(X2_E_INDEX, CS)
#endif #endif
#if AXIS_HAS_UART(X2) #if AXIS_HAS_UART(X2)
#ifndef X2_SERIAL_TX_PIN #ifndef X2_SERIAL_TX_PIN
#define X2_SERIAL_TX_PIN _EPIN(E_STEPPERS, SERIAL_TX) #define X2_SERIAL_TX_PIN _EPIN(X2_E_INDEX, SERIAL_TX)
#endif #endif
#ifndef X2_SERIAL_RX_PIN #ifndef X2_SERIAL_RX_PIN
#define X2_SERIAL_RX_PIN _EPIN(E_STEPPERS, SERIAL_RX) #define X2_SERIAL_RX_PIN _EPIN(X2_E_INDEX, SERIAL_RX)
#endif #endif
#endif #endif
#define Y2_E_INDEX INCREMENT(E_STEPPERS)
//
// Auto-assign pins for stallGuard sensorless homing
//
#if X2_STALL_SENSITIVITY && ENABLED(X_DUAL_ENDSTOPS) && _PEXI(X2_E_INDEX, DIAG)
#define X2_DIAG_PIN _EPIN(X2_E_INDEX, DIAG)
#if DIAG_REMAPPED(X2, X_MIN) // If already remapped in the pins file...
#define X2_USE_ENDSTOP _XMIN_
#elif DIAG_REMAPPED(X2, Y_MIN)
#define X2_USE_ENDSTOP _YMIN_
#elif DIAG_REMAPPED(X2, Z_MIN)
#define X2_USE_ENDSTOP _ZMIN_
#elif DIAG_REMAPPED(X2, X_MAX)
#define X2_USE_ENDSTOP _XMAX_
#elif DIAG_REMAPPED(X2, Y_MAX)
#define X2_USE_ENDSTOP _YMAX_
#elif DIAG_REMAPPED(X2, Z_MAX)
#define X2_USE_ENDSTOP _ZMAX_
#else // Otherwise use the driver DIAG_PIN directly
#define _X2_USE_ENDSTOP(P) _E##P##_DIAG_
#define X2_USE_ENDSTOP _X2_USE_ENDSTOP(X2_E_INDEX)
#endif
#undef X2_DIAG_PIN
#endif
#define Y2_E_INDEX INCREMENT(X2_E_INDEX)
#else #else
#define Y2_E_INDEX E_STEPPERS #define Y2_E_INDEX X2_E_INDEX
#endif #endif
#ifndef X2_CS_PIN #ifndef X2_CS_PIN
@ -1206,6 +1250,26 @@
#define Y2_SERIAL_RX_PIN _EPIN(Y2_E_INDEX, SERIAL_RX) #define Y2_SERIAL_RX_PIN _EPIN(Y2_E_INDEX, SERIAL_RX)
#endif #endif
#endif #endif
#if Y2_STALL_SENSITIVITY && ENABLED(Y_DUAL_ENDSTOPS) && _PEXI(Y2_E_INDEX, DIAG)
#define Y2_DIAG_PIN _EPIN(Y2_E_INDEX, DIAG)
#if DIAG_REMAPPED(Y2, X_MIN)
#define Y2_USE_ENDSTOP _XMIN_
#elif DIAG_REMAPPED(Y2, Y_MIN)
#define Y2_USE_ENDSTOP _YMIN_
#elif DIAG_REMAPPED(Y2, Z_MIN)
#define Y2_USE_ENDSTOP _ZMIN_
#elif DIAG_REMAPPED(Y2, X_MAX)
#define Y2_USE_ENDSTOP _XMAX_
#elif DIAG_REMAPPED(Y2, Y_MAX)
#define Y2_USE_ENDSTOP _YMAX_
#elif DIAG_REMAPPED(Y2, Z_MAX)
#define Y2_USE_ENDSTOP _ZMAX_
#else
#define _Y2_USE_ENDSTOP(P) _E##P##_DIAG_
#define Y2_USE_ENDSTOP _Y2_USE_ENDSTOP(Y2_E_INDEX)
#endif
#undef Y2_DIAG_PIN
#endif
#define Z2_E_INDEX INCREMENT(Y2_E_INDEX) #define Z2_E_INDEX INCREMENT(Y2_E_INDEX)
#else #else
#define Z2_E_INDEX Y2_E_INDEX #define Z2_E_INDEX Y2_E_INDEX
@ -1254,6 +1318,26 @@
#define Z2_SERIAL_RX_PIN _EPIN(Z2_E_INDEX, SERIAL_RX) #define Z2_SERIAL_RX_PIN _EPIN(Z2_E_INDEX, SERIAL_RX)
#endif #endif
#endif #endif
#if Z2_STALL_SENSITIVITY && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 2 && _PEXI(Z2_E_INDEX, DIAG)
#define Z2_DIAG_PIN _EPIN(Z2_E_INDEX, DIAG)
#if DIAG_REMAPPED(Z2, X_MIN)
#define Z2_USE_ENDSTOP _XMIN_
#elif DIAG_REMAPPED(Z2, Y_MIN)
#define Z2_USE_ENDSTOP _YMIN_
#elif DIAG_REMAPPED(Z2, Z_MIN)
#define Z2_USE_ENDSTOP _ZMIN_
#elif DIAG_REMAPPED(Z2, X_MAX)
#define Z2_USE_ENDSTOP _XMAX_
#elif DIAG_REMAPPED(Z2, Y_MAX)
#define Z2_USE_ENDSTOP _YMAX_
#elif DIAG_REMAPPED(Z2, Z_MAX)
#define Z2_USE_ENDSTOP _ZMAX_
#else
#define _Z2_USE_ENDSTOP(P) _E##P##_DIAG_
#define Z2_USE_ENDSTOP _Z2_USE_ENDSTOP(Z2_E_INDEX)
#endif
#undef Z2_DIAG_PIN
#endif
#define Z3_E_INDEX INCREMENT(Z2_E_INDEX) #define Z3_E_INDEX INCREMENT(Z2_E_INDEX)
#else #else
#define Z3_E_INDEX Z2_E_INDEX #define Z3_E_INDEX Z2_E_INDEX
@ -1303,6 +1387,26 @@
#define Z3_SERIAL_RX_PIN _EPIN(Z3_E_INDEX, SERIAL_RX) #define Z3_SERIAL_RX_PIN _EPIN(Z3_E_INDEX, SERIAL_RX)
#endif #endif
#endif #endif
#if Z3_STALL_SENSITIVITY && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 && _PEXI(Z3_E_INDEX, DIAG)
#define Z3_DIAG_PIN _EPIN(Z3_E_INDEX, DIAG)
#if DIAG_REMAPPED(Z3, X_MIN)
#define Z3_USE_ENDSTOP _XMIN_
#elif DIAG_REMAPPED(Z3, Y_MIN)
#define Z3_USE_ENDSTOP _YMIN_
#elif DIAG_REMAPPED(Z3, Z_MIN)
#define Z3_USE_ENDSTOP _ZMIN_
#elif DIAG_REMAPPED(Z3, X_MAX)
#define Z3_USE_ENDSTOP _XMAX_
#elif DIAG_REMAPPED(Z3, Y_MAX)
#define Z3_USE_ENDSTOP _YMAX_
#elif DIAG_REMAPPED(Z3, Z_MAX)
#define Z3_USE_ENDSTOP _ZMAX_
#else
#define _Z3_USE_ENDSTOP(P) _E##P##_DIAG_
#define Z3_USE_ENDSTOP _Z3_USE_ENDSTOP(Z3_E_INDEX)
#endif
#undef Z3_DIAG_PIN
#endif
#define Z4_E_INDEX INCREMENT(Z3_E_INDEX) #define Z4_E_INDEX INCREMENT(Z3_E_INDEX)
#endif #endif
@ -1350,6 +1454,26 @@
#define Z4_SERIAL_RX_PIN _EPIN(Z4_E_INDEX, SERIAL_RX) #define Z4_SERIAL_RX_PIN _EPIN(Z4_E_INDEX, SERIAL_RX)
#endif #endif
#endif #endif
#if Z4_STALL_SENSITIVITY && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 && _PEXI(Z4_E_INDEX, DIAG)
#define Z4_DIAG_PIN _EPIN(Z4_E_INDEX, DIAG)
#if DIAG_REMAPPED(Z4, X_MIN)
#define Z4_USE_ENDSTOP _XMIN_
#elif DIAG_REMAPPED(Z4, Y_MIN)
#define Z4_USE_ENDSTOP _YMIN_
#elif DIAG_REMAPPED(Z4, Z_MIN)
#define Z4_USE_ENDSTOP _ZMIN_
#elif DIAG_REMAPPED(Z4, X_MAX)
#define Z4_USE_ENDSTOP _XMAX_
#elif DIAG_REMAPPED(Z4, Y_MAX)
#define Z4_USE_ENDSTOP _YMAX_
#elif DIAG_REMAPPED(Z4, Z_MAX)
#define Z4_USE_ENDSTOP _ZMAX_
#else
#define _Z4_USE_ENDSTOP(P) _E##P##_DIAG_
#define Z4_USE_ENDSTOP _Z4_USE_ENDSTOP(Z4_E_INDEX)
#endif
#undef Z4_DIAG_PIN
#endif
#endif #endif
#ifndef Z4_CS_PIN #ifndef Z4_CS_PIN
@ -1382,3 +1506,4 @@
#endif #endif
#undef HAS_FREE_AUX2_PINS #undef HAS_FREE_AUX2_PINS
#undef DIAG_REMAPPED

@ -1323,6 +1323,9 @@
#if PIN_EXISTS(X_MIN) #if PIN_EXISTS(X_MIN)
REPORT_NAME_DIGITAL(__LINE__, X_MIN_PIN) REPORT_NAME_DIGITAL(__LINE__, X_MIN_PIN)
#endif #endif
#if PIN_EXISTS(X_DIAG)
REPORT_NAME_DIGITAL(__LINE__, X_DIAG_PIN)
#endif
#if PIN_EXISTS(X_MS1) #if PIN_EXISTS(X_MS1)
REPORT_NAME_DIGITAL(__LINE__, X_MS1_PIN) REPORT_NAME_DIGITAL(__LINE__, X_MS1_PIN)
#endif #endif
@ -1344,6 +1347,12 @@
#if PIN_EXISTS(X2_ENABLE) #if PIN_EXISTS(X2_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, X2_ENABLE_PIN) REPORT_NAME_DIGITAL(__LINE__, X2_ENABLE_PIN)
#endif #endif
#if PIN_EXISTS(X2_MAX)
REPORT_NAME_DIGITAL(__LINE__, X2_MAX_PIN)
#endif
#if PIN_EXISTS(X2_MIN)
REPORT_NAME_DIGITAL(__LINE__, X2_MIN_PIN)
#endif
#if PIN_EXISTS(X2_MS1) #if PIN_EXISTS(X2_MS1)
REPORT_NAME_DIGITAL(__LINE__, X2_MS1_PIN) REPORT_NAME_DIGITAL(__LINE__, X2_MS1_PIN)
#endif #endif
@ -1374,6 +1383,9 @@
#if PIN_EXISTS(Y_MIN) #if PIN_EXISTS(Y_MIN)
REPORT_NAME_DIGITAL(__LINE__, Y_MIN_PIN) REPORT_NAME_DIGITAL(__LINE__, Y_MIN_PIN)
#endif #endif
#if PIN_EXISTS(Y_DIAG)
REPORT_NAME_DIGITAL(__LINE__, Y_DIAG_PIN)
#endif
#if PIN_EXISTS(Y_MS1) #if PIN_EXISTS(Y_MS1)
REPORT_NAME_DIGITAL(__LINE__, Y_MS1_PIN) REPORT_NAME_DIGITAL(__LINE__, Y_MS1_PIN)
#endif #endif
@ -1395,6 +1407,12 @@
#if PIN_EXISTS(Y2_ENABLE) #if PIN_EXISTS(Y2_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, Y2_ENABLE_PIN) REPORT_NAME_DIGITAL(__LINE__, Y2_ENABLE_PIN)
#endif #endif
#if PIN_EXISTS(Y2_MAX)
REPORT_NAME_DIGITAL(__LINE__, Y2_MAX_PIN)
#endif
#if PIN_EXISTS(Y2_MIN)
REPORT_NAME_DIGITAL(__LINE__, Y2_MIN_PIN)
#endif
#if PIN_EXISTS(Y2_MS1) #if PIN_EXISTS(Y2_MS1)
REPORT_NAME_DIGITAL(__LINE__, Y2_MS1_PIN) REPORT_NAME_DIGITAL(__LINE__, Y2_MS1_PIN)
#endif #endif
@ -1425,8 +1443,8 @@
#if PIN_EXISTS(Z_MIN) #if PIN_EXISTS(Z_MIN)
REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PIN) REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PIN)
#endif #endif
#if PIN_EXISTS(Z_MIN_PROBE) #if PIN_EXISTS(Z_DIAG)
REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PROBE_PIN) REPORT_NAME_DIGITAL(__LINE__, Z_DIAG_PIN)
#endif #endif
#if PIN_EXISTS(Z_MS1) #if PIN_EXISTS(Z_MS1)
REPORT_NAME_DIGITAL(__LINE__, Z_MS1_PIN) REPORT_NAME_DIGITAL(__LINE__, Z_MS1_PIN)
@ -1452,6 +1470,12 @@
#if PIN_EXISTS(Z2_ENABLE) #if PIN_EXISTS(Z2_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, Z2_ENABLE_PIN) REPORT_NAME_DIGITAL(__LINE__, Z2_ENABLE_PIN)
#endif #endif
#if PIN_EXISTS(Z2_MAX)
REPORT_NAME_DIGITAL(__LINE__, Z2_MAX_PIN)
#endif
#if PIN_EXISTS(Z2_MIN)
REPORT_NAME_DIGITAL(__LINE__, Z2_MIN_PIN)
#endif
#if PIN_EXISTS(Z2_MS1) #if PIN_EXISTS(Z2_MS1)
REPORT_NAME_DIGITAL(__LINE__, Z2_MS1_PIN) REPORT_NAME_DIGITAL(__LINE__, Z2_MS1_PIN)
#endif #endif
@ -1473,6 +1497,12 @@
#if PIN_EXISTS(Z3_ENABLE) #if PIN_EXISTS(Z3_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, Z3_ENABLE_PIN) REPORT_NAME_DIGITAL(__LINE__, Z3_ENABLE_PIN)
#endif #endif
#if PIN_EXISTS(Z3_MAX)
REPORT_NAME_DIGITAL(__LINE__, Z3_MAX_PIN)
#endif
#if PIN_EXISTS(Z3_MIN)
REPORT_NAME_DIGITAL(__LINE__, Z3_MIN_PIN)
#endif
#if PIN_EXISTS(Z3_MS1) #if PIN_EXISTS(Z3_MS1)
REPORT_NAME_DIGITAL(__LINE__, Z3_MS1_PIN) REPORT_NAME_DIGITAL(__LINE__, Z3_MS1_PIN)
#endif #endif
@ -1494,6 +1524,12 @@
#if PIN_EXISTS(Z4_ENABLE) #if PIN_EXISTS(Z4_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, Z4_ENABLE_PIN) REPORT_NAME_DIGITAL(__LINE__, Z4_ENABLE_PIN)
#endif #endif
#if PIN_EXISTS(Z4_MAX)
REPORT_NAME_DIGITAL(__LINE__, Z4_MAX_PIN)
#endif
#if PIN_EXISTS(Z4_MIN)
REPORT_NAME_DIGITAL(__LINE__, Z4_MIN_PIN)
#endif
#if PIN_EXISTS(Z4_MS1) #if PIN_EXISTS(Z4_MS1)
REPORT_NAME_DIGITAL(__LINE__, Z4_MS1_PIN) REPORT_NAME_DIGITAL(__LINE__, Z4_MS1_PIN)
#endif #endif
@ -1506,6 +1542,9 @@
#if PIN_EXISTS(Z4_STEP) #if PIN_EXISTS(Z4_STEP)
REPORT_NAME_DIGITAL(__LINE__, Z4_STEP_PIN) REPORT_NAME_DIGITAL(__LINE__, Z4_STEP_PIN)
#endif #endif
#if PIN_EXISTS(Z_MIN_PROBE)
REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PROBE_PIN)
#endif
#if PIN_EXISTS(ZRIB_V20_D6) #if PIN_EXISTS(ZRIB_V20_D6)
REPORT_NAME_DIGITAL(__LINE__, ZRIB_V20_D6_PIN) REPORT_NAME_DIGITAL(__LINE__, ZRIB_V20_D6_PIN)
#endif #endif
@ -1560,48 +1599,72 @@
#if PIN_EXISTS(Z4_SERIAL_RX) #if PIN_EXISTS(Z4_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, Z4_SERIAL_RX_PIN) REPORT_NAME_DIGITAL(__LINE__, Z4_SERIAL_RX_PIN)
#endif #endif
#if PIN_EXISTS(E0_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E0_DIAG_PIN)
#endif
#if PIN_EXISTS(E0_SERIAL_TX) #if PIN_EXISTS(E0_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_TX_PIN) REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_TX_PIN)
#endif #endif
#if PIN_EXISTS(E0_SERIAL_RX) #if PIN_EXISTS(E0_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_RX_PIN) REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_RX_PIN)
#endif #endif
#if PIN_EXISTS(E1_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E1_DIAG_PIN)
#endif
#if PIN_EXISTS(E1_SERIAL_TX) #if PIN_EXISTS(E1_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_TX_PIN) REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_TX_PIN)
#endif #endif
#if PIN_EXISTS(E1_SERIAL_RX) #if PIN_EXISTS(E1_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_RX_PIN) REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_RX_PIN)
#endif #endif
#if PIN_EXISTS(E2_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E2_DIAG_PIN)
#endif
#if PIN_EXISTS(E2_SERIAL_TX) #if PIN_EXISTS(E2_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_TX_PIN) REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_TX_PIN)
#endif #endif
#if PIN_EXISTS(E2_SERIAL_RX) #if PIN_EXISTS(E2_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_RX_PIN) REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_RX_PIN)
#endif #endif
#if PIN_EXISTS(E3_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E3_DIAG_PIN)
#endif
#if PIN_EXISTS(E3_SERIAL_TX) #if PIN_EXISTS(E3_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_TX_PIN) REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_TX_PIN)
#endif #endif
#if PIN_EXISTS(E3_SERIAL_RX) #if PIN_EXISTS(E3_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_RX_PIN) REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_RX_PIN)
#endif #endif
#if PIN_EXISTS(E4_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E4_DIAG_PIN)
#endif
#if PIN_EXISTS(E4_SERIAL_TX) #if PIN_EXISTS(E4_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_TX_PIN) REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_TX_PIN)
#endif #endif
#if PIN_EXISTS(E4_SERIAL_RX) #if PIN_EXISTS(E4_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_RX_PIN) REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_RX_PIN)
#endif #endif
#if PIN_EXISTS(E5_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E5_DIAG_PIN)
#endif
#if PIN_EXISTS(E5_SERIAL_TX) #if PIN_EXISTS(E5_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E5_SERIAL_TX_PIN) REPORT_NAME_DIGITAL(__LINE__, E5_SERIAL_TX_PIN)
#endif #endif
#if PIN_EXISTS(E5_SERIAL_RX) #if PIN_EXISTS(E5_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, E5_SERIAL_RX_PIN) REPORT_NAME_DIGITAL(__LINE__, E5_SERIAL_RX_PIN)
#endif #endif
#if PIN_EXISTS(E6_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E6_DIAG_PIN)
#endif
#if PIN_EXISTS(E6_SERIAL_TX) #if PIN_EXISTS(E6_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E6_SERIAL_TX_PIN) REPORT_NAME_DIGITAL(__LINE__, E6_SERIAL_TX_PIN)
#endif #endif
#if PIN_EXISTS(E6_SERIAL_RX) #if PIN_EXISTS(E6_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, E6_SERIAL_RX_PIN) REPORT_NAME_DIGITAL(__LINE__, E6_SERIAL_RX_PIN)
#endif #endif
#if PIN_EXISTS(E7_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E7_DIAG_PIN)
#endif
#if PIN_EXISTS(E7_SERIAL_TX) #if PIN_EXISTS(E7_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E7_SERIAL_TX_PIN) REPORT_NAME_DIGITAL(__LINE__, E7_SERIAL_TX_PIN)
#endif #endif

@ -38,7 +38,7 @@
#error "You must set ([XYZ]|E0)_DRIVER_TYPE to TMC2130 in Configuration.h for EinsyRetro." #error "You must set ([XYZ]|E0)_DRIVER_TYPE to TMC2130 in Configuration.h for EinsyRetro."
#endif #endif
// TMC2130 Diag Pins (currently just for reference) // TMC2130 Diag Pins
#define X_DIAG_PIN 64 #define X_DIAG_PIN 64
#define Y_DIAG_PIN 69 #define Y_DIAG_PIN 69
#define Z_DIAG_PIN 68 #define Z_DIAG_PIN 68
@ -55,27 +55,27 @@
#if DISABLED(SENSORLESS_HOMING) #if DISABLED(SENSORLESS_HOMING)
#define X_MIN_PIN 12 #define X_MIN_PIN 12 // X-
#define Y_MIN_PIN 11 #define Y_MIN_PIN 11 // Y-
#define Z_MIN_PIN 10 #define Z_MIN_PIN 10 // Z-
#define X_MAX_PIN 81 #define X_MAX_PIN 81 // X+
#define Y_MAX_PIN 57 #define Y_MAX_PIN 57 // Y+
#else #else
#if X_HOME_DIR < 0 #if X_HOME_DIR < 0
#define X_MIN_PIN X_DIAG_PIN #define X_MIN_PIN X_DIAG_PIN
#define X_MAX_PIN 81 #define X_MAX_PIN 81 // X+
#else #else
#define X_MIN_PIN 12 #define X_MIN_PIN 12 // X-
#define X_MAX_PIN X_DIAG_PIN #define X_MAX_PIN X_DIAG_PIN
#endif #endif
#if Y_HOME_DIR < 0 #if Y_HOME_DIR < 0
#define Y_MIN_PIN Y_DIAG_PIN #define Y_MIN_PIN Y_DIAG_PIN
#define Y_MAX_PIN 57 #define Y_MAX_PIN 57 // Y+
#else #else
#define Y_MIN_PIN 11 #define Y_MIN_PIN 11 // Y-
#define Y_MAX_PIN Y_DIAG_PIN #define Y_MAX_PIN Y_DIAG_PIN
#endif #endif

@ -390,6 +390,24 @@
#ifndef E4_SERIAL_RX_PIN #ifndef E4_SERIAL_RX_PIN
#define E4_SERIAL_RX_PIN -1 #define E4_SERIAL_RX_PIN -1
#endif #endif
#ifndef E5_SERIAL_TX_PIN
#define E5_SERIAL_TX_PIN -1
#endif
#ifndef E5_SERIAL_RX_PIN
#define E5_SERIAL_RX_PIN -1
#endif
#ifndef E6_SERIAL_TX_PIN
#define E6_SERIAL_TX_PIN -1
#endif
#ifndef E6_SERIAL_RX_PIN
#define E6_SERIAL_RX_PIN -1
#endif
#ifndef E7_SERIAL_TX_PIN
#define E7_SERIAL_TX_PIN -1
#endif
#ifndef E7_SERIAL_RX_PIN
#define E7_SERIAL_RX_PIN -1
#endif
#endif #endif
// //

@ -147,6 +147,9 @@
#define E3_SERIAL_RX_PIN -1 #define E3_SERIAL_RX_PIN -1
#define E4_SERIAL_TX_PIN -1 #define E4_SERIAL_TX_PIN -1
#define E4_SERIAL_RX_PIN -1 #define E4_SERIAL_RX_PIN -1
#define E5_SERIAL_RX_PIN -1
#define E6_SERIAL_RX_PIN -1
#define E7_SERIAL_RX_PIN -1
#endif #endif
// //

@ -285,4 +285,22 @@
#ifndef E4_SERIAL_RX_PIN #ifndef E4_SERIAL_RX_PIN
#define E4_SERIAL_RX_PIN -1 #define E4_SERIAL_RX_PIN -1
#endif #endif
#ifndef E5_SERIAL_TX_PIN
#define E5_SERIAL_TX_PIN -1
#endif
#ifndef E5_SERIAL_RX_PIN
#define E5_SERIAL_RX_PIN -1
#endif
#ifndef E6_SERIAL_TX_PIN
#define E6_SERIAL_TX_PIN -1
#endif
#ifndef E6_SERIAL_RX_PIN
#define E6_SERIAL_RX_PIN -1
#endif
#ifndef E7_SERIAL_TX_PIN
#define E7_SERIAL_TX_PIN -1
#endif
#ifndef E7_SERIAL_RX_PIN
#define E7_SERIAL_RX_PIN -1
#endif
#endif #endif

@ -291,6 +291,16 @@ int32_t SdVolume::freeClusterCount() {
for (uint16_t i = 0; i < n; i++) for (uint16_t i = 0; i < n; i++)
if (cacheBuffer_.fat32[i] == 0) free++; if (cacheBuffer_.fat32[i] == 0) free++;
} }
#ifdef ESP32
// Needed to reset the idle task watchdog timer on ESP32 as reading the complete FAT may easily
// block for 10+ seconds. yield() is insufficient since it blocks lower prio tasks (e.g., idle).
static millis_t nextTaskTime = 0;
const millis_t ms = millis();
if (ELAPSED(ms, nextTaskTime)) {
vTaskDelay(1); // delay 1 tick (Minimum. Usually 10 or 1 ms depending on skdconfig.h)
nextTaskTime = ms + 1000; // tickle the task manager again in 1 second
}
#endif // ESP32
} }
return free; return free;
} }

Loading…
Cancel
Save