Optimize G-code flag parameters (#21849)
This commit is contained in:
		
				
					committed by
					
						
						Scott Lahteine
					
				
			
			
				
	
			
			
			
						parent
						
							770edea577
						
					
				
				
					commit
					6a1e78e614
				
			@@ -219,7 +219,7 @@ void GcodeSuite::G28() {
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  #if ENABLED(MARLIN_DEV_MODE)
 | 
			
		||||
    if (parser.seen('S')) {
 | 
			
		||||
    if (parser.seen_test('S')) {
 | 
			
		||||
      LOOP_XYZ(a) set_axis_is_at_home((AxisEnum)a);
 | 
			
		||||
      sync_plan_position();
 | 
			
		||||
      SERIAL_ECHOLNPGM("Simulated Homing");
 | 
			
		||||
@@ -321,10 +321,10 @@ void GcodeSuite::G28() {
 | 
			
		||||
 | 
			
		||||
  #else
 | 
			
		||||
 | 
			
		||||
    const bool homeZ = parser.seen('Z'),
 | 
			
		||||
    const bool homeZ = parser.seen_test('Z'),
 | 
			
		||||
               needX = homeZ && TERN0(Z_SAFE_HOMING, axes_should_home(_BV(X_AXIS))),
 | 
			
		||||
               needY = homeZ && TERN0(Z_SAFE_HOMING, axes_should_home(_BV(Y_AXIS))),
 | 
			
		||||
               homeX = needX || parser.seen('X'), homeY = needY || parser.seen('Y'),
 | 
			
		||||
               homeX = needX || parser.seen_test('X'), homeY = needY || parser.seen_test('Y'),
 | 
			
		||||
               home_all = homeX == homeY && homeX == homeZ, // All or None
 | 
			
		||||
               doX = home_all || homeX, doY = home_all || homeY, doZ = home_all || homeZ;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -395,7 +395,7 @@ void GcodeSuite::G33() {
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  const bool towers_set = !parser.seen('T');
 | 
			
		||||
  const bool towers_set = !parser.seen_test('T');
 | 
			
		||||
 | 
			
		||||
  const float calibration_precision = parser.floatval('C', 0.0f);
 | 
			
		||||
  if (calibration_precision < 0) {
 | 
			
		||||
@@ -415,7 +415,7 @@ void GcodeSuite::G33() {
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  const bool stow_after_each = parser.seen('E');
 | 
			
		||||
  const bool stow_after_each = parser.seen_test('E');
 | 
			
		||||
 | 
			
		||||
  const bool _0p_calibration      = probe_points == 0,
 | 
			
		||||
             _1p_calibration      = probe_points == 1 || probe_points == -1,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user