Use serial shorthand
This commit is contained in:
@ -142,8 +142,7 @@ void GcodeSuite::G29() {
|
||||
if (parser.seenval('I')) {
|
||||
ix = parser.value_int();
|
||||
if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) {
|
||||
SERIAL_ECHOPAIR("I out of range (0-", int(GRID_MAX_POINTS_X - 1));
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
SERIAL_ECHOLNPAIR("I out of range (0-", int(GRID_MAX_POINTS_X - 1), ")");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -153,8 +152,7 @@ void GcodeSuite::G29() {
|
||||
if (parser.seenval('J')) {
|
||||
iy = parser.value_int();
|
||||
if (!WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) {
|
||||
SERIAL_ECHOPAIR("J out of range (0-", int(GRID_MAX_POINTS_Y - 1));
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
SERIAL_ECHOLNPAIR("J out of range (0-", int(GRID_MAX_POINTS_Y - 1), ")");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -182,10 +180,8 @@ void GcodeSuite::G29() {
|
||||
|
||||
} // switch(state)
|
||||
|
||||
if (state == MeshNext) {
|
||||
SERIAL_ECHOPAIR("MBL G29 point ", _MIN(mbl_probe_index, GRID_MAX_POINTS));
|
||||
SERIAL_ECHOLNPAIR(" of ", int(GRID_MAX_POINTS));
|
||||
}
|
||||
if (state == MeshNext)
|
||||
SERIAL_ECHOLNPAIR("MBL G29 point ", _MIN(mbl_probe_index, GRID_MAX_POINTS), " of ", int(GRID_MAX_POINTS));
|
||||
|
||||
report_current_position();
|
||||
}
|
||||
|
@ -34,7 +34,9 @@
|
||||
* U<angle> - Stowed Angle
|
||||
*/
|
||||
void GcodeSuite::M281() {
|
||||
|
||||
if (!parser.seenval('P')) return;
|
||||
|
||||
const int servo_index = parser.value_int();
|
||||
if (WITHIN(servo_index, 0, NUM_SERVOS - 1)) {
|
||||
#if ENABLED(BLTOUCH)
|
||||
@ -53,16 +55,14 @@ void GcodeSuite::M281() {
|
||||
angle_change = true;
|
||||
}
|
||||
if (!angle_change) {
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPAIR(" Servo ", servo_index,
|
||||
" L", servo_angles[servo_index][0],
|
||||
" U", servo_angles[servo_index][1]);
|
||||
SERIAL_ECHO_MSG(" Servo ", servo_index,
|
||||
" L", servo_angles[servo_index][0],
|
||||
" U", servo_angles[servo_index][1]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ECHOLNPAIR("Servo ", servo_index, " out of range");
|
||||
}
|
||||
else
|
||||
SERIAL_ERROR_MSG("Servo ", servo_index, " out of range");
|
||||
|
||||
}
|
||||
|
||||
#endif // EDITABLE_SERVO_ANGLES
|
||||
|
@ -35,14 +35,15 @@
|
||||
* D<dval> - Set the D value
|
||||
*/
|
||||
void GcodeSuite::M304() {
|
||||
|
||||
if (parser.seen('P')) thermalManager.temp_bed.pid.Kp = parser.value_float();
|
||||
if (parser.seen('I')) thermalManager.temp_bed.pid.Ki = scalePID_i(parser.value_float());
|
||||
if (parser.seen('D')) thermalManager.temp_bed.pid.Kd = scalePID_d(parser.value_float());
|
||||
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPAIR(" p:", thermalManager.temp_bed.pid.Kp,
|
||||
" i:", unscalePID_i(thermalManager.temp_bed.pid.Ki),
|
||||
" d:", unscalePID_d(thermalManager.temp_bed.pid.Kd));
|
||||
SERIAL_ECHO_MSG(" p:", thermalManager.temp_bed.pid.Kp,
|
||||
" i:", unscalePID_i(thermalManager.temp_bed.pid.Ki),
|
||||
" d:", unscalePID_d(thermalManager.temp_bed.pid.Kd));
|
||||
|
||||
}
|
||||
|
||||
#endif // PIDTEMPBED
|
||||
|
@ -49,10 +49,8 @@ void GcodeSuite::M305() {
|
||||
const bool do_set = parser.seen("BCRT");
|
||||
|
||||
// A valid P index is required
|
||||
if (t_index >= (USER_THERMISTORS) || (do_set && t_index < 0)) {
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPAIR("!Invalid index. (0 <= P <= ", int(USER_THERMISTORS - 1), ")");
|
||||
}
|
||||
if (t_index >= (USER_THERMISTORS) || (do_set && t_index < 0))
|
||||
SERIAL_ECHO_MSG("!Invalid index. (0 <= P <= ", int(USER_THERMISTORS - 1), ")");
|
||||
else if (do_set) {
|
||||
if (parser.seen('R')) // Pullup resistor value
|
||||
if (!thermalManager.set_pull_up_res(t_index, parser.value_float()))
|
||||
|
@ -31,7 +31,9 @@
|
||||
* M280: Get or set servo position. P<index> [S<angle>]
|
||||
*/
|
||||
void GcodeSuite::M280() {
|
||||
|
||||
if (!parser.seen('P')) return;
|
||||
|
||||
const int servo_index = parser.value_int();
|
||||
if (WITHIN(servo_index, 0, NUM_SERVOS - 1)) {
|
||||
if (parser.seen('S')) {
|
||||
@ -41,15 +43,12 @@ void GcodeSuite::M280() {
|
||||
else
|
||||
MOVE_SERVO(servo_index, a);
|
||||
}
|
||||
else {
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPAIR(" Servo ", servo_index, ": ", servo[servo_index].read());
|
||||
}
|
||||
}
|
||||
else {
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ECHOLNPAIR("Servo ", servo_index, " out of range");
|
||||
else
|
||||
SERIAL_ECHO_MSG(" Servo ", servo_index, ": ", servo[servo_index].read());
|
||||
}
|
||||
else
|
||||
SERIAL_ERROR_MSG("Servo ", servo_index, " out of range");
|
||||
|
||||
}
|
||||
|
||||
#endif // HAS_SERVOS
|
||||
|
@ -32,14 +32,14 @@
|
||||
* S<seconds> Optional. Set the keepalive interval.
|
||||
*/
|
||||
void GcodeSuite::M113() {
|
||||
|
||||
if (parser.seenval('S')) {
|
||||
host_keepalive_interval = parser.value_byte();
|
||||
NOMORE(host_keepalive_interval, 60);
|
||||
}
|
||||
else {
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPAIR("M113 S", (unsigned long)host_keepalive_interval);
|
||||
}
|
||||
else
|
||||
SERIAL_ECHO_MSG("M113 S", (uint16_t)host_keepalive_interval);
|
||||
|
||||
}
|
||||
|
||||
#endif // HOST_KEEPALIVE_FEATURE
|
||||
|
@ -42,14 +42,12 @@
|
||||
FORCE_INLINE void mod_probe_offset(const float &offs) {
|
||||
if (TERN1(BABYSTEP_HOTEND_Z_OFFSET, active_extruder == 0)) {
|
||||
probe.offset.z += offs;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPAIR(STR_PROBE_OFFSET " " STR_Z, probe.offset.z);
|
||||
SERIAL_ECHO_MSG(STR_PROBE_OFFSET " " STR_Z, probe.offset.z);
|
||||
}
|
||||
else {
|
||||
#if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
|
||||
hotend_offset[active_extruder].z -= offs;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPAIR(STR_PROBE_OFFSET STR_Z ": ", hotend_offset[active_extruder].z);
|
||||
SERIAL_ECHO_MSG(STR_PROBE_OFFSET STR_Z ": ", hotend_offset[active_extruder].z);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,5 @@ void GcodeSuite::M31() {
|
||||
|
||||
ui.set_status(buffer);
|
||||
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPAIR("Print time: ", buffer);
|
||||
SERIAL_ECHO_MSG("Print time: ", buffer);
|
||||
}
|
||||
|
Reference in New Issue
Block a user