|
|
|
@ -10325,25 +10325,30 @@ inline void gcode_M502() {
|
|
|
|
|
SERIAL_ECHOLNPGM(" prewarn flag cleared");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void tmc2130_get_pwmthrs(TMC2130Stepper &st, const char name, const uint16_t spmm) {
|
|
|
|
|
SERIAL_CHAR(name);
|
|
|
|
|
SERIAL_ECHOPGM(" stealthChop max speed set to ");
|
|
|
|
|
SERIAL_ECHOLN(12650000UL * st.microsteps() / (256 * st.stealth_max_speed() * spmm));
|
|
|
|
|
}
|
|
|
|
|
static void tmc2130_set_pwmthrs(TMC2130Stepper &st, const char name, const int32_t thrs, const uint32_t spmm) {
|
|
|
|
|
st.stealth_max_speed(12650000UL * st.microsteps() / (256 * thrs * spmm));
|
|
|
|
|
tmc2130_get_pwmthrs(st, name, spmm);
|
|
|
|
|
}
|
|
|
|
|
#if ENABLED(HYBRID_THRESHOLD)
|
|
|
|
|
static void tmc2130_get_pwmthrs(TMC2130Stepper &st, const char name, const uint16_t spmm) {
|
|
|
|
|
SERIAL_CHAR(name);
|
|
|
|
|
SERIAL_ECHOPGM(" stealthChop max speed set to ");
|
|
|
|
|
SERIAL_ECHOLN(12650000UL * st.microsteps() / (256 * st.stealth_max_speed() * spmm));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void tmc2130_get_sgt(TMC2130Stepper &st, const char name) {
|
|
|
|
|
SERIAL_CHAR(name);
|
|
|
|
|
SERIAL_ECHOPGM(" driver homing sensitivity set to ");
|
|
|
|
|
SERIAL_ECHOLN(st.sgt());
|
|
|
|
|
}
|
|
|
|
|
static void tmc2130_set_sgt(TMC2130Stepper &st, const char name, const int8_t sgt_val) {
|
|
|
|
|
st.sgt(sgt_val);
|
|
|
|
|
tmc2130_get_sgt(st, name);
|
|
|
|
|
}
|
|
|
|
|
static void tmc2130_set_pwmthrs(TMC2130Stepper &st, const char name, const int32_t thrs, const uint32_t spmm) {
|
|
|
|
|
st.stealth_max_speed(12650000UL * st.microsteps() / (256 * thrs * spmm));
|
|
|
|
|
tmc2130_get_pwmthrs(st, name, spmm);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SENSORLESS_HOMING)
|
|
|
|
|
static void tmc2130_get_sgt(TMC2130Stepper &st, const char name) {
|
|
|
|
|
SERIAL_CHAR(name);
|
|
|
|
|
SERIAL_ECHOPGM(" driver homing sensitivity set to ");
|
|
|
|
|
SERIAL_ECHOLN(st.sgt());
|
|
|
|
|
}
|
|
|
|
|
static void tmc2130_set_sgt(TMC2130Stepper &st, const char name, const int8_t sgt_val) {
|
|
|
|
|
st.sgt(sgt_val);
|
|
|
|
|
tmc2130_get_sgt(st, name);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* M906: Set motor current in milliamps using axis codes X, Y, Z, E
|
|
|
|
|