Commit 4a191428 authored by MagoKimbra's avatar MagoKimbra

Fix Z_SAFE

parent 294b2165
......@@ -55,10 +55,13 @@
// Uncomment to include more info in ok command
//#define ADVANCED_OK
// By default MarlinKimbra will send a busy status message to the host
//
// Host Keepalive
//
// When enabled MarlinKimbra will send a busy status message to the host
// every couple of seconds when it can't accept commands.
// Enable this option if your host doesn't like keepalive messages.
//#define DISABLE_HOST_KEEPALIVE
#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
/***********************************************************************/
......
......@@ -94,6 +94,8 @@
#define E0E1_CHOICE_PIN -1
#define E0E2_CHOICE_PIN -1
#define E0E3_CHOICE_PIN -1
#define E0E4_CHOICE_PIN -1
#define E0E5_CHOICE_PIN -1
#define E1E3_CHOICE_PIN -1
#endif
......
......@@ -585,8 +585,10 @@ bool enqueue_and_echo_command(const char* cmd, bool say_ok/*=false*/) {
#if HAS(DONDOLO)
servo[DONDOLO_SERVO_INDEX].attach(0);
servo[DONDOLO_SERVO_INDEX].write(DONDOLO_SERVOPOS_E0);
delay_ms(DONDOLO_SERVO_DELAY);
servo[DONDOLO_SERVO_INDEX].detach();
#if (DONDOLO_SERVO_DELAY > 0)
delay_ms(DONDOLO_SERVO_DELAY);
servo[DONDOLO_SERVO_INDEX].detach();
#endif
#endif
// Set position of Servo Endstops that are defined
......@@ -3632,8 +3634,10 @@ inline void gcode_G28() {
#elif ENABLED(Z_SAFE_HOMING)
if (home_all_axis || homeZ) {
if (DEBUGGING(INFO)) ECHO_LM(INFO, "> Z_SAFE_HOMING >>>");
// Let's see if X and Y are homed
if (axis_was_homed & (_BV(X_AXIS)|_BV(Y_AXIS)) == (_BV(X_AXIS)|_BV(Y_AXIS))) {
if (axis_homed[X_AXIS] && axis_homed[Y_AXIS]) {
current_position[Z_AXIS] = 0;
sync_plan_position();
......@@ -3643,7 +3647,6 @@ inline void gcode_G28() {
feedrate = xy_travel_speed;
if (DEBUGGING(INFO)) {
ECHO_SMV(INFO, "Raise Z (before homing) by ", (float)Z_RAISE_BEFORE_HOMING);
DEBUG_POS(" > home_all_axis", current_position);
DEBUG_POS(" > home_all_axis", destination);
}
......@@ -6148,8 +6151,10 @@ inline void gcode_M226() {
Servo *srv = &servo[servo_index];
srv->attach(0);
srv->write(servo_position);
delay_ms(DONDOLO_SERVO_DELAY);
srv->detach();
#if (DONDOLO_SERVO_DELAY > 0)
delay_ms(DONDOLO_SERVO_DELAY);
srv->detach();
#endif
}
else {
ECHO_SM(ER, "Servo ");
......@@ -7601,8 +7606,10 @@ inline void gcode_T(uint8_t tmp_extruder) {
else if (target_extruder == 1) {
servo[DONDOLO_SERVO_INDEX].write(DONDOLO_SERVOPOS_E1);
}
delay_ms(DONDOLO_SERVO_DELAY);
servo[DONDOLO_SERVO_INDEX].detach();
#if (DONDOLO_SERVO_DELAY > 0)
delay_ms(DONDOLO_SERVO_DELAY);
servo[DONDOLO_SERVO_INDEX].detach();
#endif
previous_extruder = active_extruder;
#if ENABLED(DONDOLO_SINGLE_MOTOR)
active_extruder = target_extruder;
......
......@@ -475,10 +475,9 @@
#endif
/**
* Avoid double-negatives for enabling features
* Host keep alive
*/
#if DISABLED(DISABLE_HOST_KEEPALIVE)
#define HOST_KEEPALIVE_FEATURE
#if DISABLED(DEFAULT_KEEPALIVE_INTERVAL)
#define DEFAULT_KEEPALIVE_INTERVAL 2
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment