Allow SERIAL_ECHOPAIR to take up to 12 pairs (#13311)
This commit is contained in:
@ -47,8 +47,7 @@ void I2CPositionEncoder::init(const uint8_t address, const AxisEnum axis) {
|
||||
|
||||
initialized++;
|
||||
|
||||
SERIAL_ECHOPAIR("Setting up encoder on ", axis_codes[encoderAxis]);
|
||||
SERIAL_ECHOLNPAIR(" axis, addr = ", address);
|
||||
SERIAL_ECHOLNPAIR("Setting up encoder on ", axis_codes[encoderAxis], " axis, addr = ", address);
|
||||
|
||||
position = get_position();
|
||||
}
|
||||
@ -66,8 +65,7 @@ void I2CPositionEncoder::update() {
|
||||
/*
|
||||
if (trusted) { //commented out as part of the note below
|
||||
trusted = false;
|
||||
SERIAL_ECHOPAIR("Fault detected on ", axis_codes[encoderAxis]);
|
||||
SERIAL_ECHOLNPGM(" axis encoder. Disengaging error correction until module is trusted again.");
|
||||
SERIAL_ECHOLMPAIR("Fault detected on ", axis_codes[encoderAxis], " axis encoder. Disengaging error correction until module is trusted again.");
|
||||
}
|
||||
*/
|
||||
return;
|
||||
@ -92,8 +90,7 @@ void I2CPositionEncoder::update() {
|
||||
if (millis() - lastErrorTime > I2CPE_TIME_TRUSTED) {
|
||||
trusted = true;
|
||||
|
||||
SERIAL_ECHOPAIR("Untrusted encoder module on ", axis_codes[encoderAxis]);
|
||||
SERIAL_ECHOLNPGM(" axis has been fault-free for set duration, reinstating error correction.");
|
||||
SERIAL_ECHOLNPAIR("Untrusted encoder module on ", axis_codes[encoderAxis], " axis has been fault-free for set duration, reinstating error correction.");
|
||||
|
||||
//the encoder likely lost its place when the error occured, so we'll reset and use the printer's
|
||||
//idea of where it the axis is to re-initialize
|
||||
@ -172,8 +169,7 @@ void I2CPositionEncoder::update() {
|
||||
LOOP_L_N(i, I2CPE_ERR_PRST_ARRAY_SIZE) sumP += errPrst[i];
|
||||
const int32_t errorP = int32_t(sumP * (1.0f / (I2CPE_ERR_PRST_ARRAY_SIZE)));
|
||||
SERIAL_ECHO(axis_codes[encoderAxis]);
|
||||
SERIAL_ECHOPAIR(" - err detected: ", errorP * planner.steps_to_mm[encoderAxis]);
|
||||
SERIAL_ECHOLNPGM("mm; correcting!");
|
||||
SERIAL_ECHOLNPAIR(" - err detected: ", errorP * planner.steps_to_mm[encoderAxis], "mm; correcting!");
|
||||
thermalManager.babystepsTodo[encoderAxis] = -LROUND(errorP);
|
||||
errPrstIdx = 0;
|
||||
}
|
||||
@ -192,9 +188,7 @@ void I2CPositionEncoder::update() {
|
||||
if (ABS(error) > I2CPE_ERR_CNT_THRESH * planner.settings.axis_steps_per_mm[encoderAxis]) {
|
||||
const millis_t ms = millis();
|
||||
if (ELAPSED(ms, nextErrorCountTime)) {
|
||||
SERIAL_ECHOPAIR("Large error on ", axis_codes[encoderAxis]);
|
||||
SERIAL_ECHOPAIR(" axis. error: ", (int)error);
|
||||
SERIAL_ECHOLNPAIR("; diffSum: ", diffSum);
|
||||
SERIAL_ECHOLNPAIR("Large error on ", axis_codes[encoderAxis], " axis. error: ", (int)error, "; diffSum: ", diffSum);
|
||||
errorCount++;
|
||||
nextErrorCountTime = ms + I2CPE_ERR_CNT_DEBOUNCE_MS;
|
||||
}
|
||||
@ -215,8 +209,7 @@ void I2CPositionEncoder::set_homed() {
|
||||
|
||||
#ifdef I2CPE_DEBUG
|
||||
SERIAL_ECHO(axis_codes[encoderAxis]);
|
||||
SERIAL_ECHOPAIR(" axis encoder homed, offset of ", zeroOffset);
|
||||
SERIAL_ECHOLNPGM(" ticks.");
|
||||
SERIAL_ECHOLNPAIR(" axis encoder homed, offset of ", zeroOffset, " ticks.");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -261,9 +254,7 @@ float I2CPositionEncoder::get_axis_error_mm(const bool report) {
|
||||
|
||||
if (report) {
|
||||
SERIAL_ECHO(axis_codes[encoderAxis]);
|
||||
SERIAL_ECHOPAIR(" axis target: ", target);
|
||||
SERIAL_ECHOPAIR(", actual: ", actual);
|
||||
SERIAL_ECHOLNPAIR(", error : ",error);
|
||||
SERIAL_ECHOLNPAIR(" axis target: ", target, ", actual: ", actual, ", error : ",error);
|
||||
}
|
||||
|
||||
return error;
|
||||
@ -296,10 +287,7 @@ int32_t I2CPositionEncoder::get_axis_error_steps(const bool report) {
|
||||
|
||||
if (report) {
|
||||
SERIAL_ECHO(axis_codes[encoderAxis]);
|
||||
SERIAL_ECHOPAIR(" axis target: ", target);
|
||||
SERIAL_ECHOPAIR(", actual: ", encoderCountInStepperTicksScaled);
|
||||
SERIAL_ECHOLNPAIR(", error : ", error);
|
||||
|
||||
SERIAL_ECHOLNPAIR(" axis target: ", target, ", actual: ", encoderCountInStepperTicksScaled, ", error : ", error);
|
||||
if (suppressOutput) SERIAL_ECHOLNPGM("Discontinuity detected, suppressing error.");
|
||||
}
|
||||
|
||||
@ -436,11 +424,9 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) {
|
||||
|
||||
travelledDistance = mm_from_count(ABS(stopCount - startCount));
|
||||
|
||||
SERIAL_ECHOPAIR("Attempted travel: ", travelDistance);
|
||||
SERIAL_ECHOLNPGM("mm");
|
||||
SERIAL_ECHOLNPAIR("Attempted travel: ", travelDistance, "mm");
|
||||
|
||||
SERIAL_ECHOPAIR(" Actual travel: ", travelledDistance);
|
||||
SERIAL_ECHOLNPGM("mm");
|
||||
SERIAL_ECHOLNPAIR(" Actual travel: ", travelledDistance, "mm");
|
||||
|
||||
//Calculate new axis steps per unit
|
||||
old_steps_mm = planner.settings.axis_steps_per_mm[encoderAxis];
|
||||
@ -705,21 +691,18 @@ void I2CPositionEncodersMgr::change_module_address(const uint8_t oldaddr, const
|
||||
// First check 'new' address is not in use
|
||||
Wire.beginTransmission(I2C_ADDRESS(newaddr));
|
||||
if (!Wire.endTransmission()) {
|
||||
SERIAL_ECHOPAIR("?There is already a device with that address on the I2C bus! (", newaddr);
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
SERIAL_ECHOLNPAIR("?There is already a device with that address on the I2C bus! (", newaddr, ")");
|
||||
return;
|
||||
}
|
||||
|
||||
// Now check that we can find the module on the oldaddr address
|
||||
Wire.beginTransmission(I2C_ADDRESS(oldaddr));
|
||||
if (Wire.endTransmission()) {
|
||||
SERIAL_ECHOPAIR("?No module detected at this address! (", oldaddr);
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
SERIAL_ECHOLNPAIR("?No module detected at this address! (", oldaddr, ")");
|
||||
return;
|
||||
}
|
||||
|
||||
SERIAL_ECHOPAIR("Module found at ", oldaddr);
|
||||
SERIAL_ECHOLNPAIR(", changing address to ", newaddr);
|
||||
SERIAL_ECHOLNPAIR("Module found at ", oldaddr, ", changing address to ", newaddr);
|
||||
|
||||
// Change the modules address
|
||||
Wire.beginTransmission(I2C_ADDRESS(oldaddr));
|
||||
@ -755,13 +738,11 @@ void I2CPositionEncodersMgr::report_module_firmware(const uint8_t address) {
|
||||
// First check there is a module
|
||||
Wire.beginTransmission(I2C_ADDRESS(address));
|
||||
if (Wire.endTransmission()) {
|
||||
SERIAL_ECHOPAIR("?No module detected at this address! (", address);
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
SERIAL_ECHOLNPAIR("?No module detected at this address! (", address, ")");
|
||||
return;
|
||||
}
|
||||
|
||||
SERIAL_ECHOPAIR("Requesting version info from module at address ", address);
|
||||
SERIAL_ECHOLNPGM(":");
|
||||
SERIAL_ECHOLNPAIR("Requesting version info from module at address ", address, ":");
|
||||
|
||||
Wire.beginTransmission(I2C_ADDRESS(address));
|
||||
Wire.write(I2CPE_SET_REPORT_MODE);
|
||||
@ -808,15 +789,13 @@ int8_t I2CPositionEncodersMgr::parse() {
|
||||
else if (parser.seenval('I')) {
|
||||
|
||||
if (!parser.has_value()) {
|
||||
SERIAL_ECHOLNPAIR("?I seen, but no index specified! [0-", I2CPE_ENCODER_CNT - 1);
|
||||
SERIAL_ECHOLNPGM("]");
|
||||
SERIAL_ECHOLNPAIR("?I seen, but no index specified! [0-", I2CPE_ENCODER_CNT - 1, "]");
|
||||
return I2CPE_PARSE_ERR;
|
||||
};
|
||||
|
||||
I2CPE_idx = parser.value_byte();
|
||||
if (I2CPE_idx >= I2CPE_ENCODER_CNT) {
|
||||
SERIAL_ECHOLNPAIR("?Index out of range. [0-", I2CPE_ENCODER_CNT - 1);
|
||||
SERIAL_ECHOLNPGM("]");
|
||||
SERIAL_ECHOLNPAIR("?Index out of range. [0-", I2CPE_ENCODER_CNT - 1, "]");
|
||||
return I2CPE_PARSE_ERR;
|
||||
}
|
||||
|
||||
@ -995,8 +974,7 @@ void I2CPositionEncodersMgr::M864() {
|
||||
else return;
|
||||
}
|
||||
|
||||
SERIAL_ECHOPAIR("Changing module at address ", I2CPE_addr);
|
||||
SERIAL_ECHOLNPAIR(" to address ", newAddress);
|
||||
SERIAL_ECHOLNPAIR("Changing module at address ", I2CPE_addr, " to address ", newAddress);
|
||||
|
||||
change_module_address(I2CPE_addr, newAddress);
|
||||
}
|
||||
|
@ -238,8 +238,7 @@ class I2CPositionEncodersMgr {
|
||||
|
||||
static void report_status(const int8_t idx) {
|
||||
CHECK_IDX();
|
||||
SERIAL_ECHOPAIR("Encoder ", idx);
|
||||
SERIAL_ECHOPGM(": ");
|
||||
SERIAL_ECHOLNPAIR("Encoder ", idx, ": ");
|
||||
encoders[idx].get_raw_count();
|
||||
encoders[idx].passes_test(true);
|
||||
}
|
||||
@ -264,22 +263,19 @@ class I2CPositionEncodersMgr {
|
||||
|
||||
static void report_error_count(const int8_t idx, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
SERIAL_ECHOPAIR("Error count on ", axis_codes[axis]);
|
||||
SERIAL_ECHOLNPAIR(" axis is ", encoders[idx].get_error_count());
|
||||
SERIAL_ECHOLNPAIR("Error count on ", axis_codes[axis], " axis is ", encoders[idx].get_error_count());
|
||||
}
|
||||
|
||||
static void reset_error_count(const int8_t idx, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
encoders[idx].set_error_count(0);
|
||||
SERIAL_ECHOPAIR("Error count on ", axis_codes[axis]);
|
||||
SERIAL_ECHOLNPGM(" axis has been reset.");
|
||||
SERIAL_ECHOLNPAIR("Error count on ", axis_codes[axis], " axis has been reset.");
|
||||
}
|
||||
|
||||
static void enable_ec(const int8_t idx, const bool enabled, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
encoders[idx].set_ec_enabled(enabled);
|
||||
SERIAL_ECHOPAIR("Error correction on ", axis_codes[axis]);
|
||||
SERIAL_ECHOPGM(" axis is ");
|
||||
SERIAL_ECHOPAIR("Error correction on ", axis_codes[axis], " axis is ");
|
||||
serialprintPGM(encoders[idx].get_ec_enabled() ? PSTR("en") : PSTR("dis"));
|
||||
SERIAL_ECHOLNPGM("abled.");
|
||||
}
|
||||
@ -287,17 +283,13 @@ class I2CPositionEncodersMgr {
|
||||
static void set_ec_threshold(const int8_t idx, const float newThreshold, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
encoders[idx].set_ec_threshold(newThreshold);
|
||||
SERIAL_ECHOPAIR("Error correct threshold for ", axis_codes[axis]);
|
||||
SERIAL_ECHOPAIR(" axis set to ", FIXFLOAT(newThreshold));
|
||||
SERIAL_ECHOLNPGM("mm.");
|
||||
SERIAL_ECHOLNPAIR("Error correct threshold for ", axis_codes[axis], " axis set to ", FIXFLOAT(newThreshold), "mm.");
|
||||
}
|
||||
|
||||
static void get_ec_threshold(const int8_t idx, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
const float threshold = encoders[idx].get_ec_threshold();
|
||||
SERIAL_ECHOPAIR("Error correct threshold for ", axis_codes[axis]);
|
||||
SERIAL_ECHOPAIR(" axis is ", FIXFLOAT(threshold));
|
||||
SERIAL_ECHOLNPGM("mm.");
|
||||
SERIAL_ECHOLNPAIR("Error correct threshold for ", axis_codes[axis], " axis is ", FIXFLOAT(threshold), "mm.");
|
||||
}
|
||||
|
||||
static int8_t idx_from_axis(const AxisEnum axis) {
|
||||
|
@ -338,22 +338,11 @@ float bilinear_z_offset(const float raw[XYZ]) {
|
||||
/*
|
||||
static float last_offset = 0;
|
||||
if (ABS(last_offset - offset) > 0.2) {
|
||||
SERIAL_ECHOPGM("Sudden Shift at ");
|
||||
SERIAL_ECHOPAIR("x=", rx);
|
||||
SERIAL_ECHOPAIR(" / ", bilinear_grid_spacing[X_AXIS]);
|
||||
SERIAL_ECHOLNPAIR(" -> gridx=", gridx);
|
||||
SERIAL_ECHOPAIR(" y=", ry);
|
||||
SERIAL_ECHOPAIR(" / ", bilinear_grid_spacing[Y_AXIS]);
|
||||
SERIAL_ECHOLNPAIR(" -> gridy=", gridy);
|
||||
SERIAL_ECHOPAIR(" ratio_x=", ratio_x);
|
||||
SERIAL_ECHOLNPAIR(" ratio_y=", ratio_y);
|
||||
SERIAL_ECHOPAIR(" z1=", z1);
|
||||
SERIAL_ECHOPAIR(" z2=", z2);
|
||||
SERIAL_ECHOPAIR(" z3=", z3);
|
||||
SERIAL_ECHOLNPAIR(" z4=", z4);
|
||||
SERIAL_ECHOPAIR(" L=", L);
|
||||
SERIAL_ECHOPAIR(" R=", R);
|
||||
SERIAL_ECHOLNPAIR(" offset=", offset);
|
||||
SERIAL_ECHOLNPAIR("Sudden Shift at x=", rx, " / ", bilinear_grid_spacing[X_AXIS], " -> gridx=", gridx);
|
||||
SERIAL_ECHOLNPAIR(" y=", ry, " / ", bilinear_grid_spacing[Y_AXIS], " -> gridy=", gridy);
|
||||
SERIAL_ECHOLNPAIR(" ratio_x=", ratio_x, " ratio_y=", ratio_y);
|
||||
SERIAL_ECHOLNPAIR(" z1=", z1, " z2=", z2, " z3=", z3, " z4=", z4);
|
||||
SERIAL_ECHOLNPAIR(" L=", L, " R=", R, " offset=", offset);
|
||||
}
|
||||
last_offset = offset;
|
||||
//*/
|
||||
|
@ -45,8 +45,7 @@
|
||||
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
|
||||
if (!isnan(z_values[x][y])) {
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPAIR(" M421 I", x);
|
||||
SERIAL_ECHOPAIR(" J", y);
|
||||
SERIAL_ECHOPAIR(" M421 I", x, " J", y);
|
||||
SERIAL_ECHOPAIR_F(" Z", z_values[x][y], 2);
|
||||
SERIAL_EOL();
|
||||
serial_delay(75); // Prevent Printrun from exploding
|
||||
|
@ -202,11 +202,7 @@ class unified_bed_leveling {
|
||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||
if (DEBUGGING(LEVELING)) {
|
||||
serialprintPGM( !WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) ? PSTR("x1_i") : PSTR("yi") );
|
||||
SERIAL_ECHOPAIR(" out of bounds in z_correction_for_x_on_horizontal_mesh_line(rx0=", rx0);
|
||||
SERIAL_ECHOPAIR(",x1_i=", x1_i);
|
||||
SERIAL_ECHOPAIR(",yi=", yi);
|
||||
SERIAL_CHAR(')');
|
||||
SERIAL_EOL();
|
||||
SERIAL_ECHOLNPAIR(" out of bounds in z_correction_for_x_on_horizontal_mesh_line(rx0=", rx0, ",x1_i=", x1_i, ",yi=", yi, ")");
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -235,12 +231,8 @@ class unified_bed_leveling {
|
||||
if (!WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(y1_i, 0, GRID_MAX_POINTS_Y - 1)) {
|
||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||
if (DEBUGGING(LEVELING)) {
|
||||
serialprintPGM( !WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) ? PSTR("xi") : PSTR("y1_i") );
|
||||
SERIAL_ECHOPAIR(" out of bounds in z_correction_for_y_on_vertical_mesh_line(ry0=", ry0);
|
||||
SERIAL_ECHOPAIR(", xi=", xi);
|
||||
SERIAL_ECHOPAIR(", y1_i=", y1_i);
|
||||
SERIAL_CHAR(')');
|
||||
SERIAL_EOL();
|
||||
serialprintPGM(!WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) ? PSTR("xi") : PSTR("y1_i"));
|
||||
SERIAL_ECHOLNPAIR(" out of bounds in z_correction_for_y_on_vertical_mesh_line(ry0=", ry0, ", xi=", xi, ", y1_i=", y1_i, ")");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -598,8 +598,7 @@
|
||||
}
|
||||
|
||||
if (!WITHIN(g29_storage_slot, 0, a - 1)) {
|
||||
SERIAL_ECHOLNPGM("?Invalid storage slot.");
|
||||
SERIAL_ECHOLNPAIR("?Use 0 to ", a - 1);
|
||||
SERIAL_ECHOLNPAIR("?Invalid storage slot.\n?Use 0 to ", a - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -627,8 +626,7 @@
|
||||
}
|
||||
|
||||
if (!WITHIN(g29_storage_slot, 0, a - 1)) {
|
||||
SERIAL_ECHOLNPGM("?Invalid storage slot.");
|
||||
SERIAL_ECHOLNPAIR("?Use 0 to ", a - 1);
|
||||
SERIAL_ECHOLNPAIR("?Invalid storage slot.\n?Use 0 to ", a - 1);
|
||||
goto LEAVE;
|
||||
}
|
||||
|
||||
@ -1640,10 +1638,8 @@
|
||||
|
||||
if (storage_slot == -1)
|
||||
SERIAL_ECHOPGM("No Mesh Loaded.");
|
||||
else {
|
||||
SERIAL_ECHOPAIR("Mesh ", storage_slot);
|
||||
SERIAL_ECHOPGM(" Loaded.");
|
||||
}
|
||||
else
|
||||
SERIAL_ECHOPAIR("Mesh ", storage_slot, " Loaded.");
|
||||
SERIAL_EOL();
|
||||
serial_delay(50);
|
||||
|
||||
@ -1683,19 +1679,16 @@
|
||||
SERIAL_EOL();
|
||||
|
||||
#if HAS_KILL
|
||||
SERIAL_ECHOPAIR("Kill pin on :", KILL_PIN);
|
||||
SERIAL_ECHOLNPAIR(" state:", READ(KILL_PIN));
|
||||
SERIAL_ECHOLNPAIR("Kill pin on :", int(KILL_PIN), " state:", READ(KILL_PIN));
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
serial_delay(50);
|
||||
|
||||
#if ENABLED(UBL_DEVEL_DEBUGGING)
|
||||
SERIAL_ECHOLNPAIR("ubl_state_at_invocation :", ubl_state_at_invocation); SERIAL_EOL();
|
||||
SERIAL_ECHOLNPAIR("ubl_state_recursion_chk :", ubl_state_recursion_chk); SERIAL_EOL();
|
||||
SERIAL_ECHOLNPAIR("ubl_state_at_invocation :", ubl_state_at_invocation, "\nubl_state_recursion_chk :", ubl_state_recursion_chk);
|
||||
serial_delay(50);
|
||||
|
||||
SERIAL_ECHOPAIR("Meshes go from ", hex_address((void*)settings.meshes_start_index()));
|
||||
SERIAL_ECHOLNPAIR(" to ", hex_address((void*)settings.meshes_end_index()));
|
||||
SERIAL_ECHOLNPAIR("Meshes go from ", hex_address((void*)settings.meshes_start_index()), " to ", hex_address((void*)settings.meshes_end_index()));
|
||||
serial_delay(50);
|
||||
|
||||
SERIAL_ECHOLNPAIR("sizeof(ubl) : ", (int)sizeof(ubl)); SERIAL_EOL();
|
||||
@ -1705,8 +1698,7 @@
|
||||
SERIAL_ECHOLNPAIR("EEPROM free for UBL: ", hex_address((void*)(settings.meshes_end_index() - settings.meshes_start_index())));
|
||||
serial_delay(50);
|
||||
|
||||
SERIAL_ECHOPAIR("EEPROM can hold ", settings.calc_num_meshes());
|
||||
SERIAL_ECHOLNPGM(" meshes.\n");
|
||||
SERIAL_ECHOLNPAIR("EEPROM can hold ", settings.calc_num_meshes(), " meshes.\n");
|
||||
serial_delay(25);
|
||||
#endif // UBL_DEVEL_DEBUGGING
|
||||
|
||||
@ -1753,24 +1745,21 @@
|
||||
}
|
||||
|
||||
if (!parser.has_value()) {
|
||||
SERIAL_ECHOLNPGM("?Storage slot # required.");
|
||||
SERIAL_ECHOLNPAIR("?Use 0 to ", a - 1);
|
||||
SERIAL_ECHOLNPAIR("?Storage slot # required.\n?Use 0 to ", a - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
g29_storage_slot = parser.value_int();
|
||||
|
||||
if (!WITHIN(g29_storage_slot, 0, a - 1)) {
|
||||
SERIAL_ECHOLNPGM("?Invalid storage slot.");
|
||||
SERIAL_ECHOLNPAIR("?Use 0 to ", a - 1);
|
||||
SERIAL_ECHOLNPAIR("?Invalid storage slot.\n?Use 0 to ", a - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
|
||||
settings.load_mesh(g29_storage_slot, &tmp_z_values);
|
||||
|
||||
SERIAL_ECHOPAIR("Subtracting mesh in slot ", g29_storage_slot);
|
||||
SERIAL_ECHOLNPGM(" from current mesh.");
|
||||
SERIAL_ECHOLNPAIR("Subtracting mesh in slot ", g29_storage_slot, " from current mesh.");
|
||||
|
||||
for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
|
||||
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
|
||||
|
@ -65,12 +65,13 @@
|
||||
cell_dest_yi = get_cell_index_y(end[Y_AXIS]);
|
||||
|
||||
if (g26_debug_flag) {
|
||||
SERIAL_ECHOPAIR(" ubl.line_to_destination_cartesian(xe=", destination[X_AXIS]);
|
||||
SERIAL_ECHOPAIR(", ye=", destination[Y_AXIS]);
|
||||
SERIAL_ECHOPAIR(", ze=", destination[Z_AXIS]);
|
||||
SERIAL_ECHOPAIR(", ee=", destination[E_AXIS]);
|
||||
SERIAL_CHAR(')');
|
||||
SERIAL_EOL();
|
||||
SERIAL_ECHOLNPAIR(
|
||||
" ubl.line_to_destination_cartesian(xe=", destination[X_AXIS],
|
||||
", ye=", destination[Y_AXIS],
|
||||
", ze=", destination[Z_AXIS],
|
||||
", ee=", destination[E_AXIS],
|
||||
")"
|
||||
);
|
||||
debug_current_and_destination(PSTR("Start of ubl.line_to_destination_cartesian()"));
|
||||
}
|
||||
|
||||
|
@ -105,15 +105,12 @@ void dac_print_values() {
|
||||
|
||||
SERIAL_ECHO_MSG("Stepper current values in % (Amps):");
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPAIR(" X:", dac_perc(X_AXIS));
|
||||
SERIAL_ECHOPAIR(" (", dac_amps(X_AXIS));
|
||||
SERIAL_ECHOPAIR(") Y:", dac_perc(Y_AXIS));
|
||||
SERIAL_ECHOPAIR(" (", dac_amps(Y_AXIS));
|
||||
SERIAL_ECHOPAIR(") Z:", dac_perc(Z_AXIS));
|
||||
SERIAL_ECHOPAIR(" (", dac_amps(Z_AXIS));
|
||||
SERIAL_ECHOPAIR(") E:", dac_perc(E_AXIS));
|
||||
SERIAL_ECHOPAIR(" (", dac_amps(E_AXIS));
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
SERIAL_ECHOLNPAIR(
|
||||
" X:", dac_perc(X_AXIS), " (", dac_amps(X_AXIS), ")"
|
||||
" Y:", dac_perc(Y_AXIS), " (", dac_amps(Y_AXIS), ")"
|
||||
" Z:", dac_perc(Z_AXIS), " (", dac_amps(Z_AXIS), ")"
|
||||
" E:", dac_perc(E_AXIS), " (", dac_amps(E_AXIS), ")"
|
||||
);
|
||||
}
|
||||
|
||||
void dac_commit_eeprom() {
|
||||
|
@ -112,15 +112,15 @@ void FWRetract::retract(const bool retracting
|
||||
#endif
|
||||
|
||||
/* // debugging
|
||||
SERIAL_ECHOLNPAIR("retracting ", retracting);
|
||||
SERIAL_ECHOLNPAIR("swapping ", swapping);
|
||||
SERIAL_ECHOLNPAIR("active extruder ", active_extruder);
|
||||
SERIAL_ECHOLNPAIR(
|
||||
"retracting ", retracting,
|
||||
"swapping ", swapping
|
||||
"active extruder ", active_extruder
|
||||
);
|
||||
for (uint8_t i = 0; i < EXTRUDERS; ++i) {
|
||||
SERIAL_ECHOPAIR("retracted[", i);
|
||||
SERIAL_ECHOLNPAIR("] ", retracted[i]);
|
||||
SERIAL_ECHOLNPAIR("retracted[", i, "] ", retracted[i]);
|
||||
#if EXTRUDERS > 1
|
||||
SERIAL_ECHOPAIR("retracted_swap[", i);
|
||||
SERIAL_ECHOLNPAIR("] ", retracted_swap[i]);
|
||||
SERIAL_ECHOLNPAIR("retracted_swap[", i, "] ", retracted_swap[i]);
|
||||
#endif
|
||||
}
|
||||
SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]);
|
||||
@ -209,11 +209,9 @@ void FWRetract::retract(const bool retracting
|
||||
SERIAL_ECHOLNPAIR("swapping ", swapping);
|
||||
SERIAL_ECHOLNPAIR("active_extruder ", active_extruder);
|
||||
for (uint8_t i = 0; i < EXTRUDERS; ++i) {
|
||||
SERIAL_ECHOPAIR("retracted[", i);
|
||||
SERIAL_ECHOLNPAIR("] ", retracted[i]);
|
||||
SERIAL_ECHOLNPAIR("retracted[", i, "] ", retracted[i]);
|
||||
#if EXTRUDERS > 1
|
||||
SERIAL_ECHOPAIR("retracted_swap[", i);
|
||||
SERIAL_ECHOLNPAIR("] ", retracted_swap[i]);
|
||||
SERIAL_ECHOLNPAIR("retracted_swap[", i, "] ", retracted_swap[i]);
|
||||
#endif
|
||||
}
|
||||
SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]);
|
||||
|
@ -139,19 +139,11 @@ void Mixer::refresh_collector(const float proportion/*=1.0*/, const uint8_t t/*=
|
||||
cmax = MAX(cmax, v);
|
||||
csum += v;
|
||||
}
|
||||
//SERIAL_ECHOPAIR("Mixer::refresh_collector(", proportion);
|
||||
//SERIAL_ECHOPAIR(", ", int(t));
|
||||
//SERIAL_ECHOPAIR(") cmax=", cmax);
|
||||
//SERIAL_ECHOPAIR(" csum=", csum);
|
||||
//SERIAL_ECHOPGM(" color");
|
||||
//SERIAL_ECHOPAIR("Mixer::refresh_collector(", proportion, ", ", int(t), ") cmax=", cmax, " csum=", csum, " color");
|
||||
const float inv_prop = proportion / csum;
|
||||
MIXER_STEPPER_LOOP(i) {
|
||||
collector[i] = color[t][i] * inv_prop;
|
||||
//SERIAL_ECHOPAIR(" [", int(t));
|
||||
//SERIAL_ECHOPAIR("][", int(i));
|
||||
//SERIAL_ECHOPAIR("] = ", int(color[t][i]));
|
||||
//SERIAL_ECHOPAIR(" (", collector[i]);
|
||||
//SERIAL_ECHOPGM(") ");
|
||||
//SERIAL_ECHOPAIR(" [", int(t), "][", int(i), "] = ", int(color[t][i]), " (", collector[i], ") ");
|
||||
}
|
||||
//SERIAL_EOL();
|
||||
}
|
||||
|
@ -148,11 +148,7 @@ class Mixer {
|
||||
MIXER_STEPPER_LOOP(i) tcolor[i] = mix[i] * scale;
|
||||
|
||||
#ifdef MIXER_NORMALIZER_DEBUG
|
||||
SERIAL_ECHOPAIR("Mix [", int(mix[0]));
|
||||
SERIAL_ECHOPAIR(", ", int(mix[1]));
|
||||
SERIAL_ECHOPAIR("] to Color [", int(tcolor[0]));
|
||||
SERIAL_ECHOPAIR(", ", int(tcolor[1]));
|
||||
SERIAL_ECHOLNPGM("]");
|
||||
SERIAL_ECHOLNPAIR("Mix [", int(mix[0]), ", ", int(mix[1]), "] to Color [", int(tcolor[0]), ", ", int(tcolor[1]), "]");
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -163,12 +159,7 @@ class Mixer {
|
||||
mix[0] = mixer_perc_t(100.0f * color[j][0] / ctot);
|
||||
mix[1] = 100 - mix[0];
|
||||
#ifdef MIXER_NORMALIZER_DEBUG
|
||||
SERIAL_ECHOPAIR("V-tool ", int(j));
|
||||
SERIAL_ECHOPAIR(" [", int(color[j][0]));
|
||||
SERIAL_ECHOPAIR(", ", int(color[j][1]));
|
||||
SERIAL_ECHOPAIR("] to Mix [", int(mix[0]));
|
||||
SERIAL_ECHOPAIR(", ", int(mix[1]));
|
||||
SERIAL_ECHOLNPGM("]");
|
||||
SERIAL_ECHOLNPAIR("V-tool ", int(j), " [", int(color[j][0]), ", ", int(color[j][1]), "] to Mix [", int(mix[0]), ", ", int(mix[1]), "]");
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -211,11 +202,7 @@ class Mixer {
|
||||
mix[0] = (mixer_perc_t)CEIL(100.0f * gradient.color[0] / ctot);
|
||||
mix[1] = 100 - mix[0];
|
||||
#ifdef MIXER_NORMALIZER_DEBUG
|
||||
SERIAL_ECHOPAIR("Gradient [", int(gradient.color[0]));
|
||||
SERIAL_ECHOPAIR(", ", int(gradient.color[1]));
|
||||
SERIAL_ECHOPAIR("] to Mix [", int(mix[0]));
|
||||
SERIAL_ECHOPAIR(", ", int(mix[1]));
|
||||
SERIAL_ECHOLNPGM("]");
|
||||
SERIAL_ECHOLNPAIR("Gradient [", int(gradient.color[0]), ", ", int(gradient.color[1]), "] to Mix [", int(mix[0]), ", ", int(mix[1]), "]");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -581,11 +581,12 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
|
||||
*/
|
||||
void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_length/*=0*/, const float &purge_length/*=ADVANCED_PAUSE_PURGE_LENGTH*/, const int8_t max_beep_count/*=0*/ DXC_ARGS) {
|
||||
/*
|
||||
SERIAL_ECHOLNPGM("start of resume_print()");
|
||||
SERIAL_ECHOPAIR("\ndual_x_carriage_mode:", dual_x_carriage_mode);
|
||||
SERIAL_ECHOPAIR("\nextruder_duplication_enabled:", extruder_duplication_enabled);
|
||||
SERIAL_ECHOPAIR("\nactive_extruder:", active_extruder);
|
||||
SERIAL_ECHOLNPGM("\n");
|
||||
SERIAL_ECHOLNPAIR(
|
||||
"start of resume_print()\ndual_x_carriage_mode:", dual_x_carriage_mode,
|
||||
"\nextruder_duplication_enabled:", extruder_duplication_enabled,
|
||||
"\nactive_extruder:", active_extruder,
|
||||
"\n"
|
||||
);
|
||||
//*/
|
||||
|
||||
if (!did_pause_print) return;
|
||||
|
@ -357,8 +357,7 @@ void PrintJobRecovery::resume() {
|
||||
|
||||
void PrintJobRecovery::debug(PGM_P const prefix) {
|
||||
serialprintPGM(prefix);
|
||||
SERIAL_ECHOPAIR(" Job Recovery Info...\nvalid_head:", int(info.valid_head));
|
||||
SERIAL_ECHOLNPAIR(" valid_foot:", int(info.valid_foot));
|
||||
SERIAL_ECHOLNPAIR(" Job Recovery Info...\nvalid_head:", int(info.valid_head), " valid_foot:", int(info.valid_foot));
|
||||
if (info.valid_head) {
|
||||
if (info.valid_head == info.valid_foot) {
|
||||
SERIAL_ECHOPGM("current_position: ");
|
||||
@ -394,8 +393,7 @@ void PrintJobRecovery::resume() {
|
||||
#endif
|
||||
|
||||
#if HAS_LEVELING
|
||||
SERIAL_ECHOPAIR("leveling: ", int(info.leveling));
|
||||
SERIAL_ECHOLNPAIR(" fade: ", int(info.fade));
|
||||
SERIAL_ECHOLNPAIR("leveling: ", int(info.leveling), "\n fade: ", int(info.fade));
|
||||
#endif
|
||||
#if ENABLED(FWRETRACT)
|
||||
SERIAL_ECHOPGM("retract: ");
|
||||
|
@ -174,8 +174,7 @@ void MMU2::mmuLoop() {
|
||||
sscanf(rx_buffer, "%uok\n", &version);
|
||||
|
||||
#if ENABLED(MMU2_DEBUG)
|
||||
SERIAL_ECHOLNPAIR("MMU => ", version);
|
||||
SERIAL_ECHOLNPGM("MMU <= 'S2'");
|
||||
SERIAL_ECHOLNPAIR("MMU => ", version, "\nMMU <= 'S2'");
|
||||
#endif
|
||||
|
||||
tx_str_P(PSTR("S2\n")); // read build number
|
||||
@ -234,8 +233,7 @@ void MMU2::mmuLoop() {
|
||||
sscanf(rx_buffer, "%hhuok\n", &finda);
|
||||
|
||||
#if ENABLED(MMU2_DEBUG)
|
||||
SERIAL_ECHOLNPAIR("MMU => ", finda);
|
||||
SERIAL_ECHOLNPGM("MMU - ENABLED");
|
||||
SERIAL_ECHOLNPAIR("MMU => ", finda, "\nMMU - ENABLED");
|
||||
#endif
|
||||
|
||||
enabled = true;
|
||||
@ -309,8 +307,7 @@ void MMU2::mmuLoop() {
|
||||
// filament type
|
||||
int filament = cmd - MMU_CMD_F0;
|
||||
#if ENABLED(MMU2_DEBUG)
|
||||
SERIAL_ECHOPAIR("MMU <= F", filament);
|
||||
SERIAL_ECHOPGM(" ");
|
||||
SERIAL_ECHOPAIR("MMU <= F", filament, " ");
|
||||
SERIAL_ECHO_F(cmd_arg, DEC);
|
||||
SERIAL_ECHOPGM("\n");
|
||||
#endif
|
||||
|
@ -92,9 +92,7 @@ void TWIBus::send() {
|
||||
void TWIBus::echoprefix(uint8_t bytes, const char prefix[], uint8_t adr) {
|
||||
SERIAL_ECHO_START();
|
||||
serialprintPGM(prefix);
|
||||
SERIAL_ECHOPAIR(": from:", adr);
|
||||
SERIAL_ECHOPAIR(" bytes:", bytes);
|
||||
SERIAL_ECHOPGM(" data:");
|
||||
SERIAL_ECHOPAIR(": from:", adr, " bytes:", bytes, " data:");
|
||||
}
|
||||
|
||||
// static
|
||||
|
Reference in New Issue
Block a user