BigTreeTech GTR V1.0 / Support 8 extruders, heaters, temp sensors, fans (#16595)

This commit is contained in:
yangwenxiong
2020-01-25 16:13:39 +08:00
committed by Scott Lahteine
parent 0d166f9c7d
commit 248b7dfa59
66 changed files with 2086 additions and 217 deletions

View File

@ -47,23 +47,38 @@ void GcodeSuite::M42() {
const pin_t pin = GET_PIN_MAP_PIN(pin_index);
#if FAN_COUNT > 0
switch (pin) {
#if HAS_FAN0
case FAN0_PIN: thermalManager.fan_speed[0] = pin_status; return;
#endif
#if HAS_FAN1
case FAN1_PIN: thermalManager.fan_speed[1] = pin_status; return;
#endif
#if HAS_FAN2
case FAN2_PIN: thermalManager.fan_speed[2] = pin_status; return;
#endif
#if HAS_FAN3
case FAN3_PIN: thermalManager.fan_speed[3] = pin_status; return;
#endif
#if HAS_FAN4
case FAN4_PIN: thermalManager.fan_speed[4] = pin_status; return;
#endif
#if HAS_FAN5
case FAN5_PIN: thermalManager.fan_speed[5] = pin_status; return;
#endif
#if HAS_FAN6
case FAN6_PIN: thermalManager.fan_speed[6] = pin_status; return;
#endif
#if HAS_FAN7
case FAN7_PIN: thermalManager.fan_speed[7] = pin_status; return;
#endif
}
#endif
if (!parser.boolval('I') && pin_is_protected(pin)) return protected_pin_err();
pinMode(pin, OUTPUT);
extDigitalWrite(pin, pin_status);
analogWrite(pin, pin_status);
#if FAN_COUNT > 0
switch (pin) {
#if HAS_FAN0
case FAN0_PIN: thermalManager.fan_speed[0] = pin_status; break;
#endif
#if HAS_FAN1
case FAN1_PIN: thermalManager.fan_speed[1] = pin_status; break;
#endif
#if HAS_FAN2
case FAN2_PIN: thermalManager.fan_speed[2] = pin_status; break;
#endif
}
#endif
}

View File

@ -38,7 +38,7 @@
#define M91x_SOME_X (M91x_USE(X) || M91x_USE(X2))
#define M91x_SOME_Y (M91x_USE(Y) || M91x_USE(Y2))
#define M91x_SOME_Z (M91x_USE(Z) || M91x_USE(Z2) || M91x_USE(Z3) || M91x_USE(Z4))
#define M91x_SOME_E (M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) || M91x_USE_E(5))
#define M91x_SOME_E (M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) || M91x_USE_E(5) || M91x_USE_E(6) || M91x_USE_E(7))
#if !M91x_SOME_X && !M91x_SOME_Y && !M91x_SOME_Z && !M91x_SOME_E
#error "MONITOR_DRIVER_STATUS requires at least one TMC2130, 2160, 2208, 2209, 2660, 5130, or 5160."
@ -91,6 +91,12 @@
#if M91x_USE_E(5)
tmc_report_otpw(stepperE5);
#endif
#if M91x_USE_E(6)
tmc_report_otpw(stepperE6);
#endif
#if M91x_USE_E(7)
tmc_report_otpw(stepperE7);
#endif
}
/**
@ -188,6 +194,12 @@
#if M91x_USE_E(5)
if (hasNone || eval == 5 || (hasE && eval < 0)) tmc_clear_otpw(stepperE5);
#endif
#if M91x_USE_E(6)
if (hasNone || eval == 6 || (hasE && eval < 0)) tmc_clear_otpw(stepperE6);
#endif
#if M91x_USE_E(7)
if (hasNone || eval == 7 || (hasE && eval < 0)) tmc_clear_otpw(stepperE7);
#endif
#endif
}
@ -263,6 +275,12 @@
#if E_STEPPERS > 5 && AXIS_HAS_STEALTHCHOP(E5)
case 5: TMC_SET_PWMTHRS_E(5); break;
#endif
#if E_STEPPERS > 6 && AXIS_HAS_STEALTHCHOP(E6)
case 6: TMC_SET_PWMTHRS_E(6); break;
#endif
#if E_STEPPERS > 7 && AXIS_HAS_STEALTHCHOP(E7)
case 7: TMC_SET_PWMTHRS_E(7); break;
#endif
}
#endif // E_STEPPERS
} break;
@ -312,6 +330,12 @@
#if E_STEPPERS > 5 && AXIS_HAS_STEALTHCHOP(E5)
TMC_SAY_PWMTHRS_E(5);
#endif
#if E_STEPPERS > 6 && AXIS_HAS_STEALTHCHOP(E6)
TMC_SAY_PWMTHRS_E(6);
#endif
#if E_STEPPERS > 7 && AXIS_HAS_STEALTHCHOP(E7)
TMC_SAY_PWMTHRS_E(7);
#endif
}
}
#endif // HYBRID_THRESHOLD