Преглед на файлове

Cleanup of spacing and formatting

Scott Lahteine преди 7 години
родител
ревизия
e4937b0285

+ 15
- 10
Marlin/Marlin_main.cpp Целия файл

@@ -1551,7 +1551,7 @@ inline void set_destination_to_current() { COPY(destination, current_position);
1551 1551
 
1552 1552
       planner.buffer_line_kinematic(destination, MMS_SCALED(fr_mm_s ? fr_mm_s : feedrate_mm_s), active_extruder);
1553 1553
     #endif
1554
-    
1554
+
1555 1555
     set_current_to_destination();
1556 1556
   }
1557 1557
 #endif // IS_KINEMATIC
@@ -2362,7 +2362,7 @@ static void clean_up_after_endstop_or_probe_move() {
2362 2362
           else {                                        // leveling from off to on
2363 2363
             ubl.state.active = true;                    // enable BEFORE calling unapply_leveling, otherwise ignored
2364 2364
             // change physical current_position to unleveled current_position without moving steppers.
2365
-            planner.unapply_leveling(current_position); 
2365
+            planner.unapply_leveling(current_position);
2366 2366
           }
2367 2367
         #else
2368 2368
           ubl.state.active = enable;                    // just flip the bit, current_position will be wrong until next move.
@@ -2376,8 +2376,12 @@ static void clean_up_after_endstop_or_probe_move() {
2376 2376
           (void)bilinear_z_offset(reset);
2377 2377
         #endif
2378 2378
 
2379
+        // Enable or disable leveling compensation in the planner
2379 2380
         planner.abl_enabled = enable;
2381
+
2380 2382
         if (!enable)
2383
+          // When disabling just get the current position from the steppers.
2384
+          // This will yield the smallest error when first converted back to steps.
2381 2385
           set_current_from_steppers_for_axis(
2382 2386
             #if ABL_PLANAR
2383 2387
               ALL_AXES
@@ -2386,9 +2390,11 @@ static void clean_up_after_endstop_or_probe_move() {
2386 2390
             #endif
2387 2391
           );
2388 2392
         else
2393
+          // When enabling, remove compensation from the current position,
2394
+          // so compensation will give the right stepper counts.
2389 2395
           planner.unapply_leveling(current_position);
2390 2396
 
2391
-      #endif
2397
+      #endif // ABL
2392 2398
     }
2393 2399
   }
2394 2400
 
@@ -2396,24 +2402,23 @@ static void clean_up_after_endstop_or_probe_move() {
2396 2402
 
2397 2403
     void set_z_fade_height(const float zfh) {
2398 2404
 
2405
+      const bool level_active = leveling_is_active();
2406
+
2399 2407
       #if ENABLED(AUTO_BED_LEVELING_UBL)
2400 2408
 
2401
-        const bool level_active = leveling_is_active();
2402
-        if (level_active) {
2409
+        if (level_active)
2403 2410
           set_bed_leveling_enabled(false);  // turn off before changing fade height for proper apply/unapply leveling to maintain current_position
2404
-        }
2405 2411
         planner.z_fade_height = zfh;
2406 2412
         planner.inverse_z_fade_height = RECIPROCAL(zfh);
2407
-        if (level_active) {
2413
+        if (level_active)
2408 2414
           set_bed_leveling_enabled(true);  // turn back on after changing fade height
2409
-        }
2410 2415
 
2411 2416
       #else
2412 2417
 
2413 2418
         planner.z_fade_height = zfh;
2414 2419
         planner.inverse_z_fade_height = RECIPROCAL(zfh);
2415 2420
 
2416
-        if (leveling_is_active()) {
2421
+        if (level_active) {
2417 2422
           set_current_from_steppers_for_axis(
2418 2423
             #if ABL_PLANAR
2419 2424
               ALL_AXES
@@ -9643,7 +9648,7 @@ inline void gcode_M355() {
9643 9648
   #if HAS_CASE_LIGHT
9644 9649
     uint8_t args = 0;
9645 9650
     if (parser.seen('P')) ++args, case_light_brightness = parser.value_byte();
9646
-    if (parser.seen('S')) ++args, case_light_on = parser.value_bool(); 
9651
+    if (parser.seen('S')) ++args, case_light_on = parser.value_bool();
9647 9652
     if (args) update_case_light();
9648 9653
 
9649 9654
     // always report case light status

+ 1
- 1
Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h Целия файл

@@ -788,7 +788,7 @@
788 788
   #define PAUSE_PARK_Z_FEEDRATE 5             // Z axis feedrate in mm/s (not used for delta printers)
789 789
   #define PAUSE_PARK_RETRACT_FEEDRATE 60      // Initial retract feedrate in mm/s
790 790
   #define PAUSE_PARK_RETRACT_LENGTH 2         // Initial retract in mm
791
- 
791
+
792 792
                                               // It is a short retract used immediately after print interrupt before move to filament exchange position
793 793
   #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10  // Unload filament feedrate in mm/s - filament unloading can be fast
794 794
   #define FILAMENT_CHANGE_UNLOAD_LENGTH 100   // Unload filament length from hotend in mm

+ 1
- 1
Marlin/example_configurations/M150/Configuration.h Целия файл

@@ -318,7 +318,7 @@
318 318
   #define K1 0.95 //smoothing factor within the PID
319 319
 
320 320
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
321
-  
321
+
322 322
   // Malyan M150 example
323 323
   #define  DEFAULT_Kp 29
324 324
   #define  DEFAULT_Ki 2

+ 2
- 2
Marlin/example_configurations/M150/README.md Целия файл

@@ -1,3 +1,3 @@
1 1
 # Configuration for Malyan M150 hobbyking printer
2
-# config without automatic bed level sensor 
3
-# or in other words, "as stock" 
2
+# config without automatic bed level sensor
3
+# or in other words, "as stock"

+ 1
- 1
Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h Целия файл

@@ -788,7 +788,7 @@
788 788
   #define PAUSE_PARK_Z_FEEDRATE 5             // Z axis feedrate in mm/s (not used for delta printers)
789 789
   #define PAUSE_PARK_RETRACT_FEEDRATE 60      // Initial retract feedrate in mm/s
790 790
   #define PAUSE_PARK_RETRACT_LENGTH 2         // Initial retract in mm
791
- 
791
+
792 792
                                               // It is a short retract used immediately after print interrupt before move to filament exchange position
793 793
   #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10  // Unload filament feedrate in mm/s - filament unloading can be fast
794 794
   #define FILAMENT_CHANGE_UNLOAD_LENGTH 100   // Unload filament length from hotend in mm

+ 1
- 1
Marlin/pins_AZTEEG_X3.h Целия файл

@@ -74,7 +74,7 @@
74 74
 //
75 75
 // Misc
76 76
 //
77
-#if ENABLED(CASE_LIGHT_ENABLE)  && PIN_EXISTS(CASE_LIGHT) && PIN_EXISTS(STAT_LED_RED) && STAT_LED_RED_PIN == CASE_LIGHT_PIN 
77
+#if ENABLED(CASE_LIGHT_ENABLE)  && PIN_EXISTS(CASE_LIGHT) && PIN_EXISTS(STAT_LED_RED) && STAT_LED_RED_PIN == CASE_LIGHT_PIN
78 78
   #undef STAT_LED_RED_PIN
79 79
 #endif
80 80
 

+ 1
- 1
Marlin/pins_AZTEEG_X3_PRO.h Целия файл

@@ -145,7 +145,7 @@
145 145
 //
146 146
 // Misc. Functions
147 147
 //
148
-#if ENABLED(CASE_LIGHT_ENABLE)  && PIN_EXISTS(CASE_LIGHT) && defined(DOGLCD_A0) && DOGLCD_A0 == CASE_LIGHT_PIN 
148
+#if ENABLED(CASE_LIGHT_ENABLE)  && PIN_EXISTS(CASE_LIGHT) && defined(DOGLCD_A0) && DOGLCD_A0 == CASE_LIGHT_PIN
149 149
   #undef DOGLCD_A0            // steal pin 44 for the case light; if you have a Viki2 and have connected it
150 150
   #define DOGLCD_A0      57   // following the Panucatt wiring diagram, you may need to tweak these pin assignments
151 151
                                 // as the wiring diagram uses pin 44 for DOGLCD_A0

+ 1
- 1
Marlin/stepper.cpp Целия файл

@@ -586,7 +586,7 @@ void Stepper::isr() {
586 586
     /**
587 587
      * If a minimum pulse time was specified get the timer 0 value.
588 588
      *
589
-     * TCNT0 has an 8x prescaler, so it increments every 8 cycles. 
589
+     * TCNT0 has an 8x prescaler, so it increments every 8 cycles.
590 590
      * That's every 0.5µs on 16MHz and every 0.4µs on 20MHz.
591 591
      * 20 counts of TCNT0 -by itself- is a good pulse delay.
592 592
      * 10µs = 160 or 200 cycles.

Loading…
Отказ
Запис