Commit d494c8a4 authored by MagoKimbra's avatar MagoKimbra

Fix rele

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