Sfoglia il codice sorgente

Cleanup of spacing and formatting

Scott Lahteine 8 anni fa
parent
commit
e4937b0285

+ 15
- 10
Marlin/Marlin_main.cpp Vedi File

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

+ 1
- 1
Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h Vedi File

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

+ 1
- 1
Marlin/example_configurations/M150/Configuration.h Vedi File

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

+ 2
- 2
Marlin/example_configurations/M150/README.md Vedi File

1
 # Configuration for Malyan M150 hobbyking printer
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 Vedi File

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

+ 1
- 1
Marlin/pins_AZTEEG_X3.h Vedi File

74
 //
74
 //
75
 // Misc
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
   #undef STAT_LED_RED_PIN
78
   #undef STAT_LED_RED_PIN
79
 #endif
79
 #endif
80
 
80
 

+ 1
- 1
Marlin/pins_AZTEEG_X3_PRO.h Vedi File

145
 //
145
 //
146
 // Misc. Functions
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
   #undef DOGLCD_A0            // steal pin 44 for the case light; if you have a Viki2 and have connected it
149
   #undef DOGLCD_A0            // steal pin 44 for the case light; if you have a Viki2 and have connected it
150
   #define DOGLCD_A0      57   // following the Panucatt wiring diagram, you may need to tweak these pin assignments
150
   #define DOGLCD_A0      57   // following the Panucatt wiring diagram, you may need to tweak these pin assignments
151
                                 // as the wiring diagram uses pin 44 for DOGLCD_A0
151
                                 // as the wiring diagram uses pin 44 for DOGLCD_A0

+ 1
- 1
Marlin/stepper.cpp Vedi File

586
     /**
586
     /**
587
      * If a minimum pulse time was specified get the timer 0 value.
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
      * That's every 0.5µs on 16MHz and every 0.4µs on 20MHz.
590
      * That's every 0.5µs on 16MHz and every 0.4µs on 20MHz.
591
      * 20 counts of TCNT0 -by itself- is a good pulse delay.
591
      * 20 counts of TCNT0 -by itself- is a good pulse delay.
592
      * 10µs = 160 or 200 cycles.
592
      * 10µs = 160 or 200 cycles.

Loading…
Annulla
Salva