🎨 Misc code and spacing cleanup

This commit is contained in:
Scott Lahteine
2021-08-21 18:00:55 -05:00
parent 0aa87af82f
commit dc5ae16861
24 changed files with 79 additions and 159 deletions

View File

@ -878,9 +878,7 @@ G29_TYPE GcodeSuite::G29() {
// Sync the planner from the current_position
if (planner.leveling_active) sync_plan_position();
#if HAS_BED_PROBE
probe.move_z_after_probing();
#endif
TERN_(HAS_BED_PROBE, probe.move_z_after_probing());
#ifdef Z_PROBE_END_SCRIPT
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT);

View File

@ -135,17 +135,8 @@ void GcodeSuite::M240() {
};
#ifdef PHOTO_RETRACT_MM
const float rval = parser.seenval('R') ? parser.value_linear_units() : _PHOTO_RETRACT_MM;
feedRate_t sval = (
#if ENABLED(ADVANCED_PAUSE_FEATURE)
PAUSE_PARK_RETRACT_FEEDRATE
#elif ENABLED(FWRETRACT)
RETRACT_FEEDRATE
#else
45
#endif
);
if (parser.seenval('S')) sval = parser.value_feedrate();
const float rval = parser.linearval('R', _PHOTO_RETRACT_MM);
const feedRate_t sval = parser.feedrateval('S', TERN(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_RETRACT_FEEDRATE, TERN(FWRETRACT, RETRACT_FEEDRATE, 45)));
e_move_m240(-rval, sval);
#endif

View File

@ -32,16 +32,7 @@
* G10 - Retract filament according to settings of M207
* TODO: Handle 'G10 P' for tool settings and 'G10 L' for workspace settings
*/
void GcodeSuite::G10() {
#if HAS_MULTI_EXTRUDER
const bool rs = parser.boolval('S');
#endif
fwretract.retract(true
#if HAS_MULTI_EXTRUDER
, rs
#endif
);
}
void GcodeSuite::G10() { fwretract.retract(true OPTARG(HAS_MULTI_EXTRUDER, parser.boolval('S'))); }
/**
* G11 - Recover filament according to settings of M208

View File

@ -114,9 +114,7 @@ void GcodeSuite::M701() {
true, // show_lcd
thermalManager.still_heating(target_extruder), // pause_for_user
PAUSE_MODE_LOAD_FILAMENT // pause_mode
#if ENABLED(DUAL_X_CARRIAGE)
, target_extruder // Dual X target
#endif
OPTARG(DUAL_X_CARRIAGE, target_extruder) // Dual X target
);
#endif

View File

@ -416,7 +416,8 @@ public:
static inline float linearval(const char c, const float dval=0) { return seenval(c) ? value_linear_units() : dval; }
static inline float axisunitsval(const char c, const AxisEnum a, const float dval=0)
{ return seenval(c) ? value_axis_units(a) : dval; }
static inline celsius_t celsiusval(const char c, const float dval=0) { return seenval(c) ? value_celsius() : dval; }
static inline celsius_t celsiusval(const char c, const celsius_t dval=0) { return seenval(c) ? value_celsius() : dval; }
static inline feedRate_t feedrateval(const char c, const feedRate_t dval=0) { return seenval(c) ? value_feedrate() : dval; }
#if ENABLED(MARLIN_DEV_MODE)

View File

@ -118,11 +118,7 @@ bool GCodeQueue::RingBuffer::enqueue(const char *cmd, bool skip_ok/*=true*/
) {
if (*cmd == ';' || length >= BUFSIZE) return false;
strcpy(commands[index_w].buffer, cmd);
commit_command(skip_ok
#if HAS_MULTI_SERIAL
, serial_ind
#endif
);
commit_command(skip_ok OPTARG(HAS_MULTI_SERIAL, serial_ind));
return true;
}
@ -538,11 +534,7 @@ void GCodeQueue::get_serial_commands() {
#endif
// Add the command to the queue
ring_buffer.enqueue(serial.line_buffer, false
#if HAS_MULTI_SERIAL
, p
#endif
);
ring_buffer.enqueue(serial.line_buffer, false OPTARG(HAS_MULTI_SERIAL, p));
}
else
process_stream_char(serial_char, serial.input_state, serial.line_buffer, serial.count);