🎨 Fewer serial macros
This commit is contained in:
committed by
Scott Lahteine
parent
6d96c221bd
commit
b661795ae5
@@ -68,7 +68,7 @@ inline void L6470_say_status(const L64XX_axis_t axis) {
|
||||
if (!(sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD)) SERIAL_ECHOPGM("IN");
|
||||
SERIAL_ECHOPGM("VALID ");
|
||||
SERIAL_ECHOPGM_P(sh.STATUS_AXIS & sh.STATUS_AXIS_NOTPERF_CMD ? PSTR("COMPLETED ") : PSTR("Not PERFORMED"));
|
||||
SERIAL_ECHOPAIR("\n...THERMAL: ", !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_SD) ? "SHUTDOWN " : !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_WRN) ? "WARNING " : "OK ");
|
||||
SERIAL_ECHOPGM("\n...THERMAL: ", !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_SD) ? "SHUTDOWN " : !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_WRN) ? "WARNING " : "OK ");
|
||||
}
|
||||
SERIAL_ECHOPGM(" OVERCURRENT:"); echo_yes_no((sh.STATUS_AXIS & sh.STATUS_AXIS_OCD) == 0);
|
||||
if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) {
|
||||
|
@@ -63,7 +63,7 @@ void L64XX_report_current(L64XX &motor, const L64XX_axis_t axis) {
|
||||
#if ENABLED(L6470_CHITCHAT)
|
||||
char tmp[10];
|
||||
sprintf_P(tmp, PSTR("%4x "), status);
|
||||
DEBUG_ECHOPAIR(" status: ", tmp);
|
||||
DEBUG_ECHOPGM(" status: ", tmp);
|
||||
print_bin(status);
|
||||
#else
|
||||
UNUSED(status);
|
||||
@@ -104,13 +104,13 @@ void L64XX_report_current(L64XX &motor, const L64XX_axis_t axis) {
|
||||
}
|
||||
SERIAL_EOL();
|
||||
|
||||
SERIAL_ECHOPAIR("...MicroSteps: ", MicroSteps,
|
||||
SERIAL_ECHOPGM("...MicroSteps: ", MicroSteps,
|
||||
" ADC_OUT: ", L6470_ADC_out);
|
||||
SERIAL_ECHOPGM(" Vs_compensation: ");
|
||||
SERIAL_ECHOPGM_P((motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_EN_VSCOMP) ? PSTR("ENABLED ") : PSTR("DISABLED"));
|
||||
SERIAL_ECHOLNPAIR(" Compensation coefficient: ~", comp_coef * 0.01f);
|
||||
SERIAL_ECHOLNPGM(" Compensation coefficient: ~", comp_coef * 0.01f);
|
||||
|
||||
SERIAL_ECHOPAIR("...KVAL_HOLD: ", motor.GetParam(L6470_KVAL_HOLD),
|
||||
SERIAL_ECHOPGM("...KVAL_HOLD: ", motor.GetParam(L6470_KVAL_HOLD),
|
||||
" KVAL_RUN : ", motor.GetParam(L6470_KVAL_RUN),
|
||||
" KVAL_ACC: ", motor.GetParam(L6470_KVAL_ACC),
|
||||
" KVAL_DEC: ", motor.GetParam(L6470_KVAL_DEC),
|
||||
@@ -168,7 +168,7 @@ void L64XX_report_current(L64XX &motor, const L64XX_axis_t axis) {
|
||||
SERIAL_ECHOLNPGM(" mA) Motor Status: NA");
|
||||
|
||||
const uint16_t MicroSteps = _BV(motor.GetParam(L6470_STEP_MODE) & 0x07); //NOMORE(MicroSteps, 16);
|
||||
SERIAL_ECHOPAIR("...MicroSteps: ", MicroSteps,
|
||||
SERIAL_ECHOPGM("...MicroSteps: ", MicroSteps,
|
||||
" ADC_OUT: ", L6470_ADC_out);
|
||||
|
||||
SERIAL_ECHOLNPGM(" Vs_compensation: NA\n");
|
||||
@@ -185,7 +185,7 @@ void L64XX_report_current(L64XX &motor, const L64XX_axis_t axis) {
|
||||
case 1: DEBUG_ECHOLNPGM("75V/uS") ; break;
|
||||
case 2: DEBUG_ECHOLNPGM("110V/uS") ; break;
|
||||
case 3: DEBUG_ECHOLNPGM("260V/uS") ; break;
|
||||
default: DEBUG_ECHOLNPAIR("slew rate: ", (motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_POW_SR) >> CONFIG_POW_SR_BIT); break;
|
||||
default: DEBUG_ECHOLNPGM("slew rate: ", (motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_POW_SR) >> CONFIG_POW_SR_BIT); break;
|
||||
}
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
|
@@ -96,7 +96,7 @@ void GcodeSuite::M916() {
|
||||
if (L64xxManager.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, OCD_TH_val, STALL_TH_val, over_current_threshold))
|
||||
return; // quit if invalid user input
|
||||
|
||||
DEBUG_ECHOLNPAIR("feedrate = ", final_feedrate);
|
||||
DEBUG_ECHOLNPGM("feedrate = ", final_feedrate);
|
||||
|
||||
planner.synchronize(); // wait for all current movement commands to complete
|
||||
|
||||
@@ -127,9 +127,9 @@ void GcodeSuite::M916() {
|
||||
do {
|
||||
|
||||
if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT)
|
||||
DEBUG_ECHOLNPAIR("TVAL current (mA) = ", (M91x_counter + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV); // report TVAL current for this run
|
||||
DEBUG_ECHOLNPGM("TVAL current (mA) = ", (M91x_counter + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV); // report TVAL current for this run
|
||||
else
|
||||
DEBUG_ECHOLNPAIR("kval_hold = ", M91x_counter); // report KVAL_HOLD for this run
|
||||
DEBUG_ECHOLNPGM("kval_hold = ", M91x_counter); // report KVAL_HOLD for this run
|
||||
|
||||
for (j = 0; j < driver_count; j++)
|
||||
L64xxManager.set_param(axis_index[j], L6470_KVAL_HOLD, M91x_counter); //set KVAL_HOLD or TVAL (same register address)
|
||||
@@ -236,7 +236,7 @@ void GcodeSuite::M917() {
|
||||
if (L64xxManager.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, OCD_TH_val, STALL_TH_val, over_current_threshold))
|
||||
return; // quit if invalid user input
|
||||
|
||||
DEBUG_ECHOLNPAIR("feedrate = ", final_feedrate);
|
||||
DEBUG_ECHOLNPGM("feedrate = ", final_feedrate);
|
||||
|
||||
planner.synchronize(); // wait for all current movement commands to complete
|
||||
|
||||
@@ -252,18 +252,18 @@ void GcodeSuite::M917() {
|
||||
// 2 - OCD finalized - decreasing STALL - exit when STALL warning happens
|
||||
// 3 - OCD finalized - increasing STALL - exit when STALL warning stop
|
||||
// 4 - all testing completed
|
||||
DEBUG_ECHOPAIR(".\n.\n.\nover_current threshold : ", (OCD_TH_val + 1) * 375); // first status display
|
||||
DEBUG_ECHOPAIR(" (OCD_TH: : ", OCD_TH_val);
|
||||
DEBUG_ECHOPGM(".\n.\n.\nover_current threshold : ", (OCD_TH_val + 1) * 375); // first status display
|
||||
DEBUG_ECHOPGM(" (OCD_TH: : ", OCD_TH_val);
|
||||
if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) {
|
||||
DEBUG_ECHOPAIR(") Stall threshold: ", (STALL_TH_val + 1) * 31.25);
|
||||
DEBUG_ECHOPAIR(" (STALL_TH: ", STALL_TH_val);
|
||||
DEBUG_ECHOPGM(") Stall threshold: ", (STALL_TH_val + 1) * 31.25);
|
||||
DEBUG_ECHOPGM(" (STALL_TH: ", STALL_TH_val);
|
||||
}
|
||||
DEBUG_ECHOLNPGM(")");
|
||||
|
||||
do {
|
||||
|
||||
if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) DEBUG_ECHOPAIR("STALL threshold : ", (STALL_TH_val + 1) * 31.25);
|
||||
DEBUG_ECHOLNPAIR(" OCD threshold : ", (OCD_TH_val + 1) * 375);
|
||||
if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) DEBUG_ECHOPGM("STALL threshold : ", (STALL_TH_val + 1) * 31.25);
|
||||
DEBUG_ECHOLNPGM(" OCD threshold : ", (OCD_TH_val + 1) * 375);
|
||||
|
||||
sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_min), uint16_t(final_feedrate));
|
||||
gcode.process_subcommands_now_P(gcode_string);
|
||||
@@ -303,7 +303,7 @@ void GcodeSuite::M917() {
|
||||
if (!(k % 4)) {
|
||||
kval_hold *= 0.95;
|
||||
DEBUG_EOL();
|
||||
DEBUG_ECHOLNPAIR("Lowering KVAL_HOLD by about 5% to ", kval_hold);
|
||||
DEBUG_ECHOLNPGM("Lowering KVAL_HOLD by about 5% to ", kval_hold);
|
||||
for (j = 0; j < driver_count; j++)
|
||||
L64xxManager.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold);
|
||||
}
|
||||
@@ -590,8 +590,8 @@ void GcodeSuite::M918() {
|
||||
}
|
||||
m_steps = L64xxManager.get_param(axis_index[0], L6470_STEP_MODE) & 0x07; // get microsteps
|
||||
|
||||
DEBUG_ECHOLNPAIR("Microsteps = ", _BV(m_steps));
|
||||
DEBUG_ECHOLNPAIR("target (maximum) feedrate = ", final_feedrate);
|
||||
DEBUG_ECHOLNPGM("Microsteps = ", _BV(m_steps));
|
||||
DEBUG_ECHOLNPGM("target (maximum) feedrate = ", final_feedrate);
|
||||
|
||||
const float feedrate_inc = final_feedrate / 10, // Start at 1/10 of max & go up by 1/10 per step
|
||||
fr_limit = final_feedrate * 0.99f; // Rounding-safe comparison value
|
||||
@@ -612,7 +612,7 @@ void GcodeSuite::M918() {
|
||||
|
||||
do {
|
||||
current_feedrate += feedrate_inc;
|
||||
DEBUG_ECHOLNPAIR("...feedrate = ", current_feedrate);
|
||||
DEBUG_ECHOLNPGM("...feedrate = ", current_feedrate);
|
||||
|
||||
sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_min), uint16_t(current_feedrate));
|
||||
gcode.process_subcommands_now_P(gcode_string);
|
||||
|
Reference in New Issue
Block a user