Commit e7267fe5 authored by MagoKimbra's avatar MagoKimbra

Fix Dondolo

parent 5cc5f404
...@@ -6950,26 +6950,22 @@ inline void gcode_T(uint8_t tmp_extruder) { ...@@ -6950,26 +6950,22 @@ inline void gcode_T(uint8_t tmp_extruder) {
active_driver = 0; active_driver = 0;
ECHO_LMV(DB, MSG_ACTIVE_COLOR, (int)active_extruder); ECHO_LMV(DB, MSG_ACTIVE_COLOR, (int)active_extruder);
#elif ENABLED(DONDOLO) #elif ENABLED(DONDOLO)
active_extruder = target_extruder; st_synchronize();
active_driver = 0; servo[DONDOLO_SERVO_INDEX].attach(0);
if (active_extruder == 0) { if (target_extruder == 0) {
st_synchronize();
servo[DONDOLO_SERVO_INDEX].attach(0);
servo[DONDOLO_SERVO_INDEX].write(DONDOLO_SERVOPOS_E0); servo[DONDOLO_SERVO_INDEX].write(DONDOLO_SERVOPOS_E0);
delay (DONDOLO_SERVO_DELAY);
servo[DONDOLO_SERVO_INDEX].detach();
} }
else if (active_extruder == 1) { else if (target_extruder == 1) {
st_synchronize();
servo[DONDOLO_SERVO_INDEX].attach(0);
servo[DONDOLO_SERVO_INDEX].write(DONDOLO_SERVOPOS_E1); servo[DONDOLO_SERVO_INDEX].write(DONDOLO_SERVOPOS_E1);
delay(DONDOLO_SERVO_DELAY);
servo[DONDOLO_SERVO_INDEX].detach();
} }
delay(DONDOLO_SERVO_DELAY);
servo[DONDOLO_SERVO_INDEX].detach();
active_extruder = target_extruder;
active_driver = 0;
set_stepper_direction(true); set_stepper_direction(true);
ECHO_LMV(DB, MSG_ACTIVE_DRIVER, active_driver); ECHO_LMV(DB, MSG_ACTIVE_DRIVER, active_driver);
ECHO_LMV(DB, MSG_ACTIVE_EXTRUDER, active_extruder); ECHO_LMV(DB, MSG_ACTIVE_EXTRUDER, active_extruder);
#else #else
active_driver = active_extruder = target_extruder; active_driver = active_extruder = target_extruder;
ECHO_LMV(DB, MSG_ACTIVE_EXTRUDER, active_extruder); ECHO_LMV(DB, MSG_ACTIVE_EXTRUDER, active_extruder);
#endif // end MKR4 || NPR2 || DONDOLO #endif // end MKR4 || NPR2 || DONDOLO
......
...@@ -576,24 +576,22 @@ void set_stepper_direction(bool onlye) { ...@@ -576,24 +576,22 @@ void set_stepper_direction(bool onlye) {
#if DISABLED(ADVANCE) && ENABLED(DONDOLO) #if DISABLED(ADVANCE) && ENABLED(DONDOLO)
if (TEST(out_bits, E_AXIS)) { if (TEST(out_bits, E_AXIS)) {
if (active_extruder == 0) { switch(active_extruder) {
REV_E_DIR(); case 0:
count_direction[E_AXIS] = -1; REV_E_DIR(); break;
} case 1:
else { NORM_E_DIR(); break;
NORM_E_DIR();
count_direction[E_AXIS] = -1;
} }
count_direction[E_AXIS] = -1;
} }
else { else {
if (active_extruder == 0) { switch(active_extruder) {
NORM_E_DIR(); case 0:
count_direction[E_AXIS] = 1; NORM_E_DIR(); break;
} case 1:
else { REV_E_DIR(); break;
REV_E_DIR();
count_direction[E_AXIS] = 1;
} }
count_direction[E_AXIS] = 1;
} }
#elif DISABLED(ADVANCE) #elif DISABLED(ADVANCE)
if (TEST(out_bits, E_AXIS)) { if (TEST(out_bits, E_AXIS)) {
......
...@@ -52,7 +52,7 @@ enum EndstopEnum {X_MIN=0, Y_MIN=1, Z_MIN=2, Z_PROBE=3, X_MAX=4, Y_MAX=5, Z_MAX= ...@@ -52,7 +52,7 @@ enum EndstopEnum {X_MIN=0, Y_MIN=1, Z_MIN=2, Z_PROBE=3, X_MAX=4, Y_MAX=5, Z_MAX=
#define E_STEP_WRITE(v) { if(extruder_duplication_enabled) { E0_STEP_WRITE(v); E1_STEP_WRITE(v); } else if(current_block->active_driver == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }} #define E_STEP_WRITE(v) { if(extruder_duplication_enabled) { E0_STEP_WRITE(v); E1_STEP_WRITE(v); } else if(current_block->active_driver == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }}
#define NORM_E_DIR() { if(extruder_duplication_enabled) { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); } else if(current_block->active_driver == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR); }} #define NORM_E_DIR() { if(extruder_duplication_enabled) { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); } else if(current_block->active_driver == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR); }}
#define REV_E_DIR() { if(extruder_duplication_enabled) { E0_DIR_WRITE(INVERT_E0_DIR); E1_DIR_WRITE(INVERT_E1_DIR); } else if(current_block->active_driver == 1) { E1_DIR_WRITE(INVERT_E1_DIR); } else { E0_DIR_WRITE(INVERT_E0_DIR); }} #define REV_E_DIR() { if(extruder_duplication_enabled) { E0_DIR_WRITE(INVERT_E0_DIR); E1_DIR_WRITE(INVERT_E1_DIR); } else if(current_block->active_driver == 1) { E1_DIR_WRITE(INVERT_E1_DIR); } else { E0_DIR_WRITE(INVERT_E0_DIR); }}
#endif #endif
#else #else
#define E_STEP_WRITE(v) E0_STEP_WRITE(v) #define E_STEP_WRITE(v) E0_STEP_WRITE(v)
#define NORM_E_DIR() E0_DIR_WRITE(!INVERT_E0_DIR) #define NORM_E_DIR() E0_DIR_WRITE(!INVERT_E0_DIR)
......
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