Merge pull request #9565 from teemuatlut/bf1_init_cs_pins
[1.1.x] Init CS pins before loading settings
This commit is contained in:
commit
8f4c564b04
@ -13636,6 +13636,9 @@ void setup() {
|
|||||||
SERIAL_PROTOCOLLNPGM("start");
|
SERIAL_PROTOCOLLNPGM("start");
|
||||||
SERIAL_ECHO_START();
|
SERIAL_ECHO_START();
|
||||||
|
|
||||||
|
#if ENABLED(HAVE_TMC2130)
|
||||||
|
tmc_init_cs_pins();
|
||||||
|
#endif
|
||||||
#if ENABLED(HAVE_TMC2208)
|
#if ENABLED(HAVE_TMC2208)
|
||||||
tmc2208_serial_begin();
|
tmc2208_serial_begin();
|
||||||
#endif
|
#endif
|
||||||
|
@ -565,4 +565,43 @@ void _tmc_say_sgt(const char name[], const uint32_t sgt) {
|
|||||||
|
|
||||||
#endif // SENSORLESS_HOMING
|
#endif // SENSORLESS_HOMING
|
||||||
|
|
||||||
|
#if ENABLED(HAVE_TMC2130)
|
||||||
|
#define SET_CS_PIN(st) OUT_WRITE(st##_CS_PIN, HIGH)
|
||||||
|
void tmc_init_cs_pins() {
|
||||||
|
#if ENABLED(X_IS_TMC2130)
|
||||||
|
SET_CS_PIN(X);
|
||||||
|
#endif
|
||||||
|
#if ENABLED(Y_IS_TMC2130)
|
||||||
|
SET_CS_PIN(Y);
|
||||||
|
#endif
|
||||||
|
#if ENABLED(Z_IS_TMC2130)
|
||||||
|
SET_CS_PIN(Z);
|
||||||
|
#endif
|
||||||
|
#if ENABLED(X2_IS_TMC2130)
|
||||||
|
SET_CS_PIN(X2);
|
||||||
|
#endif
|
||||||
|
#if ENABLED(Y2_IS_TMC2130)
|
||||||
|
SET_CS_PIN(Y2);
|
||||||
|
#endif
|
||||||
|
#if ENABLED(Z2_IS_TMC2130)
|
||||||
|
SET_CS_PIN(Z2);
|
||||||
|
#endif
|
||||||
|
#if ENABLED(E0_IS_TMC2130)
|
||||||
|
SET_CS_PIN(E0);
|
||||||
|
#endif
|
||||||
|
#if ENABLED(E1_IS_TMC2130)
|
||||||
|
SET_CS_PIN(E1);
|
||||||
|
#endif
|
||||||
|
#if ENABLED(E2_IS_TMC2130)
|
||||||
|
SET_CS_PIN(E2);
|
||||||
|
#endif
|
||||||
|
#if ENABLED(E3_IS_TMC2130)
|
||||||
|
SET_CS_PIN(E3);
|
||||||
|
#endif
|
||||||
|
#if ENABLED(E4_IS_TMC2130)
|
||||||
|
SET_CS_PIN(E4);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif // HAVE_TMC2130
|
||||||
|
|
||||||
#endif // HAS_TRINAMIC
|
#endif // HAS_TRINAMIC
|
||||||
|
@ -100,4 +100,8 @@ void monitor_tmc_driver();
|
|||||||
void tmc_sensorless_homing(TMC2130Stepper &st, bool enable=true);
|
void tmc_sensorless_homing(TMC2130Stepper &st, bool enable=true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(HAVE_TMC2130)
|
||||||
|
void tmc_init_cs_pins();
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // _TMC_UTIL_H_
|
#endif // _TMC_UTIL_H_
|
||||||
|
Loading…
Reference in New Issue
Block a user