Multi-host support
This commit is contained in:
committed by
Scott Lahteine
parent
dabb75034c
commit
f7efac57b7
@ -64,9 +64,12 @@ static void extrapolate_one_point(const uint8_t x, const uint8_t y, const int8_t
|
||||
c1 = z_values[x1][y1], c2 = z_values[x2][y2];
|
||||
|
||||
// Treat far unprobed points as zero, near as equal to far
|
||||
if (isnan(a2)) a2 = 0.0; if (isnan(a1)) a1 = a2;
|
||||
if (isnan(b2)) b2 = 0.0; if (isnan(b1)) b1 = b2;
|
||||
if (isnan(c2)) c2 = 0.0; if (isnan(c1)) c1 = c2;
|
||||
if (isnan(a2)) a2 = 0.0;
|
||||
if (isnan(a1)) a1 = a2;
|
||||
if (isnan(b2)) b2 = 0.0;
|
||||
if (isnan(b1)) b1 = b2;
|
||||
if (isnan(c2)) c2 = 0.0;
|
||||
if (isnan(c1)) c1 = c2;
|
||||
|
||||
const float a = 2 * a1 - a2, b = 2 * b1 - b2, c = 2 * c1 - c2;
|
||||
|
||||
|
@ -36,13 +36,27 @@
|
||||
|
||||
uint8_t ubl_cnt = 0;
|
||||
|
||||
void unified_bed_leveling::echo_name() { SERIAL_PROTOCOLPGM("Unified Bed Leveling"); }
|
||||
void unified_bed_leveling::echo_name(
|
||||
#if NUM_SERIAL > 1
|
||||
const int8_t port/*= -1*/
|
||||
#endif
|
||||
) {
|
||||
SERIAL_PROTOCOLPGM_P(port, "Unified Bed Leveling");
|
||||
}
|
||||
|
||||
void unified_bed_leveling::report_state() {
|
||||
echo_name();
|
||||
SERIAL_PROTOCOLPGM(" System v" UBL_VERSION " ");
|
||||
if (!planner.leveling_active) SERIAL_PROTOCOLPGM("in");
|
||||
SERIAL_PROTOCOLLNPGM("active.");
|
||||
void unified_bed_leveling::report_state(
|
||||
#if NUM_SERIAL > 1
|
||||
const int8_t port/*= -1*/
|
||||
#endif
|
||||
) {
|
||||
echo_name(
|
||||
#if NUM_SERIAL > 1
|
||||
port
|
||||
#endif
|
||||
);
|
||||
SERIAL_PROTOCOLPGM_P(port, " System v" UBL_VERSION " ");
|
||||
if (!planner.leveling_active) SERIAL_PROTOCOLPGM_P(port, "in");
|
||||
SERIAL_PROTOCOLLNPGM_P(port, "active.");
|
||||
safe_delay(50);
|
||||
}
|
||||
|
||||
@ -198,10 +212,7 @@
|
||||
}
|
||||
idle();
|
||||
if (map_type == 1 && i < GRID_MAX_POINTS_X - 1) SERIAL_CHAR(',');
|
||||
|
||||
#if TX_BUFFER_SIZE > 0
|
||||
MYSERIAL.flushTX();
|
||||
#endif
|
||||
SERIAL_FLUSHTX();
|
||||
safe_delay(15);
|
||||
if (map_type == 0) {
|
||||
SERIAL_CHAR(is_current ? ']' : ' ');
|
||||
|
@ -104,8 +104,16 @@ class unified_bed_leveling {
|
||||
|
||||
public:
|
||||
|
||||
static void echo_name();
|
||||
static void report_state();
|
||||
static void echo_name(
|
||||
#if NUM_SERIAL > 1
|
||||
const int8_t port = -1
|
||||
#endif
|
||||
);
|
||||
static void report_state(
|
||||
#if NUM_SERIAL > 1
|
||||
const int8_t port = -1
|
||||
#endif
|
||||
);
|
||||
static void save_ubl_active_state_and_disable();
|
||||
static void restore_ubl_active_state_and_leave();
|
||||
static void display_map(const int);
|
||||
|
@ -146,12 +146,12 @@ char extended_axis_codes[11][3] = { "X", "X2", "Y", "Y2", "Z", "Z2", "E0", "E1",
|
||||
const uint32_t pwm_scale = get_pwm_scale(st);
|
||||
SERIAL_ECHO(axisID);
|
||||
SERIAL_ECHOPAIR(":", pwm_scale);
|
||||
SERIAL_ECHO(" |0b"); MYSERIAL.print(get_status_response(st), BIN);
|
||||
SERIAL_ECHO(" |0b"); SERIAL_PRINT(get_status_response(st), BIN);
|
||||
SERIAL_ECHO("| ");
|
||||
if (data.is_error) SERIAL_ECHO('E');
|
||||
else if (data.is_ot) SERIAL_ECHO('O');
|
||||
else if (data.is_otpw) SERIAL_ECHO('W');
|
||||
else if (otpw_cnt>0) MYSERIAL.print(otpw_cnt, DEC);
|
||||
else if (otpw_cnt>0) SERIAL_PRINT(otpw_cnt, DEC);
|
||||
else if (st.flag_otpw) SERIAL_ECHO('F');
|
||||
SERIAL_ECHO("\t");
|
||||
}
|
||||
|
Reference in New Issue
Block a user