Browse Source

General cleanup

Scott Lahteine 3 years ago
parent
commit
55e519a06f

+ 1
- 3
Marlin/src/lcd/menu/menu_motion.cpp View File

@@ -139,9 +139,7 @@ void lcd_move_z() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Z), Z_AXIS); }
139 139
       ui.encoderPosition = 0;
140 140
     }
141 141
     if (ui.should_draw()) {
142
-      #if MULTI_MANUAL
143
-        MenuItemBase::init(eindex);
144
-      #endif
142
+      TERN_(MULTI_MANUAL, MenuItemBase::init(eindex));
145 143
       MenuEditItemBase::draw_edit_screen(
146 144
         GET_TEXT(TERN(MULTI_MANUAL, MSG_MOVE_EN, MSG_MOVE_E)),
147 145
         ftostr41sign(current_position.e

+ 12
- 14
Marlin/src/module/stepper.cpp View File

@@ -168,22 +168,19 @@ bool Stepper::abort_current_block;
168 168
 
169 169
 #if EITHER(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN)
170 170
   bool Stepper::locked_Z_motor = false, Stepper::locked_Z2_motor = false
171
-       #if NUM_Z_STEPPER_DRIVERS >= 3
172
-         , Stepper::locked_Z3_motor = false
173
-         #if NUM_Z_STEPPER_DRIVERS >= 4
174
-           , Stepper::locked_Z4_motor = false
175
-         #endif
176
-       #endif
177
-       ;
171
+    #if NUM_Z_STEPPER_DRIVERS >= 3
172
+      , Stepper::locked_Z3_motor = false
173
+      #if NUM_Z_STEPPER_DRIVERS >= 4
174
+        , Stepper::locked_Z4_motor = false
175
+      #endif
176
+    #endif
177
+  ;
178 178
 #endif
179 179
 
180 180
 uint32_t Stepper::acceleration_time, Stepper::deceleration_time;
181 181
 uint8_t Stepper::steps_per_isr;
182 182
 
183
-#if DISABLED(ADAPTIVE_STEP_SMOOTHING)
184
-  constexpr
185
-#endif
186
-    uint8_t Stepper::oversampling_factor;
183
+TERN(ADAPTIVE_STEP_SMOOTHING,,constexpr) uint8_t Stepper::oversampling_factor;
187 184
 
188 185
 xyze_long_t Stepper::delta_error{0};
189 186
 
@@ -2099,17 +2096,18 @@ uint32_t Stepper::block_phase_isr() {
2099 2096
       // No acceleration / deceleration time elapsed so far
2100 2097
       acceleration_time = deceleration_time = 0;
2101 2098
 
2102
-      uint8_t oversampling = 0;                           // Assume no axis smoothing (via oversampling)
2103
-
2104 2099
       #if ENABLED(ADAPTIVE_STEP_SMOOTHING)
2100
+        uint8_t oversampling = 0;                           // Assume no axis smoothing (via oversampling)
2105 2101
         // Decide if axis smoothing is possible
2106
-        uint32_t max_rate = current_block->nominal_rate;  // Get the maximum rate (maximum event speed)
2102
+        uint32_t max_rate = current_block->nominal_rate;    // Get the maximum rate (maximum event speed)
2107 2103
         while (max_rate < MIN_STEP_ISR_FREQUENCY) {         // As long as more ISRs are possible...
2108 2104
           max_rate <<= 1;                                   // Try to double the rate
2109 2105
           if (max_rate >= MAX_STEP_ISR_FREQUENCY_1X) break; // Don't exceed the estimated ISR limit
2110 2106
           ++oversampling;                                   // Increase the oversampling (used for left-shift)
2111 2107
         }
2112 2108
         oversampling_factor = oversampling;                 // For all timer interval calculations
2109
+      #else
2110
+        constexpr uint8_t oversampling = 0;
2113 2111
       #endif
2114 2112
 
2115 2113
       // Based on the oversampling factor, do the calculations

+ 1
- 2
Marlin/src/module/stepper.h View File

@@ -191,7 +191,6 @@
191 191
   #error "Expected at least one of MINIMUM_STEPPER_PULSE or MAXIMUM_STEPPER_RATE to be defined"
192 192
 #endif
193 193
 
194
-
195 194
 // But the user could be enforcing a minimum time, so the loop time is
196 195
 #define ISR_LOOP_CYCLES (ISR_LOOP_BASE_CYCLES + _MAX(MIN_STEPPER_PULSE_CYCLES, MIN_ISR_LOOP_CYCLES))
197 196
 
@@ -558,7 +557,7 @@ class Stepper {
558 557
         // In case of high-performance processor, it is able to calculate in real-time
559 558
         timer = uint32_t(STEPPER_TIMER_RATE) / step_rate;
560 559
       #else
561
-        constexpr uint32_t min_step_rate = F_CPU / 500000U;
560
+        constexpr uint32_t min_step_rate = (F_CPU) / 500000U;
562 561
         NOLESS(step_rate, min_step_rate);
563 562
         step_rate -= min_step_rate; // Correct for minimal speed
564 563
         if (step_rate >= (8 * 256)) { // higher step rate

+ 4
- 1
Marlin/src/module/temperature.cpp View File

@@ -907,7 +907,10 @@ void Temperature::min_temp_error(const heater_ind_t heater) {
907 907
           SERIAL_ECHOPAIR(STR_PID_DEBUG, ee, STR_PID_DEBUG_INPUT, temp_hotend[ee].celsius, STR_PID_DEBUG_OUTPUT, pid_output);
908 908
           #if DISABLED(PID_OPENLOOP)
909 909
           {
910
-            SERIAL_ECHOPAIR( STR_PID_DEBUG_PTERM, work_pid[ee].Kp, STR_PID_DEBUG_ITERM, work_pid[ee].Ki, STR_PID_DEBUG_DTERM, work_pid[ee].Kd
910
+            SERIAL_ECHOPAIR(
911
+              STR_PID_DEBUG_PTERM, work_pid[ee].Kp,
912
+              STR_PID_DEBUG_ITERM, work_pid[ee].Ki,
913
+              STR_PID_DEBUG_DTERM, work_pid[ee].Kd
911 914
               #if ENABLED(PID_EXTRUSION_SCALING)
912 915
                 , STR_PID_DEBUG_CTERM, work_pid[ee].Kc
913 916
               #endif

Loading…
Cancel
Save