Scott Lahteine 4 роки тому
джерело
коміт
55e519a06f

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

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

+ 12
- 14
Marlin/src/module/stepper.cpp Переглянути файл

168
 
168
 
169
 #if EITHER(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN)
169
 #if EITHER(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN)
170
   bool Stepper::locked_Z_motor = false, Stepper::locked_Z2_motor = false
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
 #endif
178
 #endif
179
 
179
 
180
 uint32_t Stepper::acceleration_time, Stepper::deceleration_time;
180
 uint32_t Stepper::acceleration_time, Stepper::deceleration_time;
181
 uint8_t Stepper::steps_per_isr;
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
 xyze_long_t Stepper::delta_error{0};
185
 xyze_long_t Stepper::delta_error{0};
189
 
186
 
2099
       // No acceleration / deceleration time elapsed so far
2096
       // No acceleration / deceleration time elapsed so far
2100
       acceleration_time = deceleration_time = 0;
2097
       acceleration_time = deceleration_time = 0;
2101
 
2098
 
2102
-      uint8_t oversampling = 0;                           // Assume no axis smoothing (via oversampling)
2103
-
2104
       #if ENABLED(ADAPTIVE_STEP_SMOOTHING)
2099
       #if ENABLED(ADAPTIVE_STEP_SMOOTHING)
2100
+        uint8_t oversampling = 0;                           // Assume no axis smoothing (via oversampling)
2105
         // Decide if axis smoothing is possible
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
         while (max_rate < MIN_STEP_ISR_FREQUENCY) {         // As long as more ISRs are possible...
2103
         while (max_rate < MIN_STEP_ISR_FREQUENCY) {         // As long as more ISRs are possible...
2108
           max_rate <<= 1;                                   // Try to double the rate
2104
           max_rate <<= 1;                                   // Try to double the rate
2109
           if (max_rate >= MAX_STEP_ISR_FREQUENCY_1X) break; // Don't exceed the estimated ISR limit
2105
           if (max_rate >= MAX_STEP_ISR_FREQUENCY_1X) break; // Don't exceed the estimated ISR limit
2110
           ++oversampling;                                   // Increase the oversampling (used for left-shift)
2106
           ++oversampling;                                   // Increase the oversampling (used for left-shift)
2111
         }
2107
         }
2112
         oversampling_factor = oversampling;                 // For all timer interval calculations
2108
         oversampling_factor = oversampling;                 // For all timer interval calculations
2109
+      #else
2110
+        constexpr uint8_t oversampling = 0;
2113
       #endif
2111
       #endif
2114
 
2112
 
2115
       // Based on the oversampling factor, do the calculations
2113
       // Based on the oversampling factor, do the calculations

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

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

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

907
           SERIAL_ECHOPAIR(STR_PID_DEBUG, ee, STR_PID_DEBUG_INPUT, temp_hotend[ee].celsius, STR_PID_DEBUG_OUTPUT, pid_output);
907
           SERIAL_ECHOPAIR(STR_PID_DEBUG, ee, STR_PID_DEBUG_INPUT, temp_hotend[ee].celsius, STR_PID_DEBUG_OUTPUT, pid_output);
908
           #if DISABLED(PID_OPENLOOP)
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
               #if ENABLED(PID_EXTRUSION_SCALING)
914
               #if ENABLED(PID_EXTRUSION_SCALING)
912
                 , STR_PID_DEBUG_CTERM, work_pid[ee].Kc
915
                 , STR_PID_DEBUG_CTERM, work_pid[ee].Kc
913
               #endif
916
               #endif

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