Commit d494c8a4 authored by MagoKimbra's avatar MagoKimbra

Fix rele

parent e5c6f6ed
......@@ -6786,53 +6786,91 @@ inline void gcode_T(uint8_t tmp_extruder) {
switch(target_extruder)
{
case 0:
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
WRITE_RELE(E1E3_CHOICE_PIN, LOW);
WRITE_RELE(E0E2_CHOICE_PIN, 0);
WRITE_RELE(E1E3_CHOICE_PIN, 0);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
enable_e0();
break;
case 1:
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
WRITE_RELE(E1E3_CHOICE_PIN, LOW);
WRITE_RELE(E0E2_CHOICE_PIN, 0);
WRITE_RELE(E1E3_CHOICE_PIN, 0);
active_driver = 1;
delay(500); // 500 microseconds delay for relay
enable_e1();
break;
case 2:
WRITE_RELE(E0E2_CHOICE_PIN, HIGH);
WRITE_RELE(E1E3_CHOICE_PIN, LOW);
WRITE_RELE(E0E2_CHOICE_PIN, 1);
WRITE_RELE(E1E3_CHOICE_PIN, 0);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
enable_e2();
break;
case 3:
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
WRITE_RELE(E1E3_CHOICE_PIN, HIGH);
WRITE_RELE(E0E2_CHOICE_PIN, 0);
WRITE_RELE(E1E3_CHOICE_PIN, 1);
active_driver = 1;
delay(500); // 500 microseconds delay for relay
enable_e3();
break;
}
}
#elif (EXTRUDERS == 4) && HAS(E0E1) && HAS(E0E2) && HAS(E0E3) && (DRIVER_EXTRUDERS == 1)
st_synchronize(); // Finish all movement
disable_e();
switch(target_extruder)
{
case 0:
WRITE_RELE(E0E1_CHOICE_PIN, 0);
WRITE_RELE(E0E2_CHOICE_PIN, 0);
WRITE_RELE(E0E3_CHOICE_PIN, 0);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
enable_e0();
break;
case 1:
WRITE_RELE(E0E1_CHOICE_PIN, 1);
WRITE_RELE(E0E2_CHOICE_PIN, 0);
WRITE_RELE(E0E3_CHOICE_PIN, 0);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
enable_e0();
break;
case 2:
WRITE_RELE(E0E1_CHOICE_PIN, 1);
WRITE_RELE(E0E2_CHOICE_PIN, 1);
WRITE_RELE(E0E3_CHOICE_PIN, 0);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
enable_e0();
break;
case 3:
WRITE_RELE(E0E1_CHOICE_PIN, 1);
WRITE_RELE(E0E2_CHOICE_PIN, 1);
WRITE_RELE(E0E3_CHOICE_PIN, 1);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
enable_e0();
break;
}
#elif (EXTRUDERS == 3) && HAS(E0E2) && (DRIVER_EXTRUDERS == 2)
st_synchronize(); // Finish all movement
disable_e();
switch(target_extruder)
{
case 0:
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
WRITE_RELE(E0E2_CHOICE_PIN, 0);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
enable_e0();
break;
case 1:
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
WRITE_RELE(E0E2_CHOICE_PIN, 0);
active_driver = 1;
delay(500); // 500 microseconds delay for relay
enable_e1();
break;
case 2:
WRITE_RELE(E0E2_CHOICE_PIN, HIGH);
WRITE_RELE(E0E2_CHOICE_PIN, 1);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
enable_e2();
......@@ -6844,22 +6882,22 @@ inline void gcode_T(uint8_t tmp_extruder) {
switch(target_extruder)
{
case 0:
WRITE_RELE(E0E1_CHOICE_PIN, LOW);
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
WRITE_RELE(E0E1_CHOICE_PIN, 0);
WRITE_RELE(E0E2_CHOICE_PIN, 0);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
enable_e0();
break;
case 1:
WRITE_RELE(E0E1_CHOICE_PIN, HIGH);
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
WRITE_RELE(E0E1_CHOICE_PIN, 1);
WRITE_RELE(E0E2_CHOICE_PIN, 0);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
enable_e0();
break;
case 2:
WRITE_RELE(E0E1_CHOICE_PIN, HIGH);
WRITE_RELE(E0E2_CHOICE_PIN, HIGH);
WRITE_RELE(E0E1_CHOICE_PIN, 1);
WRITE_RELE(E0E2_CHOICE_PIN, 1);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
enable_e0();
......@@ -6871,13 +6909,13 @@ inline void gcode_T(uint8_t tmp_extruder) {
switch(target_extruder)
{
case 0:
WRITE_RELE(E0E1_CHOICE_PIN, LOW);
WRITE_RELE(E0E1_CHOICE_PIN, 0);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
enable_e0();
break;
case 1:
WRITE_RELE(E0E1_CHOICE_PIN, HIGH);
WRITE_RELE(E0E1_CHOICE_PIN, 1);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
enable_e0();
......
......@@ -619,7 +619,6 @@
#define HAS_E0E1 (PIN_EXISTS(E0E1_CHOICE))
#define HAS_E0E2 (PIN_EXISTS(E0E2_CHOICE))
#define HAS_E0E3 (PIN_EXISTS(E0E3_CHOICE))
#define HAS_E0E4 (PIN_EXISTS(E0E4_CHOICE))
#define HAS_E1E3 (PIN_EXISTS(E1E3_CHOICE))
#define HAS_BTN_BACK (PIN_EXISTS(BTN_BACK))
#define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && PIN_EXISTS(PS_ON))
......
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