Переглянути джерело

🎨 Apply shorthand and cleanups

Scott Lahteine 3 роки тому
джерело
коміт
d71b35c24f

+ 2
- 6
Marlin/src/feature/caselight.cpp Переглянути файл

@@ -44,10 +44,6 @@ bool CaseLight::on = CASE_LIGHT_DEFAULT_ON;
44 44
   LEDColor CaseLight::color = { init_case_light[0], init_case_light[1], init_case_light[2], TERN_(HAS_WHITE_LED, init_case_light[3]) };
45 45
 #endif
46 46
 
47
-#ifndef INVERT_CASE_LIGHT
48
-  #define INVERT_CASE_LIGHT false
49
-#endif
50
-
51 47
 void CaseLight::update(const bool sflag) {
52 48
   #if CASELIGHT_USES_BRIGHTNESS
53 49
     /**
@@ -64,7 +60,7 @@ void CaseLight::update(const bool sflag) {
64 60
     if (sflag && on)
65 61
       brightness = brightness_sav;  // Restore last brightness for M355 S1
66 62
 
67
-    const uint8_t i = on ? brightness : 0, n10ct = INVERT_CASE_LIGHT ? 255 - i : i;
63
+    const uint8_t i = on ? brightness : 0, n10ct = ENABLED(INVERT_CASE_LIGHT) ? 255 - i : i;
68 64
     UNUSED(n10ct);
69 65
   #endif
70 66
 
@@ -86,7 +82,7 @@ void CaseLight::update(const bool sflag) {
86 82
       else
87 83
     #endif
88 84
       {
89
-        const bool s = on ? !INVERT_CASE_LIGHT : INVERT_CASE_LIGHT;
85
+        const bool s = on ? TERN(INVERT_CASE_LIGHT, LOW, HIGH) : TERN(INVERT_CASE_LIGHT, HIGH, LOW);
90 86
         WRITE(CASE_LIGHT_PIN, s ? HIGH : LOW);
91 87
       }
92 88
 

+ 1
- 1
Marlin/src/feature/dac/stepper_dac.cpp Переглянути файл

@@ -51,7 +51,7 @@ int StepperDAC::init() {
51 51
   mcp4728.setVref_all(DAC_STEPPER_VREF);
52 52
   mcp4728.setGain_all(DAC_STEPPER_GAIN);
53 53
 
54
-  if (mcp4728.getDrvPct(0) < 1 || mcp4728.getDrvPct(1) < 1 || mcp4728.getDrvPct(2) < 1 || mcp4728.getDrvPct(3) < 1 ) {
54
+  if (mcp4728.getDrvPct(0) < 1 || mcp4728.getDrvPct(1) < 1 || mcp4728.getDrvPct(2) < 1 || mcp4728.getDrvPct(3) < 1) {
55 55
     mcp4728.setDrvPct(dac_channel_pct);
56 56
     mcp4728.eepromWrite();
57 57
   }

+ 1
- 1
Marlin/src/gcode/gcode.cpp Переглянути файл

@@ -566,7 +566,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
566 566
       #endif
567 567
 
568 568
       #if ENABLED(AUTO_REPORT_POSITION)
569
-        case 154: M154(); break;                                  // M155: Set position auto-report interval
569
+        case 154: M154(); break;                                  // M154: Set position auto-report interval
570 570
       #endif
571 571
 
572 572
       #if BOTH(AUTO_REPORT_TEMPERATURES, HAS_TEMP_SENSOR)

+ 3
- 18
Marlin/src/libs/L64XX/L64XX_Marlin.cpp Переглянути файл

@@ -445,12 +445,7 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
445 445
       position_min = X_center - displacement;
446 446
       position_max = X_center + displacement;
447 447
       echo_min_max('X', position_min, position_max);
448
-      if (false
449
-        #if HAS_ENDSTOPS
450
-          || position_min < (X_MIN_POS)
451
-          || position_max > (X_MAX_POS)
452
-        #endif
453
-      ) {
448
+      if (TERN0(HAS_ENDSTOPS, position_min < (X_MIN_POS) || position_max > (X_MAX_POS))) {
454 449
         err_out_of_bounds();
455 450
         return true;
456 451
       }
@@ -460,12 +455,7 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
460 455
       position_min = Y_center - displacement;
461 456
       position_max = Y_center + displacement;
462 457
       echo_min_max('Y', position_min, position_max);
463
-      if (false
464
-        #if HAS_ENDSTOPS
465
-          || position_min < (Y_MIN_POS)
466
-          || position_max > (Y_MAX_POS)
467
-        #endif
468
-      ) {
458
+      if (TERN0(HAS_ENDSTOPS, position_min < (Y_MIN_POS) || position_max > (Y_MAX_POS))) {
469 459
         err_out_of_bounds();
470 460
         return true;
471 461
       }
@@ -475,12 +465,7 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
475 465
       position_min = Z_center - displacement;
476 466
       position_max = Z_center + displacement;
477 467
       echo_min_max('Z', position_min, position_max);
478
-      if (false
479
-        #if HAS_ENDSTOPS
480
-          || position_min < (Z_MIN_POS)
481
-          || position_max > (Z_MAX_POS)
482
-        #endif
483
-      ) {
468
+      if (TERN0(HAS_ENDSTOPS, position_min < (Z_MIN_POS) || position_max > (Z_MAX_POS))) {
484 469
         err_out_of_bounds();
485 470
         return true;
486 471
       }

+ 3
- 3
Marlin/src/module/planner.h Переглянути файл

@@ -491,7 +491,7 @@ class Planner {
491 491
     #if HAS_CLASSIC_JERK
492 492
       static void set_max_jerk(const AxisEnum axis, float inMaxJerkMMS);
493 493
     #else
494
-      static inline void set_max_jerk(const AxisEnum, const_float_t ) {}
494
+      static inline void set_max_jerk(const AxisEnum, const_float_t) {}
495 495
     #endif
496 496
 
497 497
     #if HAS_EXTRUDERS
@@ -592,9 +592,9 @@ class Planner {
592 592
 
593 593
     #else
594 594
 
595
-      FORCE_INLINE static float fade_scaling_factor_for_z(const_float_t ) { return 1; }
595
+      FORCE_INLINE static float fade_scaling_factor_for_z(const_float_t) { return 1; }
596 596
 
597
-      FORCE_INLINE static bool leveling_active_at_z(const_float_t ) { return true; }
597
+      FORCE_INLINE static bool leveling_active_at_z(const_float_t) { return true; }
598 598
 
599 599
     #endif
600 600
 

Завантаження…
Відмінити
Зберегти