diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 303d4693..d119fbe4 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -1316,7 +1316,7 @@ void setup() } #endif //TMC2130 -#if defined(Z_AXIS_ALWAYS_ON) +#if defined(Z_AXIS_ALWAYS_ON) && !defined(PSU_Delta) enable_z(); #endif farm_mode = eeprom_read_byte((uint8_t*)EEPROM_FARM_MODE); @@ -9608,6 +9608,8 @@ void disable_force_z() { uint16_t z_microsteps=0; +if(PIN_INQ(Z_ENABLE_PIN)!=Z_ENABLE_ON) + return; // motor already disabled (may be ;-p ) #ifdef TMC2130 z_microsteps=tmc2130_rd_MSCNT(Z_TMC2130_CS); #endif //TMC2130 diff --git a/Firmware/io_atmega2560.h b/Firmware/io_atmega2560.h index e8c756ff..e353eb05 100644 --- a/Firmware/io_atmega2560.h +++ b/Firmware/io_atmega2560.h @@ -368,6 +368,7 @@ #define PIN_SET(pin) PORT(pin) |= __MSK(pin) #define PIN_VAL(pin, val) if (val) PIN_SET(pin); else PIN_CLR(pin); #define PIN_GET(pin) (PIN(pin) & __MSK(pin)) +#define PIN_INQ(pin) (PORT(pin) & __MSK(pin)) #endif //_IO_ATMEGA2560