Browse Source

Merge pull request #6965 from thinkyhead/bf_save_more_sram

Use createChar_P to save SRAM in bootscreen
Scott Lahteine 8 years ago
parent
commit
1419126721
67 changed files with 785 additions and 665 deletions
  1. 1
    1
      Marlin/Conditionals_LCD.h
  2. 4
    2
      Marlin/Configuration.h
  3. 10
    12
      Marlin/Configuration_adv.h
  4. 8
    8
      Marlin/G26_Mesh_Validation_Tool.cpp
  5. 141
    142
      Marlin/Marlin_main.cpp
  6. 209
    165
      Marlin/SanityCheck.h
  7. 1
    1
      Marlin/buzzer.h
  8. 11
    11
      Marlin/configuration_store.cpp
  9. 36
    21
      Marlin/digipot_mcp4018.cpp
  10. 6
    6
      Marlin/digipot_mcp4451.cpp
  11. 4
    2
      Marlin/example_configurations/Cartesio/Configuration.h
  12. 5
    5
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  13. 4
    2
      Marlin/example_configurations/Felix/Configuration.h
  14. 5
    5
      Marlin/example_configurations/Felix/Configuration_adv.h
  15. 4
    2
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  16. 4
    2
      Marlin/example_configurations/FolgerTech-i3-2020/Configuration.h
  17. 5
    5
      Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h
  18. 4
    2
      Marlin/example_configurations/Hephestos/Configuration.h
  19. 5
    5
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  20. 4
    2
      Marlin/example_configurations/Hephestos_2/Configuration.h
  21. 5
    6
      Marlin/example_configurations/Hephestos_2/Configuration_adv.h
  22. 4
    2
      Marlin/example_configurations/K8200/Configuration.h
  23. 5
    5
      Marlin/example_configurations/K8200/Configuration_adv.h
  24. 4
    2
      Marlin/example_configurations/K8400/Configuration.h
  25. 5
    5
      Marlin/example_configurations/K8400/Configuration_adv.h
  26. 4
    2
      Marlin/example_configurations/K8400/Dual-head/Configuration.h
  27. 4
    2
      Marlin/example_configurations/M150/Configuration.h
  28. 5
    5
      Marlin/example_configurations/M150/Configuration_adv.h
  29. 4
    2
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  30. 4
    2
      Marlin/example_configurations/RigidBot/Configuration.h
  31. 5
    5
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  32. 4
    2
      Marlin/example_configurations/SCARA/Configuration.h
  33. 5
    5
      Marlin/example_configurations/SCARA/Configuration_adv.h
  34. 4
    2
      Marlin/example_configurations/TAZ4/Configuration.h
  35. 5
    5
      Marlin/example_configurations/TAZ4/Configuration_adv.h
  36. 4
    2
      Marlin/example_configurations/TinyBoy2/Configuration.h
  37. 5
    5
      Marlin/example_configurations/TinyBoy2/Configuration_adv.h
  38. 4
    2
      Marlin/example_configurations/WITBOX/Configuration.h
  39. 5
    5
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  40. 4
    2
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  41. 10
    6
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h
  42. 5
    5
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
  43. 10
    6
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h
  44. 5
    5
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
  45. 10
    6
      Marlin/example_configurations/delta/generic/Configuration.h
  46. 5
    5
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  47. 10
    6
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  48. 5
    5
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  49. 10
    6
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  50. 5
    5
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  51. 10
    6
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  52. 5
    5
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  53. 4
    2
      Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h
  54. 5
    5
      Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h
  55. 4
    2
      Marlin/example_configurations/makibox/Configuration.h
  56. 4
    4
      Marlin/example_configurations/makibox/Configuration_adv.h
  57. 4
    2
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  58. 5
    5
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  59. 4
    2
      Marlin/example_configurations/wt150/Configuration.h
  60. 4
    4
      Marlin/example_configurations/wt150/Configuration_adv.h
  61. 3
    3
      Marlin/pins.h
  62. 10
    10
      Marlin/temperature.cpp
  63. 3
    2
      Marlin/ubl.h
  64. 23
    14
      Marlin/ubl_G29.cpp
  65. 8
    10
      Marlin/ubl_motion.cpp
  66. 17
    20
      Marlin/ultralcd.cpp
  67. 37
    45
      Marlin/ultralcd_impl_HD44780.h

+ 1
- 1
Marlin/Conditionals_LCD.h View File

@@ -243,7 +243,7 @@
243 243
     /* Custom characters defined in the first 8 characters of the LCD */
244 244
     #define LCD_BEDTEMP_CHAR     0x00  // Print only as a char. This will have 'unexpected' results when used in a string!
245 245
     #define LCD_DEGREE_CHAR      0x01
246
-    #define LCD_STR_THERMOMETER "\x02" // Too many places use preprocessor string concatination to change this to a char right now.
246
+    #define LCD_STR_THERMOMETER "\x02" // Still used with string concatenation
247 247
     #define LCD_UPLEVEL_CHAR     0x03
248 248
     #define LCD_REFRESH_CHAR     0x04
249 249
     #define LCD_STR_FOLDER      "\x05"

+ 4
- 2
Marlin/Configuration.h View File

@@ -881,12 +881,14 @@
881 881
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
882 882
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
883 883
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
884
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
885
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
884
+
885
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
886
+  #define UBL_PROBE_PT_1_Y 180
886 887
   #define UBL_PROBE_PT_2_X 39
887 888
   #define UBL_PROBE_PT_2_Y 20
888 889
   #define UBL_PROBE_PT_3_X 180
889 890
   #define UBL_PROBE_PT_3_Y 20
891
+
890 892
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
891 893
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
892 894
 

+ 10
- 12
Marlin/Configuration_adv.h View File

@@ -225,13 +225,11 @@
225 225
  */
226 226
 //#define CASE_LIGHT_ENABLE
227 227
 #if ENABLED(CASE_LIGHT_ENABLE)
228
-  #define CASE_LIGHT_PIN 4          // can be defined here or in the pins_XXX.h file for your board
229
-                                    //  pins_XXX.h file overrides this one
230
-  #define INVERT_CASE_LIGHT false             // set to true if case light is ON when pin is at 0
231
-  #define CASE_LIGHT_DEFAULT_ON true          // set default power up state to on or off
232
-  #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105   // set power up brightness 0-255 ( only used if on PWM
233
-                                              // and if CASE_LIGHT_DEFAULT is set to on
234
-  //#define MENU_ITEM_CASE_LIGHT              // Uncomment to have a Case Light entry in main menu
228
+  //#define CASE_LIGHT_PIN 4                  // Override the default pin if needed
229
+  #define INVERT_CASE_LIGHT false             // Set true if Case Light is ON when pin is LOW
230
+  #define CASE_LIGHT_DEFAULT_ON true          // Set default power-up state on
231
+  #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105   // Set default power-up brightness (0-255, requires PWM pin)
232
+  //#define MENU_ITEM_CASE_LIGHT              // Add a Case Light option to the LCD main menu
235 233
 #endif
236 234
 
237 235
 //===========================================================================
@@ -421,16 +419,16 @@
421 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
422 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
423 421
  */
424
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
425
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
426
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
427 425
 
428 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
429 427
 //#define DIGIPOT_I2C
430
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
431 429
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
432 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
433
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
431
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
434 432
 
435 433
 //===========================================================================
436 434
 //=============================Additional Features===========================

+ 8
- 8
Marlin/G26_Mesh_Validation_Tool.cpp View File

@@ -252,8 +252,8 @@
252 252
     // Move nozzle to the specified height for the first layer
253 253
     set_destination_to_current();
254 254
     destination[Z_AXIS] = g26_layer_height;
255
-    move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], 0.0);
256
-    move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], g26_ooze_amount);
255
+    move_to(destination, 0.0);
256
+    move_to(destination, g26_ooze_amount);
257 257
 
258 258
     has_control_of_lcd_panel = true;
259 259
     //debug_current_and_destination(PSTR("Starting G26 Mesh Validation Pattern."));
@@ -368,14 +368,14 @@
368 368
     destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES;
369 369
 
370 370
     //debug_current_and_destination(PSTR("ready to do Z-Raise."));
371
-    move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], 0); // Raise the nozzle
371
+    move_to(destination, 0); // Raise the nozzle
372 372
     //debug_current_and_destination(PSTR("done doing Z-Raise."));
373 373
 
374 374
     destination[X_AXIS] = g26_x_pos;                                               // Move back to the starting position
375 375
     destination[Y_AXIS] = g26_y_pos;
376 376
     //destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES;                        // Keep the nozzle where it is
377 377
 
378
-    move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], 0); // Move back to the starting position
378
+    move_to(destination, 0); // Move back to the starting position
379 379
     //debug_current_and_destination(PSTR("done doing X/Y move."));
380 380
 
381 381
     has_control_of_lcd_panel = false;     // Give back control of the LCD Panel!
@@ -554,16 +554,16 @@
554 554
 
555 555
   }
556 556
 
557
-  void unified_bed_leveling::retract_filament(float where[XYZE]) {
557
+  void unified_bed_leveling::retract_filament(const float where[XYZE]) {
558 558
     if (!g26_retracted) { // Only retract if we are not already retracted!
559 559
       g26_retracted = true;
560
-      move_to(where[X_AXIS], where[Y_AXIS], where[Z_AXIS], -1.0 * g26_retraction_multiplier);
560
+      move_to(where, -1.0 * g26_retraction_multiplier);
561 561
     }
562 562
   }
563 563
 
564
-  void unified_bed_leveling::recover_filament(float where[XYZE]) {
564
+  void unified_bed_leveling::recover_filament(const float where[XYZE]) {
565 565
     if (g26_retracted) { // Only un-retract if we are retracted.
566
-      move_to(where[X_AXIS], where[Y_AXIS], where[Z_AXIS], 1.2 * g26_retraction_multiplier);
566
+      move_to(where, 1.2 * g26_retraction_multiplier);
567 567
       g26_retracted = false;
568 568
     }
569 569
   }

+ 141
- 142
Marlin/Marlin_main.cpp View File

@@ -389,7 +389,7 @@ static const char *injected_commands_P = NULL;
389 389
  * Feed rates are often configured with mm/m
390 390
  * but the planner and stepper like mm/s units.
391 391
  */
392
-float constexpr homing_feedrate_mm_s[] = {
392
+static const float homing_feedrate_mm_s[] PROGMEM = {
393 393
   #if ENABLED(DELTA)
394 394
     MMM_TO_MMS(HOMING_FEEDRATE_Z), MMM_TO_MMS(HOMING_FEEDRATE_Z),
395 395
   #else
@@ -397,6 +397,8 @@ float constexpr homing_feedrate_mm_s[] = {
397 397
   #endif
398 398
   MMM_TO_MMS(HOMING_FEEDRATE_Z), 0
399 399
 };
400
+FORCE_INLINE float homing_feedrate(const AxisEnum a) { return pgm_read_float(&homing_feedrate_mm_s[a]); }
401
+
400 402
 float feedrate_mm_s = MMM_TO_MMS(1500.0);
401 403
 static float saved_feedrate_mm_s;
402 404
 int feedrate_percentage = 100, saved_feedrate_percentage,
@@ -458,7 +460,7 @@ volatile bool wait_for_heatup = true;
458 460
   volatile bool wait_for_user = false;
459 461
 #endif
460 462
 
461
-const char axis_codes[XYZE] = {'X', 'Y', 'Z', 'E'};
463
+const char axis_codes[XYZE] = { 'X', 'Y', 'Z', 'E' };
462 464
 
463 465
 // Number of characters read in the current line of serial input
464 466
 static int serial_count = 0;
@@ -660,8 +662,8 @@ static bool send_ok[BUFSIZE];
660 662
   #define host_keepalive() NOOP
661 663
 #endif
662 664
 
663
-static inline float pgm_read_any(const float *p) { return pgm_read_float_near(p); }
664
-static inline signed char pgm_read_any(const signed char *p) { return pgm_read_byte_near(p); }
665
+FORCE_INLINE float pgm_read_any(const float *p) { return pgm_read_float_near(p); }
666
+FORCE_INLINE signed char pgm_read_any(const signed char *p) { return pgm_read_byte_near(p); }
665 667
 
666 668
 #define XYZ_CONSTS_FROM_CONFIG(type, array, CONFIG) \
667 669
   static const PROGMEM type array##_P[XYZ] = { X_##CONFIG, Y_##CONFIG, Z_##CONFIG }; \
@@ -780,7 +782,7 @@ extern "C" {
780 782
 #endif // !SDSUPPORT
781 783
 
782 784
 #if ENABLED(DIGIPOT_I2C)
783
-  extern void digipot_i2c_set_current(int channel, float current);
785
+  extern void digipot_i2c_set_current(uint8_t channel, float current);
784 786
   extern void digipot_i2c_init();
785 787
 #endif
786 788
 
@@ -1394,7 +1396,7 @@ bool get_target_extruder_from_command(int code) {
1394 1396
  *
1395 1397
  * Callers must sync the planner position after calling this!
1396 1398
  */
1397
-static void set_axis_is_at_home(AxisEnum axis) {
1399
+static void set_axis_is_at_home(const AxisEnum axis) {
1398 1400
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1399 1401
     if (DEBUGGING(LEVELING)) {
1400 1402
       SERIAL_ECHOPAIR(">>> set_axis_is_at_home(", axis_codes[axis]);
@@ -1496,31 +1498,30 @@ static void set_axis_is_at_home(AxisEnum axis) {
1496 1498
 /**
1497 1499
  * Some planner shorthand inline functions
1498 1500
  */
1499
-inline float get_homing_bump_feedrate(AxisEnum axis) {
1500
-  int constexpr homing_bump_divisor[] = HOMING_BUMP_DIVISOR;
1501
-  int hbd = homing_bump_divisor[axis];
1501
+inline float get_homing_bump_feedrate(const AxisEnum axis) {
1502
+  const uint8_t homing_bump_divisor[] PROGMEM = HOMING_BUMP_DIVISOR;
1503
+  uint8_t hbd = pgm_read_byte(&homing_bump_divisor[axis]);
1502 1504
   if (hbd < 1) {
1503 1505
     hbd = 10;
1504 1506
     SERIAL_ECHO_START;
1505 1507
     SERIAL_ECHOLNPGM("Warning: Homing Bump Divisor < 1");
1506 1508
   }
1507
-  return homing_feedrate_mm_s[axis] / hbd;
1509
+  return homing_feedrate(axis) / hbd;
1508 1510
 }
1509 1511
 
1510
-//
1511
-// line_to_current_position
1512
-// Move the planner to the current position from wherever it last moved
1513
-// (or from wherever it has been told it is located).
1514
-//
1512
+/**
1513
+ * Move the planner to the current position from wherever it last moved
1514
+ * (or from wherever it has been told it is located).
1515
+ */
1515 1516
 inline void line_to_current_position() {
1516 1517
   planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate_mm_s, active_extruder);
1517 1518
 }
1518 1519
 
1519
-//
1520
-// line_to_destination
1521
-// Move the planner, not necessarily synced with current_position
1522
-//
1523
-inline void line_to_destination(float fr_mm_s) {
1520
+/**
1521
+ * Move the planner to the position stored in the destination array, which is
1522
+ * used by G0/G1/G2/G3/G5 and many other functions to set a destination.
1523
+ */
1524
+inline void line_to_destination(const float fr_mm_s) {
1524 1525
   planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], fr_mm_s, active_extruder);
1525 1526
 }
1526 1527
 inline void line_to_destination() { line_to_destination(feedrate_mm_s); }
@@ -1560,16 +1561,16 @@ inline void set_destination_to_current() { COPY(destination, current_position);
1560 1561
  *  Plan a move to (X, Y, Z) and set the current_position
1561 1562
  *  The final current_position may not be the one that was requested
1562 1563
  */
1563
-void do_blocking_move_to(const float &x, const float &y, const float &z, const float &fr_mm_s /*=0.0*/) {
1564
+void do_blocking_move_to(const float &lx, const float &ly, const float &lz, const float &fr_mm_s/*=0.0*/) {
1564 1565
   const float old_feedrate_mm_s = feedrate_mm_s;
1565 1566
 
1566 1567
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1567
-    if (DEBUGGING(LEVELING)) print_xyz(PSTR(">>> do_blocking_move_to"), NULL, x, y, z);
1568
+    if (DEBUGGING(LEVELING)) print_xyz(PSTR(">>> do_blocking_move_to"), NULL, lx, ly, lz);
1568 1569
   #endif
1569 1570
 
1570 1571
   #if ENABLED(DELTA)
1571 1572
 
1572
-    if (!position_is_reachable_xy(x, y)) return;
1573
+    if (!position_is_reachable_xy(lx, ly)) return;
1573 1574
 
1574 1575
     feedrate_mm_s = fr_mm_s ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S;
1575 1576
 
@@ -1581,10 +1582,10 @@ void do_blocking_move_to(const float &x, const float &y, const float &z, const f
1581 1582
 
1582 1583
     // when in the danger zone
1583 1584
     if (current_position[Z_AXIS] > delta_clip_start_height) {
1584
-      if (z > delta_clip_start_height) {   // staying in the danger zone
1585
-        destination[X_AXIS] = x;           // move directly (uninterpolated)
1586
-        destination[Y_AXIS] = y;
1587
-        destination[Z_AXIS] = z;
1585
+      if (lz > delta_clip_start_height) {   // staying in the danger zone
1586
+        destination[X_AXIS] = lx;           // move directly (uninterpolated)
1587
+        destination[Y_AXIS] = ly;
1588
+        destination[Z_AXIS] = lz;
1588 1589
         prepare_uninterpolated_move_to_destination(); // set_current_to_destination
1589 1590
         #if ENABLED(DEBUG_LEVELING_FEATURE)
1590 1591
           if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position);
@@ -1600,23 +1601,23 @@ void do_blocking_move_to(const float &x, const float &y, const float &z, const f
1600 1601
       }
1601 1602
     }
1602 1603
 
1603
-    if (z > current_position[Z_AXIS]) {    // raising?
1604
-      destination[Z_AXIS] = z;
1604
+    if (lz > current_position[Z_AXIS]) {    // raising?
1605
+      destination[Z_AXIS] = lz;
1605 1606
       prepare_uninterpolated_move_to_destination();   // set_current_to_destination
1606 1607
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1607 1608
         if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position);
1608 1609
       #endif
1609 1610
     }
1610 1611
 
1611
-    destination[X_AXIS] = x;
1612
-    destination[Y_AXIS] = y;
1612
+    destination[X_AXIS] = lx;
1613
+    destination[Y_AXIS] = ly;
1613 1614
     prepare_move_to_destination();         // set_current_to_destination
1614 1615
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1615 1616
       if (DEBUGGING(LEVELING)) DEBUG_POS("xy move", current_position);
1616 1617
     #endif
1617 1618
 
1618
-    if (z < current_position[Z_AXIS]) {    // lowering?
1619
-      destination[Z_AXIS] = z;
1619
+    if (lz < current_position[Z_AXIS]) {    // lowering?
1620
+      destination[Z_AXIS] = lz;
1620 1621
       prepare_uninterpolated_move_to_destination();   // set_current_to_destination
1621 1622
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1622 1623
         if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position);
@@ -1625,44 +1626,44 @@ void do_blocking_move_to(const float &x, const float &y, const float &z, const f
1625 1626
 
1626 1627
   #elif IS_SCARA
1627 1628
 
1628
-    if (!position_is_reachable_xy(x, y)) return;
1629
+    if (!position_is_reachable_xy(lx, ly)) return;
1629 1630
 
1630 1631
     set_destination_to_current();
1631 1632
 
1632 1633
     // If Z needs to raise, do it before moving XY
1633
-    if (destination[Z_AXIS] < z) {
1634
-      destination[Z_AXIS] = z;
1635
-      prepare_uninterpolated_move_to_destination(fr_mm_s ? fr_mm_s : homing_feedrate_mm_s[Z_AXIS]);
1634
+    if (destination[Z_AXIS] < lz) {
1635
+      destination[Z_AXIS] = lz;
1636
+      prepare_uninterpolated_move_to_destination(fr_mm_s ? fr_mm_s : homing_feedrate(Z_AXIS));
1636 1637
     }
1637 1638
 
1638
-    destination[X_AXIS] = x;
1639
-    destination[Y_AXIS] = y;
1639
+    destination[X_AXIS] = lx;
1640
+    destination[Y_AXIS] = ly;
1640 1641
     prepare_uninterpolated_move_to_destination(fr_mm_s ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S);
1641 1642
 
1642 1643
     // If Z needs to lower, do it after moving XY
1643
-    if (destination[Z_AXIS] > z) {
1644
-      destination[Z_AXIS] = z;
1645
-      prepare_uninterpolated_move_to_destination(fr_mm_s ? fr_mm_s : homing_feedrate_mm_s[Z_AXIS]);
1644
+    if (destination[Z_AXIS] > lz) {
1645
+      destination[Z_AXIS] = lz;
1646
+      prepare_uninterpolated_move_to_destination(fr_mm_s ? fr_mm_s : homing_feedrate(Z_AXIS));
1646 1647
     }
1647 1648
 
1648 1649
   #else
1649 1650
 
1650 1651
     // If Z needs to raise, do it before moving XY
1651
-    if (current_position[Z_AXIS] < z) {
1652
-      feedrate_mm_s = fr_mm_s ? fr_mm_s : homing_feedrate_mm_s[Z_AXIS];
1653
-      current_position[Z_AXIS] = z;
1652
+    if (current_position[Z_AXIS] < lz) {
1653
+      feedrate_mm_s = fr_mm_s ? fr_mm_s : homing_feedrate(Z_AXIS);
1654
+      current_position[Z_AXIS] = lz;
1654 1655
       line_to_current_position();
1655 1656
     }
1656 1657
 
1657 1658
     feedrate_mm_s = fr_mm_s ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S;
1658
-    current_position[X_AXIS] = x;
1659
-    current_position[Y_AXIS] = y;
1659
+    current_position[X_AXIS] = lx;
1660
+    current_position[Y_AXIS] = ly;
1660 1661
     line_to_current_position();
1661 1662
 
1662 1663
     // If Z needs to lower, do it after moving XY
1663
-    if (current_position[Z_AXIS] > z) {
1664
-      feedrate_mm_s = fr_mm_s ? fr_mm_s : homing_feedrate_mm_s[Z_AXIS];
1665
-      current_position[Z_AXIS] = z;
1664
+    if (current_position[Z_AXIS] > lz) {
1665
+      feedrate_mm_s = fr_mm_s ? fr_mm_s : homing_feedrate(Z_AXIS);
1666
+      current_position[Z_AXIS] = lz;
1666 1667
       line_to_current_position();
1667 1668
     }
1668 1669
 
@@ -1676,14 +1677,14 @@ void do_blocking_move_to(const float &x, const float &y, const float &z, const f
1676 1677
     if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< do_blocking_move_to");
1677 1678
   #endif
1678 1679
 }
1679
-void do_blocking_move_to_x(const float &x, const float &fr_mm_s/*=0.0*/) {
1680
-  do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_s);
1680
+void do_blocking_move_to_x(const float &lx, const float &fr_mm_s/*=0.0*/) {
1681
+  do_blocking_move_to(lx, current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_s);
1681 1682
 }
1682
-void do_blocking_move_to_z(const float &z, const float &fr_mm_s/*=0.0*/) {
1683
-  do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, fr_mm_s);
1683
+void do_blocking_move_to_z(const float &lz, const float &fr_mm_s/*=0.0*/) {
1684
+  do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], lz, fr_mm_s);
1684 1685
 }
1685
-void do_blocking_move_to_xy(const float &x, const float &y, const float &fr_mm_s/*=0.0*/) {
1686
-  do_blocking_move_to(x, y, current_position[Z_AXIS], fr_mm_s);
1686
+void do_blocking_move_to_xy(const float &lx, const float &ly, const float &fr_mm_s/*=0.0*/) {
1687
+  do_blocking_move_to(lx, ly, current_position[Z_AXIS], fr_mm_s);
1687 1688
 }
1688 1689
 
1689 1690
 //
@@ -1718,7 +1719,7 @@ static void clean_up_after_endstop_or_probe_move() {
1718 1719
   /**
1719 1720
    * Raise Z to a minimum height to make room for a probe to move
1720 1721
    */
1721
-  inline void do_probe_raise(float z_raise) {
1722
+  inline void do_probe_raise(const float z_raise) {
1722 1723
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1723 1724
       if (DEBUGGING(LEVELING)) {
1724 1725
         SERIAL_ECHOPAIR("do_probe_raise(", z_raise);
@@ -1800,6 +1801,10 @@ static void clean_up_after_endstop_or_probe_move() {
1800 1801
 
1801 1802
 #elif ENABLED(Z_PROBE_ALLEN_KEY)
1802 1803
 
1804
+  FORCE_INLINE void do_blocking_move_to(const float logical[XYZ], const float &fr_mm_s) {
1805
+    do_blocking_move_to(logical[X_AXIS], logical[Y_AXIS], logical[Z_AXIS], fr_mm_s);
1806
+  }
1807
+
1803 1808
   void run_deploy_moves_script() {
1804 1809
     #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Z)
1805 1810
       #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_X
@@ -1814,7 +1819,8 @@ static void clean_up_after_endstop_or_probe_move() {
1814 1819
       #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE
1815 1820
         #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE 0.0
1816 1821
       #endif
1817
-      do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_1_X, Z_PROBE_ALLEN_KEY_DEPLOY_1_Y, Z_PROBE_ALLEN_KEY_DEPLOY_1_Z, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE));
1822
+      const float deploy_1[] = { Z_PROBE_ALLEN_KEY_DEPLOY_1_X, Z_PROBE_ALLEN_KEY_DEPLOY_1_Y, Z_PROBE_ALLEN_KEY_DEPLOY_1_Z };
1823
+      do_blocking_move_to(deploy_1, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE));
1818 1824
     #endif
1819 1825
     #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_Z)
1820 1826
       #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_X
@@ -1829,7 +1835,8 @@ static void clean_up_after_endstop_or_probe_move() {
1829 1835
       #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE
1830 1836
         #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE 0.0
1831 1837
       #endif
1832
-      do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_2_X, Z_PROBE_ALLEN_KEY_DEPLOY_2_Y, Z_PROBE_ALLEN_KEY_DEPLOY_2_Z, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE));
1838
+      const float deploy_2[] = { Z_PROBE_ALLEN_KEY_DEPLOY_2_X, Z_PROBE_ALLEN_KEY_DEPLOY_2_Y, Z_PROBE_ALLEN_KEY_DEPLOY_2_Z };
1839
+      do_blocking_move_to(deploy_2, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE));
1833 1840
     #endif
1834 1841
     #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_Z)
1835 1842
       #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_X
@@ -1844,7 +1851,8 @@ static void clean_up_after_endstop_or_probe_move() {
1844 1851
       #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE
1845 1852
         #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE 0.0
1846 1853
       #endif
1847
-      do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_3_X, Z_PROBE_ALLEN_KEY_DEPLOY_3_Y, Z_PROBE_ALLEN_KEY_DEPLOY_3_Z, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE));
1854
+      const float deploy_3[] = { Z_PROBE_ALLEN_KEY_DEPLOY_3_X, Z_PROBE_ALLEN_KEY_DEPLOY_3_Y, Z_PROBE_ALLEN_KEY_DEPLOY_3_Z };
1855
+      do_blocking_move_to(deploy_3, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE));
1848 1856
     #endif
1849 1857
     #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_Z)
1850 1858
       #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_X
@@ -1859,7 +1867,8 @@ static void clean_up_after_endstop_or_probe_move() {
1859 1867
       #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE
1860 1868
         #define Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE 0.0
1861 1869
       #endif
1862
-      do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_4_X, Z_PROBE_ALLEN_KEY_DEPLOY_4_Y, Z_PROBE_ALLEN_KEY_DEPLOY_4_Z, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE));
1870
+      const float deploy_4[] = { Z_PROBE_ALLEN_KEY_DEPLOY_4_X, Z_PROBE_ALLEN_KEY_DEPLOY_4_Y, Z_PROBE_ALLEN_KEY_DEPLOY_4_Z };
1871
+      do_blocking_move_to(deploy_4, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE));
1863 1872
     #endif
1864 1873
     #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_Z)
1865 1874
       #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_X
@@ -1874,7 +1883,8 @@ static void clean_up_after_endstop_or_probe_move() {
1874 1883
       #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE
1875 1884
         #define Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE 0.0
1876 1885
       #endif
1877
-      do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_5_X, Z_PROBE_ALLEN_KEY_DEPLOY_5_Y, Z_PROBE_ALLEN_KEY_DEPLOY_5_Z, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE));
1886
+      const float deploy_5[] = { Z_PROBE_ALLEN_KEY_DEPLOY_5_X, Z_PROBE_ALLEN_KEY_DEPLOY_5_Y, Z_PROBE_ALLEN_KEY_DEPLOY_5_Z };
1887
+      do_blocking_move_to(deploy_5, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE));
1878 1888
     #endif
1879 1889
   }
1880 1890
 
@@ -1892,7 +1902,8 @@ static void clean_up_after_endstop_or_probe_move() {
1892 1902
       #ifndef Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE
1893 1903
         #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE 0.0
1894 1904
       #endif
1895
-      do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_1_X, Z_PROBE_ALLEN_KEY_STOW_1_Y, Z_PROBE_ALLEN_KEY_STOW_1_Z, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE));
1905
+      const float stow_1[] = { Z_PROBE_ALLEN_KEY_STOW_1_X, Z_PROBE_ALLEN_KEY_STOW_1_Y, Z_PROBE_ALLEN_KEY_STOW_1_Z };
1906
+      do_blocking_move_to(stow_1, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE));
1896 1907
     #endif
1897 1908
     #if defined(Z_PROBE_ALLEN_KEY_STOW_2_X) || defined(Z_PROBE_ALLEN_KEY_STOW_2_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_2_Z)
1898 1909
       #ifndef Z_PROBE_ALLEN_KEY_STOW_2_X
@@ -1907,7 +1918,8 @@ static void clean_up_after_endstop_or_probe_move() {
1907 1918
       #ifndef Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE
1908 1919
         #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE 0.0
1909 1920
       #endif
1910
-      do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_2_X, Z_PROBE_ALLEN_KEY_STOW_2_Y, Z_PROBE_ALLEN_KEY_STOW_2_Z, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE));
1921
+      const float stow_2[] = { Z_PROBE_ALLEN_KEY_STOW_2_X, Z_PROBE_ALLEN_KEY_STOW_2_Y, Z_PROBE_ALLEN_KEY_STOW_2_Z };
1922
+      do_blocking_move_to(stow_2, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE));
1911 1923
     #endif
1912 1924
     #if defined(Z_PROBE_ALLEN_KEY_STOW_3_X) || defined(Z_PROBE_ALLEN_KEY_STOW_3_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_3_Z)
1913 1925
       #ifndef Z_PROBE_ALLEN_KEY_STOW_3_X
@@ -1922,7 +1934,8 @@ static void clean_up_after_endstop_or_probe_move() {
1922 1934
       #ifndef Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE
1923 1935
         #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE 0.0
1924 1936
       #endif
1925
-      do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_3_X, Z_PROBE_ALLEN_KEY_STOW_3_Y, Z_PROBE_ALLEN_KEY_STOW_3_Z, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE));
1937
+      const float stow_3[] = { Z_PROBE_ALLEN_KEY_STOW_3_X, Z_PROBE_ALLEN_KEY_STOW_3_Y, Z_PROBE_ALLEN_KEY_STOW_3_Z };
1938
+      do_blocking_move_to(stow_3, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE));
1926 1939
     #endif
1927 1940
     #if defined(Z_PROBE_ALLEN_KEY_STOW_4_X) || defined(Z_PROBE_ALLEN_KEY_STOW_4_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_4_Z)
1928 1941
       #ifndef Z_PROBE_ALLEN_KEY_STOW_4_X
@@ -1937,7 +1950,8 @@ static void clean_up_after_endstop_or_probe_move() {
1937 1950
       #ifndef Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE
1938 1951
         #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE 0.0
1939 1952
       #endif
1940
-      do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_4_X, Z_PROBE_ALLEN_KEY_STOW_4_Y, Z_PROBE_ALLEN_KEY_STOW_4_Z, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE));
1953
+      const float stow_4[] = { Z_PROBE_ALLEN_KEY_STOW_4_X, Z_PROBE_ALLEN_KEY_STOW_4_Y, Z_PROBE_ALLEN_KEY_STOW_4_Z };
1954
+      do_blocking_move_to(stow_4, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE));
1941 1955
     #endif
1942 1956
     #if defined(Z_PROBE_ALLEN_KEY_STOW_5_X) || defined(Z_PROBE_ALLEN_KEY_STOW_5_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_5_Z)
1943 1957
       #ifndef Z_PROBE_ALLEN_KEY_STOW_5_X
@@ -1952,7 +1966,8 @@ static void clean_up_after_endstop_or_probe_move() {
1952 1966
       #ifndef Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE
1953 1967
         #define Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE 0.0
1954 1968
       #endif
1955
-      do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_5_X, Z_PROBE_ALLEN_KEY_STOW_5_Y, Z_PROBE_ALLEN_KEY_STOW_5_Z, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE));
1969
+      const float stow_5[] = { Z_PROBE_ALLEN_KEY_STOW_5_X, Z_PROBE_ALLEN_KEY_STOW_5_Y, Z_PROBE_ALLEN_KEY_STOW_5_Z };
1970
+      do_blocking_move_to(stow_5, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE));
1956 1971
     #endif
1957 1972
   }
1958 1973
 
@@ -2751,7 +2766,7 @@ static void clean_up_after_endstop_or_probe_move() {
2751 2766
 /**
2752 2767
  * Home an individual linear axis
2753 2768
  */
2754
-static void do_homing_move(const AxisEnum axis, float distance, float fr_mm_s=0.0) {
2769
+static void do_homing_move(const AxisEnum axis, const float distance, const float fr_mm_s=0.0) {
2755 2770
 
2756 2771
   #if ENABLED(DEBUG_LEVELING_FEATURE)
2757 2772
     if (DEBUGGING(LEVELING)) {
@@ -2779,11 +2794,11 @@ static void do_homing_move(const AxisEnum axis, float distance, float fr_mm_s=0.
2779 2794
     SYNC_PLAN_POSITION_KINEMATIC();
2780 2795
     current_position[axis] = distance;
2781 2796
     inverse_kinematics(current_position);
2782
-    planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], current_position[E_AXIS], fr_mm_s ? fr_mm_s : homing_feedrate_mm_s[axis], active_extruder);
2797
+    planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], current_position[E_AXIS], fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder);
2783 2798
   #else
2784 2799
     sync_plan_position();
2785 2800
     current_position[axis] = distance;
2786
-    planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], fr_mm_s ? fr_mm_s : homing_feedrate_mm_s[axis], active_extruder);
2801
+    planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder);
2787 2802
   #endif
2788 2803
 
2789 2804
   stepper.synchronize();
@@ -3398,7 +3413,7 @@ inline void gcode_G4() {
3398 3413
     const float mlx = max_length(X_AXIS),
3399 3414
                 mly = max_length(Y_AXIS),
3400 3415
                 mlratio = mlx > mly ? mly / mlx : mlx / mly,
3401
-                fr_mm_s = min(homing_feedrate_mm_s[X_AXIS], homing_feedrate_mm_s[Y_AXIS]) * sqrt(sq(mlratio) + 1.0);
3416
+                fr_mm_s = min(homing_feedrate(X_AXIS), homing_feedrate(Y_AXIS)) * sqrt(sq(mlratio) + 1.0);
3402 3417
 
3403 3418
     do_blocking_move_to_xy(1.5 * mlx * x_axis_home_dir, 1.5 * mly * home_dir(Y_AXIS), fr_mm_s);
3404 3419
     endstops.hit_on_purpose(); // clear endstop hit flags
@@ -3541,7 +3556,7 @@ inline void gcode_G4() {
3541 3556
 
3542 3557
     // Move all carriages together linearly until an endstop is hit.
3543 3558
     current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = (Z_MAX_LENGTH + 10);
3544
-    feedrate_mm_s = homing_feedrate_mm_s[X_AXIS];
3559
+    feedrate_mm_s = homing_feedrate(X_AXIS);
3545 3560
     line_to_current_position();
3546 3561
     stepper.synchronize();
3547 3562
     endstops.hit_on_purpose(); // clear endstop hit flags
@@ -3854,7 +3869,7 @@ void home_all_axes() { gcode_G28(true); }
3854 3869
     const float old_feedrate_mm_s = feedrate_mm_s;
3855 3870
 
3856 3871
     #if MANUAL_PROBE_HEIGHT > 0
3857
-      feedrate_mm_s = homing_feedrate_mm_s[Z_AXIS];
3872
+      feedrate_mm_s = homing_feedrate(Z_AXIS);
3858 3873
       current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT;
3859 3874
       line_to_current_position();
3860 3875
     #endif
@@ -3865,7 +3880,7 @@ void home_all_axes() { gcode_G28(true); }
3865 3880
     line_to_current_position();
3866 3881
 
3867 3882
     #if MANUAL_PROBE_HEIGHT > 0
3868
-      feedrate_mm_s = homing_feedrate_mm_s[Z_AXIS];
3883
+      feedrate_mm_s = homing_feedrate(Z_AXIS);
3869 3884
       current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS); // just slightly over the bed
3870 3885
       line_to_current_position();
3871 3886
     #endif
@@ -3901,7 +3916,7 @@ void home_all_axes() { gcode_G28(true); }
3901 3916
     #if ENABLED(MESH_G28_REST_ORIGIN)
3902 3917
       current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS);
3903 3918
       set_destination_to_current();
3904
-      line_to_destination(homing_feedrate_mm_s[Z_AXIS]);
3919
+      line_to_destination(homing_feedrate(Z_AXIS));
3905 3920
       stepper.synchronize();
3906 3921
     #endif
3907 3922
   }
@@ -4907,7 +4922,7 @@ void home_all_axes() { gcode_G28(true); }
4907 4922
         if ( NEAR(current_position[X_AXIS], xProbe - (X_PROBE_OFFSET_FROM_EXTRUDER))
4908 4923
           && NEAR(current_position[Y_AXIS], yProbe - (Y_PROBE_OFFSET_FROM_EXTRUDER))
4909 4924
         ) {
4910
-          float simple_z = current_position[Z_AXIS] - measured_z;
4925
+          const float simple_z = current_position[Z_AXIS] - measured_z;
4911 4926
           #if ENABLED(DEBUG_LEVELING_FEATURE)
4912 4927
             if (DEBUGGING(LEVELING)) {
4913 4928
               SERIAL_ECHOPAIR("Z from Probe:", simple_z);
@@ -5503,7 +5518,7 @@ void home_all_axes() { gcode_G28(true); }
5503 5518
     // If any axis has enough movement, do the move
5504 5519
     LOOP_XYZ(i)
5505 5520
       if (fabs(destination[i] - current_position[i]) >= G38_MINIMUM_MOVE) {
5506
-        if (!parser.seen('F')) feedrate_mm_s = homing_feedrate_mm_s[i];
5521
+        if (!parser.seen('F')) feedrate_mm_s = homing_feedrate(i);
5507 5522
         // If G38.2 fails throw an error
5508 5523
         if (!G38_run_probe() && is_38_2) {
5509 5524
           SERIAL_ERROR_START;
@@ -6271,10 +6286,10 @@ inline void gcode_M31() {
6271 6286
 /**
6272 6287
  * Sensitive pin test for M42, M226
6273 6288
  */
6274
-static bool pin_is_protected(uint8_t pin) {
6275
-  static const int sensitive_pins[] = SENSITIVE_PINS;
6289
+static bool pin_is_protected(const int8_t pin) {
6290
+  static const int8_t sensitive_pins[] PROGMEM = SENSITIVE_PINS;
6276 6291
   for (uint8_t i = 0; i < COUNT(sensitive_pins); i++)
6277
-    if (sensitive_pins[i] == pin) return true;
6292
+    if (pin == (int8_t)pgm_read_byte(&sensitive_pins[i])) return true;
6278 6293
   return false;
6279 6294
 }
6280 6295
 
@@ -7667,45 +7682,32 @@ void report_current_position() {
7667 7682
 
7668 7683
 #ifdef M114_DETAIL
7669 7684
 
7670
-  static const char axis_char[XYZE] = {'X','Y','Z','E'};
7671
-
7672
-  void report_xyze(const float pos[XYZE], uint8_t n = 4, uint8_t precision = 3) {
7685
+  void report_xyze(const float pos[XYZE], const uint8_t n = 4, const uint8_t precision = 3) {
7673 7686
     char str[12];
7674
-    for(uint8_t i=0; i<n; i++) {
7687
+    for (uint8_t i = 0; i < n; i++) {
7675 7688
       SERIAL_CHAR(' ');
7676
-      SERIAL_CHAR(axis_char[i]);
7689
+      SERIAL_CHAR(axis_codes[i]);
7677 7690
       SERIAL_CHAR(':');
7678
-      SERIAL_PROTOCOL(dtostrf(pos[i],8,precision,str));
7691
+      SERIAL_PROTOCOL(dtostrf(pos[i], 8, precision, str));
7679 7692
     }
7680 7693
     SERIAL_EOL;
7681 7694
   }
7682 7695
 
7683
-  inline void report_xyz(const float pos[XYZ]) {
7684
-    report_xyze(pos,3);
7685
-  }
7696
+  inline void report_xyz(const float pos[XYZ]) { report_xyze(pos, 3); }
7686 7697
 
7687 7698
   void report_current_position_detail() {
7688 7699
 
7689 7700
     stepper.synchronize();
7690 7701
 
7691
-    SERIAL_EOL;
7692
-    SERIAL_PROTOCOLPGM("Logical:");
7702
+    SERIAL_PROTOCOLPGM("\nLogical:");
7693 7703
     report_xyze(current_position);
7694 7704
 
7695 7705
     SERIAL_PROTOCOLPGM("Raw:    ");
7696
-    const float raw[XYZ] = {
7697
-      RAW_X_POSITION(current_position[X_AXIS]),
7698
-      RAW_Y_POSITION(current_position[Y_AXIS]),
7699
-      RAW_Z_POSITION(current_position[Z_AXIS])
7700
-    };
7706
+    const float raw[XYZ] = { RAW_X_POSITION(current_position[X_AXIS]), RAW_Y_POSITION(current_position[Y_AXIS]), RAW_Z_POSITION(current_position[Z_AXIS]) };
7701 7707
     report_xyz(raw);
7702 7708
 
7703 7709
     SERIAL_PROTOCOLPGM("Leveled:");
7704
-    float leveled[XYZ] = {
7705
-      current_position[X_AXIS],
7706
-      current_position[Y_AXIS],
7707
-      current_position[Z_AXIS]
7708
-    };
7710
+    float leveled[XYZ] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] };
7709 7711
     planner.apply_leveling(leveled);
7710 7712
     report_xyz(leveled);
7711 7713
 
@@ -7725,13 +7727,8 @@ void report_current_position() {
7725 7727
     #endif
7726 7728
 
7727 7729
     SERIAL_PROTOCOLPGM("Stepper:");
7728
-    const float step_count[XYZE] = {
7729
-      (float)stepper.position(X_AXIS),
7730
-      (float)stepper.position(Y_AXIS),
7731
-      (float)stepper.position(Z_AXIS),
7732
-      (float)stepper.position(E_AXIS)
7733
-    };
7734
-    report_xyze(step_count,4,0);
7730
+    const float step_count[XYZE] = { stepper.position(X_AXIS), stepper.position(Y_AXIS), stepper.position(Z_AXIS), stepper.position(E_AXIS) };
7731
+    report_xyze(step_count, 4, 0);
7735 7732
 
7736 7733
     #if IS_SCARA
7737 7734
       const float deg[XYZ] = {
@@ -7739,17 +7736,12 @@ void report_current_position() {
7739 7736
         stepper.get_axis_position_degrees(B_AXIS)
7740 7737
       };
7741 7738
       SERIAL_PROTOCOLPGM("Degrees:");
7742
-      report_xyze(deg,2);
7739
+      report_xyze(deg, 2);
7743 7740
     #endif
7744 7741
 
7745 7742
     SERIAL_PROTOCOLPGM("FromStp:");
7746 7743
     get_cartesian_from_steppers();  // writes cartes[XYZ] (with forward kinematics)
7747
-    const float from_steppers[XYZE] = {
7748
-      cartes[X_AXIS],
7749
-      cartes[Y_AXIS],
7750
-      cartes[Z_AXIS],
7751
-      stepper.get_axis_position_mm(E_AXIS)
7752
-    };
7744
+    const float from_steppers[XYZE] = { cartes[X_AXIS], cartes[Y_AXIS], cartes[Z_AXIS], stepper.get_axis_position_mm(E_AXIS) };
7753 7745
     report_xyze(from_steppers);
7754 7746
 
7755 7747
     const float diff[XYZE] = {
@@ -7764,12 +7756,12 @@ void report_current_position() {
7764 7756
 #endif // M114_DETAIL
7765 7757
 
7766 7758
 /**
7767
- * M114: Output current position to serial port
7759
+ * M114: Report current position to host
7768 7760
  */
7769 7761
 inline void gcode_M114() {
7770 7762
 
7771 7763
   #ifdef M114_DETAIL
7772
-    if ( parser.seen('D') ) {
7764
+    if (parser.seen('D')) {
7773 7765
       report_current_position_detail();
7774 7766
       return;
7775 7767
     }
@@ -7777,7 +7769,7 @@ inline void gcode_M114() {
7777 7769
 
7778 7770
   stepper.synchronize();
7779 7771
   report_current_position();
7780
-  }
7772
+}
7781 7773
 
7782 7774
 /**
7783 7775
  * M115: Capabilities string
@@ -7859,9 +7851,7 @@ inline void gcode_M115() {
7859 7851
 /**
7860 7852
  * M117: Set LCD Status Message
7861 7853
  */
7862
-inline void gcode_M117() {
7863
-  lcd_setstatus(parser.string_arg);
7864
-}
7854
+inline void gcode_M117() { lcd_setstatus(parser.string_arg); }
7865 7855
 
7866 7856
 /**
7867 7857
  * M119: Output endstop states to serial output
@@ -8890,25 +8880,43 @@ void quickstop_stepper() {
8890 8880
   inline void gcode_M420() {
8891 8881
 
8892 8882
     #if ENABLED(AUTO_BED_LEVELING_UBL)
8883
+
8893 8884
       // L to load a mesh from the EEPROM
8894 8885
       if (parser.seen('L')) {
8895
-        const int8_t storage_slot = parser.has_value() ? parser.value_int() : ubl.state.storage_slot;
8896
-        const int16_t a = settings.calc_num_meshes();
8897 8886
 
8898
-        if (!a) {
8887
+        #if ENABLED(EEPROM_SETTINGS)
8888
+          const int8_t storage_slot = parser.has_value() ? parser.value_int() : ubl.state.storage_slot;
8889
+          const int16_t a = settings.calc_num_meshes();
8890
+
8891
+          if (!a) {
8892
+            SERIAL_PROTOCOLLNPGM("?EEPROM storage not available.");
8893
+            return;
8894
+          }
8895
+
8896
+          if (!WITHIN(storage_slot, 0, a - 1)) {
8897
+            SERIAL_PROTOCOLLNPGM("?Invalid storage slot.");
8898
+            SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1);
8899
+            return;
8900
+          }
8901
+
8902
+          settings.load_mesh(storage_slot);
8903
+          ubl.state.storage_slot = storage_slot;
8904
+
8905
+        #else
8906
+
8899 8907
           SERIAL_PROTOCOLLNPGM("?EEPROM storage not available.");
8900 8908
           return;
8901
-        }
8902 8909
 
8903
-        if (!WITHIN(storage_slot, 0, a - 1)) {
8904
-          SERIAL_PROTOCOLLNPGM("?Invalid storage slot.");
8905
-          SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1);
8906
-          return;
8907
-        }
8910
+        #endif
8911
+      }
8908 8912
 
8909
-        settings.load_mesh(storage_slot);
8910
-        ubl.state.storage_slot = storage_slot;
8913
+      // L to load a mesh from the EEPROM
8914
+      if (parser.seen('L') || parser.seen('V')) {
8915
+        ubl.display_map(0);  // Currently only supports one map type
8916
+        SERIAL_ECHOLNPAIR("UBL_MESH_VALID = ", UBL_MESH_VALID);
8917
+        SERIAL_ECHOLNPAIR("ubl.state.storage_slot = ", ubl.state.storage_slot);
8911 8918
       }
8919
+
8912 8920
     #endif // AUTO_BED_LEVELING_UBL
8913 8921
 
8914 8922
     // V to print the matrix or mesh
@@ -8930,15 +8938,6 @@ void quickstop_stepper() {
8930 8938
       #endif
8931 8939
     }
8932 8940
 
8933
-    #if ENABLED(AUTO_BED_LEVELING_UBL)
8934
-      // L to load a mesh from the EEPROM
8935
-      if (parser.seen('L') || parser.seen('V')) {
8936
-        ubl.display_map(0);  // Currently only supports one map type
8937
-        SERIAL_ECHOLNPAIR("UBL_MESH_VALID = ", UBL_MESH_VALID);
8938
-        SERIAL_ECHOLNPAIR("ubl.state.storage_slot = ", ubl.state.storage_slot);
8939
-      }
8940
-    #endif
8941
-
8942 8941
     bool to_enable = false;
8943 8942
     if (parser.seen('S')) {
8944 8943
       to_enable = parser.value_bool();
@@ -12749,7 +12748,7 @@ void setup() {
12749 12748
   #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
12750 12749
     setup_endstop_interrupts();
12751 12750
   #endif
12752
-  
12751
+
12753 12752
   #if ENABLED(SWITCHING_EXTRUDER)
12754 12753
     move_extruder_servo(0);  // Initialize extruder servo
12755 12754
   #endif

+ 209
- 165
Marlin/SanityCheck.h View File

@@ -271,23 +271,6 @@
271 271
 #endif
272 272
 
273 273
 /**
274
- * Delta requirements
275
- */
276
-#if ENABLED(DELTA)
277
-  #if DISABLED(USE_XMAX_PLUG) && DISABLED(USE_YMAX_PLUG) && DISABLED(USE_ZMAX_PLUG)
278
-    #error "You probably want to use Max Endstops for DELTA!"
279
-  #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_DELTA
280
-    #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
281
-  #elif ABL_GRID
282
-    #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0
283
-      #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
284
-    #elif GRID_MAX_POINTS_X < 3
285
-      #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher."
286
-    #endif
287
-  #endif
288
-#endif
289
-
290
-/**
291 274
  * Babystepping
292 275
  */
293 276
 #if ENABLED(BABYSTEPPING)
@@ -430,44 +413,57 @@
430 413
 #endif
431 414
 
432 415
 /**
433
- * Allow only one bed leveling option to be defined
416
+ * Kinematics
417
+ */
418
+
419
+/**
420
+ * Allow only one kinematic type to be defined
434 421
  */
435 422
 static_assert(1 >= 0
436
-  #if ENABLED(AUTO_BED_LEVELING_LINEAR)
423
+  #if ENABLED(DELTA)
437 424
     + 1
438 425
   #endif
439
-  #if ENABLED(AUTO_BED_LEVELING_3POINT)
426
+  #if ENABLED(MORGAN_SCARA)
440 427
     + 1
441 428
   #endif
442
-  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
429
+  #if ENABLED(MAKERARM_SCARA)
443 430
     + 1
444 431
   #endif
445
-  #if ENABLED(AUTO_BED_LEVELING_UBL)
432
+  #if ENABLED(COREXY)
446 433
     + 1
447 434
   #endif
448
-  #if ENABLED(MESH_BED_LEVELING)
435
+  #if ENABLED(COREXZ)
449 436
     + 1
450 437
   #endif
451
-  , "Select only one of: MESH_BED_LEVELING, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
452
-);
453
-
454
-/**
455
- * Mesh Bed Leveling
456
- */
457
-#if ENABLED(MESH_BED_LEVELING)
458
-  #if ENABLED(DELTA)
459
-    #error "MESH_BED_LEVELING does not yet support DELTA printers."
460
-  #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9
461
-    #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL."
438
+  #if ENABLED(COREYZ)
439
+    + 1
462 440
   #endif
463
-#endif
441
+  #if ENABLED(COREYX)
442
+    + 1
443
+  #endif
444
+  #if ENABLED(COREZX)
445
+    + 1
446
+  #endif
447
+  #if ENABLED(COREZY)
448
+    + 1
449
+  #endif
450
+  , "Please enable only one of DELTA, MORGAN_SCARA, MAKERARM_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, or COREZY."
451
+);
464 452
 
465 453
 /**
466
- * Unified Bed Leveling
454
+ * Delta requirements
467 455
  */
468
-#if ENABLED(AUTO_BED_LEVELING_UBL)
469
-  #if IS_SCARA
470
-    #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
456
+#if ENABLED(DELTA)
457
+  #if DISABLED(USE_XMAX_PLUG) && DISABLED(USE_YMAX_PLUG) && DISABLED(USE_ZMAX_PLUG)
458
+    #error "You probably want to use Max Endstops for DELTA!"
459
+  #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_DELTA
460
+    #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
461
+  #elif ABL_GRID
462
+    #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0
463
+      #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
464
+    #elif GRID_MAX_POINTS_X < 3
465
+      #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher."
466
+    #endif
471 467
   #endif
472 468
 #endif
473 469
 
@@ -503,7 +499,6 @@ static_assert(1 >= 0
503 499
   , "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
504 500
 );
505 501
 
506
-
507 502
 #if PROBE_SELECTED
508 503
 
509 504
   /**
@@ -594,6 +589,114 @@ static_assert(1 >= 0
594 589
 #endif
595 590
 
596 591
 /**
592
+ * Allow only one bed leveling option to be defined
593
+ */
594
+static_assert(1 >= 0
595
+  #if ENABLED(AUTO_BED_LEVELING_LINEAR)
596
+    + 1
597
+  #endif
598
+  #if ENABLED(AUTO_BED_LEVELING_3POINT)
599
+    + 1
600
+  #endif
601
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
602
+    + 1
603
+  #endif
604
+  #if ENABLED(AUTO_BED_LEVELING_UBL)
605
+    + 1
606
+  #endif
607
+  #if ENABLED(MESH_BED_LEVELING)
608
+    + 1
609
+  #endif
610
+  , "Select only one of: MESH_BED_LEVELING, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
611
+);
612
+
613
+/**
614
+ * Bed Leveling Requirements
615
+ */
616
+
617
+#if ENABLED(AUTO_BED_LEVELING_UBL)
618
+
619
+  /**
620
+   * Unified Bed Leveling
621
+   */
622
+
623
+  #if IS_SCARA
624
+    #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
625
+  #elif DISABLED(EEPROM_SETTINGS)
626
+    #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration."
627
+  #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
628
+    #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
629
+  #else
630
+    static_assert(WITHIN(UBL_PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X), "UBL_PROBE_PT_1_X can't be reached by the Z probe.");
631
+    static_assert(WITHIN(UBL_PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X), "UBL_PROBE_PT_2_X can't be reached by the Z probe.");
632
+    static_assert(WITHIN(UBL_PROBE_PT_3_X, MIN_PROBE_X, MAX_PROBE_X), "UBL_PROBE_PT_3_X can't be reached by the Z probe.");
633
+    static_assert(WITHIN(UBL_PROBE_PT_1_Y, MIN_PROBE_Y, MAX_PROBE_Y), "UBL_PROBE_PT_1_Y can't be reached by the Z probe.");
634
+    static_assert(WITHIN(UBL_PROBE_PT_2_Y, MIN_PROBE_Y, MAX_PROBE_Y), "UBL_PROBE_PT_2_Y can't be reached by the Z probe.");
635
+    static_assert(WITHIN(UBL_PROBE_PT_3_Y, MIN_PROBE_Y, MAX_PROBE_Y), "UBL_PROBE_PT_3_Y can't be reached by the Z probe.");
636
+  #endif
637
+
638
+#elif HAS_ABL
639
+
640
+  /**
641
+   * Auto Bed Leveling
642
+   */
643
+
644
+  #if ENABLED(USE_RAW_KINEMATICS)
645
+    #error "USE_RAW_KINEMATICS is not compatible with AUTO_BED_LEVELING"
646
+  #endif
647
+
648
+  /**
649
+   * Delta and SCARA have limited bed leveling options
650
+   */
651
+  #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR)
652
+    #error "Only AUTO_BED_LEVELING_BILINEAR currently supports SCARA bed leveling."
653
+  #endif
654
+
655
+  /**
656
+   * Check auto bed leveling probe points
657
+   */
658
+  #if ABL_GRID
659
+
660
+    #ifdef DELTA_PROBEABLE_RADIUS
661
+      static_assert(LEFT_PROBE_BED_POSITION >= -DELTA_PROBEABLE_RADIUS, "LEFT_PROBE_BED_POSITION must be within DELTA_PROBEABLE_RADIUS.");
662
+      static_assert(RIGHT_PROBE_BED_POSITION <= DELTA_PROBEABLE_RADIUS, "RIGHT_PROBE_BED_POSITION must be within DELTA_PROBEABLE_RADIUS.");
663
+      static_assert(FRONT_PROBE_BED_POSITION >= -DELTA_PROBEABLE_RADIUS, "FRONT_PROBE_BED_POSITION must be within DELTA_PROBEABLE_RADIUS.");
664
+      static_assert(BACK_PROBE_BED_POSITION <= DELTA_PROBEABLE_RADIUS, "BACK_PROBE_BED_POSITION must be within DELTA_PROBEABLE_RADIUS.");
665
+    #else
666
+      static_assert(LEFT_PROBE_BED_POSITION < RIGHT_PROBE_BED_POSITION, "LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION.");
667
+      static_assert(FRONT_PROBE_BED_POSITION < BACK_PROBE_BED_POSITION, "FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION.");
668
+      static_assert(LEFT_PROBE_BED_POSITION >= MIN_PROBE_X, "LEFT_PROBE_BED_POSITION can't be reached by the Z probe.");
669
+      static_assert(RIGHT_PROBE_BED_POSITION <= MAX_PROBE_X, "RIGHT_PROBE_BED_POSITION can't be reached by the Z probe.");
670
+      static_assert(FRONT_PROBE_BED_POSITION >= MIN_PROBE_Y, "FRONT_PROBE_BED_POSITION can't be reached by the Z probe.");
671
+      static_assert(BACK_PROBE_BED_POSITION <= MAX_PROBE_Y, "BACK_PROBE_BED_POSITION can't be reached by the Z probe.");
672
+    #endif
673
+
674
+  #else // AUTO_BED_LEVELING_3POINT
675
+
676
+    static_assert(WITHIN(ABL_PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X), "ABL_PROBE_PT_1_X can't be reached by the Z probe.");
677
+    static_assert(WITHIN(ABL_PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X), "ABL_PROBE_PT_2_X can't be reached by the Z probe.");
678
+    static_assert(WITHIN(ABL_PROBE_PT_3_X, MIN_PROBE_X, MAX_PROBE_X), "ABL_PROBE_PT_3_X can't be reached by the Z probe.");
679
+    static_assert(WITHIN(ABL_PROBE_PT_1_Y, MIN_PROBE_Y, MAX_PROBE_Y), "ABL_PROBE_PT_1_Y can't be reached by the Z probe.");
680
+    static_assert(WITHIN(ABL_PROBE_PT_2_Y, MIN_PROBE_Y, MAX_PROBE_Y), "ABL_PROBE_PT_2_Y can't be reached by the Z probe.");
681
+    static_assert(WITHIN(ABL_PROBE_PT_3_Y, MIN_PROBE_Y, MAX_PROBE_Y), "ABL_PROBE_PT_3_Y can't be reached by the Z probe.");
682
+
683
+  #endif // AUTO_BED_LEVELING_3POINT
684
+
685
+#elif ENABLED(MESH_BED_LEVELING)
686
+
687
+  /**
688
+   * Mesh Bed Leveling
689
+   */
690
+
691
+  #if ENABLED(DELTA)
692
+    #error "MESH_BED_LEVELING does not yet support DELTA printers."
693
+  #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9
694
+    #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL."
695
+  #endif
696
+
697
+#endif
698
+
699
+/**
597 700
  * LCD_BED_LEVELING requirements
598 701
  */
599 702
 #if ENABLED(LCD_BED_LEVELING)
@@ -631,83 +734,6 @@ static_assert(1 >= 0
631 734
 #endif // Z_SAFE_HOMING
632 735
 
633 736
 /**
634
- * Auto Bed Leveling
635
- */
636
-#if HAS_ABL
637
-
638
-  #if ENABLED(USE_RAW_KINEMATICS)
639
-    #error "USE_RAW_KINEMATICS is not compatible with AUTO_BED_LEVELING"
640
-  #endif
641
-
642
-  /**
643
-   * Delta and SCARA have limited bed leveling options
644
-   */
645
-  #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR)
646
-    #error "Only AUTO_BED_LEVELING_BILINEAR currently supports SCARA bed leveling."
647
-  #endif
648
-
649
-  /**
650
-   * Check auto bed leveling sub-options, especially probe points
651
-   */
652
-  #if ABL_GRID
653
-    #ifndef DELTA_PROBEABLE_RADIUS
654
-      #if LEFT_PROBE_BED_POSITION > RIGHT_PROBE_BED_POSITION
655
-        #error "LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION."
656
-      #elif FRONT_PROBE_BED_POSITION > BACK_PROBE_BED_POSITION
657
-        #error "FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION."
658
-      #endif
659
-      #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X
660
-        #error "The given LEFT_PROBE_BED_POSITION can't be reached by the Z probe."
661
-      #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X
662
-        #error "The given RIGHT_PROBE_BED_POSITION can't be reached by the Z probe."
663
-      #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y
664
-        #error "The given FRONT_PROBE_BED_POSITION can't be reached by the Z probe."
665
-      #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y
666
-        #error "The given BACK_PROBE_BED_POSITION can't be reached by the Z probe."
667
-      #endif
668
-    #endif
669
-  #elif ENABLED(AUTO_BED_LEVELING_UBL)
670
-    #if DISABLED(EEPROM_SETTINGS)
671
-      #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration."
672
-    #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
673
-      #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
674
-    #endif
675
-    #if IS_CARTESIAN
676
-      #if !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
677
-        #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
678
-      #elif !WITHIN(UBL_PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X)
679
-        #error "The given UBL_PROBE_PT_1_X can't be reached by the Z probe."
680
-      #elif !WITHIN(UBL_PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X)
681
-        #error "The given UBL_PROBE_PT_2_X can't be reached by the Z probe."
682
-      #elif !WITHIN(UBL_PROBE_PT_3_X, MIN_PROBE_X, MAX_PROBE_X)
683
-        #error "The given UBL_PROBE_PT_3_X can't be reached by the Z probe."
684
-      #elif !WITHIN(UBL_PROBE_PT_1_Y, MIN_PROBE_Y, MAX_PROBE_Y)
685
-        #error "The given UBL_PROBE_PT_1_Y can't be reached by the Z probe."
686
-      #elif !WITHIN(UBL_PROBE_PT_2_Y, MIN_PROBE_Y, MAX_PROBE_Y)
687
-        #error "The given UBL_PROBE_PT_2_Y can't be reached by the Z probe."
688
-      #elif !WITHIN(UBL_PROBE_PT_3_Y, MIN_PROBE_Y, MAX_PROBE_Y)
689
-        #error "The given UBL_PROBE_PT_3_Y can't be reached by the Z probe."
690
-      #endif
691
-    #endif
692
-  #else // AUTO_BED_LEVELING_3POINT
693
-    #if !WITHIN(ABL_PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X)
694
-      #error "The given ABL_PROBE_PT_1_X can't be reached by the Z probe."
695
-    #elif !WITHIN(ABL_PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X)
696
-      #error "The given ABL_PROBE_PT_2_X can't be reached by the Z probe."
697
-    #elif !WITHIN(ABL_PROBE_PT_3_X, MIN_PROBE_X, MAX_PROBE_X)
698
-      #error "The given ABL_PROBE_PT_3_X can't be reached by the Z probe."
699
-    #elif !WITHIN(ABL_PROBE_PT_1_Y, MIN_PROBE_Y, MAX_PROBE_Y)
700
-      #error "The given ABL_PROBE_PT_1_Y can't be reached by the Z probe."
701
-    #elif !WITHIN(ABL_PROBE_PT_2_Y, MIN_PROBE_Y, MAX_PROBE_Y)
702
-      #error "The given ABL_PROBE_PT_2_Y can't be reached by the Z probe."
703
-    #elif !WITHIN(ABL_PROBE_PT_3_Y, MIN_PROBE_Y, MAX_PROBE_Y)
704
-      #error "The given ABL_PROBE_PT_3_Y can't be reached by the Z probe."
705
-    #endif
706
-  #endif // AUTO_BED_LEVELING_3POINT
707
-
708
-#endif // HAS_ABL
709
-
710
-/**
711 737
  * Advance Extrusion
712 738
  */
713 739
 #if ENABLED(ADVANCE) && ENABLED(LIN_ADVANCE)
@@ -740,40 +766,6 @@ static_assert(1 >= 0
740 766
 #endif
741 767
 
742 768
 /**
743
- * Don't set more than one kinematic type
744
- */
745
-static_assert(1 >= 0
746
-  #if ENABLED(DELTA)
747
-    + 1
748
-  #endif
749
-  #if ENABLED(MORGAN_SCARA)
750
-    + 1
751
-  #endif
752
-  #if ENABLED(MAKERARM_SCARA)
753
-    + 1
754
-  #endif
755
-  #if ENABLED(COREXY)
756
-    + 1
757
-  #endif
758
-  #if ENABLED(COREXZ)
759
-    + 1
760
-  #endif
761
-  #if ENABLED(COREYZ)
762
-    + 1
763
-  #endif
764
-  #if ENABLED(COREYX)
765
-    + 1
766
-  #endif
767
-  #if ENABLED(COREZX)
768
-    + 1
769
-  #endif
770
-  #if ENABLED(COREZY)
771
-    + 1
772
-  #endif
773
-  , "Please enable only one of DELTA, MORGAN_SCARA, MAKERARM_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, or COREZY."
774
-);
775
-
776
-/**
777 769
  * Allen Key
778 770
  * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
779 771
  */
@@ -1147,22 +1139,74 @@ static_assert(1 >= 0
1147 1139
   , "Please select no more than one LCD controller option."
1148 1140
 );
1149 1141
 
1150
-#if ENABLED(HAVE_TMC2130) && !( \
1151
-       ENABLED(  X_IS_TMC2130 ) \
1152
-    || ENABLED( X2_IS_TMC2130 ) \
1153
-    || ENABLED(  Y_IS_TMC2130 ) \
1154
-    || ENABLED( Y2_IS_TMC2130 ) \
1155
-    || ENABLED(  Z_IS_TMC2130 ) \
1156
-    || ENABLED( Z2_IS_TMC2130 ) \
1157
-    || ENABLED( E0_IS_TMC2130 ) \
1158
-    || ENABLED( E1_IS_TMC2130 ) \
1159
-    || ENABLED( E2_IS_TMC2130 ) \
1160
-    || ENABLED( E3_IS_TMC2130 ) )
1161
-  #error "Choose at least one TMC2130 stepper."
1142
+/**
1143
+ * Make sure HAVE_TMCDRIVER is warranted
1144
+ */
1145
+#if ENABLED(HAVE_TMCDRIVER) && !( \
1146
+         ENABLED(  X_IS_TMC ) \
1147
+      || ENABLED( X2_IS_TMC ) \
1148
+      || ENABLED(  Y_IS_TMC ) \
1149
+      || ENABLED( Y2_IS_TMC ) \
1150
+      || ENABLED(  Z_IS_TMC ) \
1151
+      || ENABLED( Z2_IS_TMC ) \
1152
+      || ENABLED( E0_IS_TMC ) \
1153
+      || ENABLED( E1_IS_TMC ) \
1154
+      || ENABLED( E2_IS_TMC ) \
1155
+      || ENABLED( E3_IS_TMC ) \
1156
+      || ENABLED( E4_IS_TMC ) \
1157
+  )
1158
+  #error "HAVE_TMCDRIVER requires at least one TMC stepper to be set."
1162 1159
 #endif
1163 1160
 
1164
-#if ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP)
1165
-  #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD."
1161
+/**
1162
+ * Make sure HAVE_TMC2130 is warranted
1163
+ */
1164
+#if ENABLED(HAVE_TMC2130)
1165
+  #if !( ENABLED(  X_IS_TMC2130 ) \
1166
+      || ENABLED( X2_IS_TMC2130 ) \
1167
+      || ENABLED(  Y_IS_TMC2130 ) \
1168
+      || ENABLED( Y2_IS_TMC2130 ) \
1169
+      || ENABLED(  Z_IS_TMC2130 ) \
1170
+      || ENABLED( Z2_IS_TMC2130 ) \
1171
+      || ENABLED( E0_IS_TMC2130 ) \
1172
+      || ENABLED( E1_IS_TMC2130 ) \
1173
+      || ENABLED( E2_IS_TMC2130 ) \
1174
+      || ENABLED( E3_IS_TMC2130 ) \
1175
+      || ENABLED( E4_IS_TMC2130 ) \
1176
+  )
1177
+    #error "HAVE_TMC2130 requires at least one TMC2130 stepper to be set."
1178
+  #elif ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP)
1179
+    #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD."
1180
+  #endif
1181
+#endif
1182
+
1183
+/**
1184
+ * Make sure HAVE_L6470DRIVER is warranted
1185
+ */
1186
+#if ENABLED(HAVE_L6470DRIVER) && !( \
1187
+         ENABLED(  X_IS_L6470 ) \
1188
+      || ENABLED( X2_IS_L6470 ) \
1189
+      || ENABLED(  Y_IS_L6470 ) \
1190
+      || ENABLED( Y2_IS_L6470 ) \
1191
+      || ENABLED(  Z_IS_L6470 ) \
1192
+      || ENABLED( Z2_IS_L6470 ) \
1193
+      || ENABLED( E0_IS_L6470 ) \
1194
+      || ENABLED( E1_IS_L6470 ) \
1195
+      || ENABLED( E2_IS_L6470 ) \
1196
+      || ENABLED( E3_IS_L6470 ) \
1197
+      || ENABLED( E4_IS_L6470 ) \
1198
+  )
1199
+  #error "HAVE_L6470DRIVER requires at least one L6470 stepper to be set."
1200
+#endif
1201
+
1202
+/**
1203
+ * Digipot requirement
1204
+ */
1205
+#if ENABLED(DIGIPOT_MCP4018)
1206
+  #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \
1207
+    || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1)
1208
+      #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined."
1209
+  #endif
1166 1210
 #endif
1167 1211
 
1168 1212
 /**

+ 1
- 1
Marlin/buzzer.h View File

@@ -104,7 +104,7 @@ class Buzzer {
104 104
      * @param duration Duration of the tone in milliseconds
105 105
      * @param frequency Frequency of the tone in hertz
106 106
      */
107
-    void tone(uint16_t const &duration, uint16_t const &frequency = 0) {
107
+    void tone(const uint16_t &duration, const uint16_t &frequency = 0) {
108 108
       while (buffer.isFull()) {
109 109
         this->tick();
110 110
         thermalManager.manage_heater();

+ 11
- 11
Marlin/configuration_store.cpp View File

@@ -457,10 +457,10 @@ void MarlinSettings::postprocess() {
457 457
     #endif
458 458
 
459 459
     #if DISABLED(ULTIPANEL)
460
-      const int lcd_preheat_hotend_temp[2] = { PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND },
461
-                lcd_preheat_bed_temp[2] = { PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED },
462
-                lcd_preheat_fan_speed[2] = { PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED };
463
-    #endif // !ULTIPANEL
460
+      constexpr int lcd_preheat_hotend_temp[2] = { PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND },
461
+                    lcd_preheat_bed_temp[2] = { PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED },
462
+                    lcd_preheat_fan_speed[2] = { PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED };
463
+    #endif
464 464
 
465 465
     EEPROM_WRITE(lcd_preheat_hotend_temp);
466 466
     EEPROM_WRITE(lcd_preheat_bed_temp);
@@ -1125,12 +1125,12 @@ void MarlinSettings::postprocess() {
1125 1125
  * M502 - Reset Configuration
1126 1126
  */
1127 1127
 void MarlinSettings::reset() {
1128
-  const float tmp1[] = DEFAULT_AXIS_STEPS_PER_UNIT, tmp2[] = DEFAULT_MAX_FEEDRATE;
1129
-  const uint32_t tmp3[] = DEFAULT_MAX_ACCELERATION;
1128
+  static const float tmp1[] PROGMEM = DEFAULT_AXIS_STEPS_PER_UNIT, tmp2[] PROGMEM = DEFAULT_MAX_FEEDRATE;
1129
+  static const uint32_t tmp3[] PROGMEM = DEFAULT_MAX_ACCELERATION;
1130 1130
   LOOP_XYZE_N(i) {
1131
-    planner.axis_steps_per_mm[i]          = tmp1[i < COUNT(tmp1) ? i : COUNT(tmp1) - 1];
1132
-    planner.max_feedrate_mm_s[i]          = tmp2[i < COUNT(tmp2) ? i : COUNT(tmp2) - 1];
1133
-    planner.max_acceleration_mm_per_s2[i] = tmp3[i < COUNT(tmp3) ? i : COUNT(tmp3) - 1];
1131
+    planner.axis_steps_per_mm[i]          = pgm_read_float(&tmp1[i < COUNT(tmp1) ? i : COUNT(tmp1) - 1]);
1132
+    planner.max_feedrate_mm_s[i]          = pgm_read_float(&tmp2[i < COUNT(tmp2) ? i : COUNT(tmp2) - 1]);
1133
+    planner.max_acceleration_mm_per_s2[i] = pgm_read_float(&tmp3[i < COUNT(tmp3) ? i : COUNT(tmp3) - 1]);
1134 1134
   }
1135 1135
 
1136 1136
   planner.acceleration = DEFAULT_ACCELERATION;
@@ -1265,9 +1265,9 @@ void MarlinSettings::reset() {
1265 1265
 
1266 1266
   endstops.enable_globally(
1267 1267
     #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)
1268
-      (true)
1268
+      true
1269 1269
     #else
1270
-      (false)
1270
+      false
1271 1271
     #endif
1272 1272
   );
1273 1273
 

+ 36
- 21
Marlin/digipot_mcp4018.cpp View File

@@ -24,6 +24,7 @@
24 24
 
25 25
 #if ENABLED(DIGIPOT_I2C) && ENABLED(DIGIPOT_MCP4018)
26 26
 
27
+#include "enum.h"
27 28
 #include "Stream.h"
28 29
 #include "utility/twi.h"
29 30
 #include <SlowSoftI2CMaster.h>  //https://github.com/stawel/SlowSoftI2CMaster
@@ -38,31 +39,47 @@
38 39
 
39 40
 #define DIGIPOT_A4988_Itripmax(Vref)    ((Vref)/(8.0*DIGIPOT_A4988_Rsx))
40 41
 
41
-#define DIGIPOT_A4988_FACTOR            (DIGIPOT_A4988_MAX_VALUE/DIGIPOT_A4988_Itripmax(DIGIPOT_A4988_Vrefmax))
42
+#define DIGIPOT_A4988_FACTOR            ((DIGIPOT_A4988_MAX_VALUE)/DIGIPOT_A4988_Itripmax(DIGIPOT_A4988_Vrefmax))
42 43
 //TODO: MAX_CURRENT -0.5A ?? (currently set to 2A, max possible current 2.5A)
43 44
 #define DIGIPOT_A4988_MAX_CURRENT       (DIGIPOT_A4988_Itripmax(DIGIPOT_A4988_Vrefmax) - 0.5)
44 45
 
45
-static byte current_to_wiper(float current) {
46
-  return byte(ceil(float((DIGIPOT_A4988_FACTOR * current))));
46
+static byte current_to_wiper(const float current) {
47
+  return byte(ceil(float(DIGIPOT_A4988_FACTOR) * current));
47 48
 }
48 49
 
49
-static uint8_t sda_pins[DIGIPOT_I2C_NUM_CHANNELS] = {
50
-  DIGIPOTS_I2C_SDA_X,
51
-  DIGIPOTS_I2C_SDA_Y,
52
-  DIGIPOTS_I2C_SDA_Z,
53
-  DIGIPOTS_I2C_SDA_E0,
54
-  DIGIPOTS_I2C_SDA_E1,
50
+const uint8_t sda_pins[DIGIPOT_I2C_NUM_CHANNELS] = {
51
+  DIGIPOTS_I2C_SDA_X
52
+  #if DIGIPOT_I2C_NUM_CHANNELS > 1
53
+    , DIGIPOTS_I2C_SDA_Y
54
+    #if DIGIPOT_I2C_NUM_CHANNELS > 2
55
+      , DIGIPOTS_I2C_SDA_Z
56
+      #if DIGIPOT_I2C_NUM_CHANNELS > 3
57
+        , DIGIPOTS_I2C_SDA_E0
58
+        #if DIGIPOT_I2C_NUM_CHANNELS > 4
59
+          , DIGIPOTS_I2C_SDA_E1
60
+        #endif
61
+      #endif
62
+    #endif
63
+  #endif
55 64
 };
56 65
 
57 66
 static SlowSoftI2CMaster pots[DIGIPOT_I2C_NUM_CHANNELS] = {
58
-  SlowSoftI2CMaster { sda_pins[0], DIGIPOTS_I2C_SCL },
59
-  SlowSoftI2CMaster { sda_pins[1], DIGIPOTS_I2C_SCL },
60
-  SlowSoftI2CMaster { sda_pins[2], DIGIPOTS_I2C_SCL },
61
-  SlowSoftI2CMaster { sda_pins[3], DIGIPOTS_I2C_SCL },
62
-  SlowSoftI2CMaster { sda_pins[4], DIGIPOTS_I2C_SCL }
67
+  SlowSoftI2CMaster { sda_pins[X_AXIS], DIGIPOTS_I2C_SCL }
68
+  #if DIGIPOT_I2C_NUM_CHANNELS > 1
69
+    , SlowSoftI2CMaster { sda_pins[Y_AXIS], DIGIPOTS_I2C_SCL }
70
+    #if DIGIPOT_I2C_NUM_CHANNELS > 2
71
+      , SlowSoftI2CMaster { sda_pins[Z_AXIS], DIGIPOTS_I2C_SCL }
72
+      #if DIGIPOT_I2C_NUM_CHANNELS > 3
73
+        , SlowSoftI2CMaster { sda_pins[E_AXIS], DIGIPOTS_I2C_SCL }
74
+        #if DIGIPOT_I2C_NUM_CHANNELS > 4
75
+          , SlowSoftI2CMaster { sda_pins[E_AXIS + 1], DIGIPOTS_I2C_SCL }
76
+        #endif
77
+      #endif
78
+    #endif
79
+  #endif
63 80
 };
64 81
 
65
-static void i2c_send(int channel, byte v) {
82
+static void i2c_send(const uint8_t channel, const byte v) {
66 83
   if (WITHIN(channel, 0, DIGIPOT_I2C_NUM_CHANNELS - 1)) {
67 84
     pots[channel].i2c_start(((DIGIPOT_I2C_ADDRESS) << 1) | I2C_WRITE);
68 85
     pots[channel].i2c_write(v);
@@ -71,21 +88,19 @@ static void i2c_send(int channel, byte v) {
71 88
 }
72 89
 
73 90
 // This is for the MCP4018 I2C based digipot
74
-void digipot_i2c_set_current(int channel, float current) {
75
-  current = min(max(current, 0.0f), float(DIGIPOT_A4988_MAX_CURRENT));
76
-
77
-  i2c_send(channel, current_to_wiper(current));
91
+void digipot_i2c_set_current(uint8_t channel, float current) {
92
+  i2c_send(channel, current_to_wiper(min(max(current, 0.0f), float(DIGIPOT_A4988_MAX_CURRENT))));
78 93
 }
79 94
 
80 95
 void digipot_i2c_init() {
81
-  const float digipot_motor_current[] = DIGIPOT_I2C_MOTOR_CURRENTS;
96
+  static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS;
82 97
 
83 98
   for (uint8_t i = 0; i < DIGIPOT_I2C_NUM_CHANNELS; i++)
84 99
     pots[i].i2c_init();
85 100
 
86 101
   // setup initial currents as defined in Configuration_adv.h
87 102
   for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++)
88
-    digipot_i2c_set_current(i, digipot_motor_current[i]);
103
+    digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i]));
89 104
 }
90 105
 
91 106
 #endif // DIGIPOT_I2C && DIGIPOT_MCP4018

+ 6
- 6
Marlin/digipot_mcp4451.cpp View File

@@ -37,11 +37,11 @@
37 37
   #define DIGIPOT_I2C_MAX_CURRENT 2.5
38 38
 #endif
39 39
 
40
-static byte current_to_wiper(float current) {
40
+static byte current_to_wiper(const float current) {
41 41
   return byte(ceil(float((DIGIPOT_I2C_FACTOR * current))));
42 42
 }
43 43
 
44
-static void i2c_send(byte addr, byte a, byte b) {
44
+static void i2c_send(const byte addr, const byte a, const byte b) {
45 45
   Wire.beginTransmission(addr);
46 46
   Wire.write(a);
47 47
   Wire.write(b);
@@ -49,7 +49,7 @@ static void i2c_send(byte addr, byte a, byte b) {
49 49
 }
50 50
 
51 51
 // This is for the MCP4451 I2C based digipot
52
-void digipot_i2c_set_current(int channel, float current) {
52
+void digipot_i2c_set_current(uint8_t channel, float current) {
53 53
   current = min((float) max(current, 0.0f), DIGIPOT_I2C_MAX_CURRENT);
54 54
   // these addresses are specific to Azteeg X3 Pro, can be set to others,
55 55
   // In this case first digipot is at address A0=0, A1= 0, second one is at A0=0, A1= 1
@@ -69,11 +69,11 @@ void digipot_i2c_set_current(int channel, float current) {
69 69
 }
70 70
 
71 71
 void digipot_i2c_init() {
72
-  const float digipot_motor_current[] = DIGIPOT_I2C_MOTOR_CURRENTS;
72
+  static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS;
73 73
   Wire.begin();
74 74
   // setup initial currents as defined in Configuration_adv.h
75
-  for (int i = 0; i < COUNT(digipot_motor_current); i++)
76
-    digipot_i2c_set_current(i, digipot_motor_current[i]);
75
+  for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++)
76
+    digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i]));
77 77
 }
78 78
 
79 79
 #endif // DIGIPOT_I2C

+ 4
- 2
Marlin/example_configurations/Cartesio/Configuration.h View File

@@ -878,12 +878,14 @@
878 878
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
879 879
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
880 880
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
881
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
882
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
881
+
882
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
883
+  #define UBL_PROBE_PT_1_Y 180
883 884
   #define UBL_PROBE_PT_2_X 39
884 885
   #define UBL_PROBE_PT_2_Y 20
885 886
   #define UBL_PROBE_PT_3_X 180
886 887
   #define UBL_PROBE_PT_3_Y 20
888
+
887 889
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
888 890
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
889 891
 

+ 5
- 5
Marlin/example_configurations/Cartesio/Configuration_adv.h View File

@@ -419,16 +419,16 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
425 425
 
426 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
427 427
 //#define DIGIPOT_I2C
428
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
429 429
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
430 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
431
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
431
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
432 432
 
433 433
 //===========================================================================
434 434
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/Felix/Configuration.h View File

@@ -862,12 +862,14 @@
862 862
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
863 863
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
864 864
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
865
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
866
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
865
+
866
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
867
+  #define UBL_PROBE_PT_1_Y 180
867 868
   #define UBL_PROBE_PT_2_X 39
868 869
   #define UBL_PROBE_PT_2_Y 20
869 870
   #define UBL_PROBE_PT_3_X 180
870 871
   #define UBL_PROBE_PT_3_Y 20
872
+
871 873
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
872 874
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
873 875
 

+ 5
- 5
Marlin/example_configurations/Felix/Configuration_adv.h View File

@@ -419,16 +419,16 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
425 425
 
426 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
427 427
 //#define DIGIPOT_I2C
428
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
429 429
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
430 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
431
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
431
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
432 432
 
433 433
 //===========================================================================
434 434
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/Felix/DUAL/Configuration.h View File

@@ -862,12 +862,14 @@
862 862
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
863 863
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
864 864
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
865
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
866
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
865
+
866
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
867
+  #define UBL_PROBE_PT_1_Y 180
867 868
   #define UBL_PROBE_PT_2_X 39
868 869
   #define UBL_PROBE_PT_2_Y 20
869 870
   #define UBL_PROBE_PT_3_X 180
870 871
   #define UBL_PROBE_PT_3_Y 20
872
+
871 873
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
872 874
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
873 875
 

+ 4
- 2
Marlin/example_configurations/FolgerTech-i3-2020/Configuration.h View File

@@ -884,12 +884,14 @@
884 884
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
885 885
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
886 886
   #define GRID_MAX_POINTS_Y 10
887
-  #define UBL_PROBE_PT_1_X 45       // These set the probe locations for when UBL does a 3-Point leveling
888
-  #define UBL_PROBE_PT_1_Y 170      // of the mesh.
887
+
888
+  #define UBL_PROBE_PT_1_X 45       // Probing points for 3-Point leveling of the mesh
889
+  #define UBL_PROBE_PT_1_Y 170
889 890
   #define UBL_PROBE_PT_2_X 45
890 891
   #define UBL_PROBE_PT_2_Y 25
891 892
   #define UBL_PROBE_PT_3_X 180
892 893
   #define UBL_PROBE_PT_3_Y 25
894
+
893 895
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
894 896
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
895 897
 

+ 5
- 5
Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h View File

@@ -419,16 +419,16 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
425 425
 
426 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
427 427
 //#define DIGIPOT_I2C
428
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
429 429
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
430 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
431
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
431
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
432 432
 
433 433
 //===========================================================================
434 434
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -870,12 +870,14 @@
870 870
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
871 871
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
872 872
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
873
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
874
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
873
+
874
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
875
+  #define UBL_PROBE_PT_1_Y 180
875 876
   #define UBL_PROBE_PT_2_X 39
876 877
   #define UBL_PROBE_PT_2_Y 20
877 878
   #define UBL_PROBE_PT_3_X 180
878 879
   #define UBL_PROBE_PT_3_Y 20
880
+
879 881
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
880 882
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
881 883
 

+ 5
- 5
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

@@ -419,16 +419,16 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
425 425
 
426 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
427 427
 //#define DIGIPOT_I2C
428
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
429 429
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
430 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
431
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
431
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
432 432
 
433 433
 //===========================================================================
434 434
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/Hephestos_2/Configuration.h View File

@@ -873,12 +873,14 @@
873 873
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
874 874
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
875 875
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
876
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
877
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
876
+
877
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
878
+  #define UBL_PROBE_PT_1_Y 180
878 879
   #define UBL_PROBE_PT_2_X 39
879 880
   #define UBL_PROBE_PT_2_Y 20
880 881
   #define UBL_PROBE_PT_3_X 180
881 882
   #define UBL_PROBE_PT_3_Y 20
883
+
882 884
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
883 885
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
884 886
 

+ 5
- 6
Marlin/example_configurations/Hephestos_2/Configuration_adv.h View File

@@ -419,17 +419,16 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-#define DIGIPOT_MOTOR_CURRENT {150, 170, 180, 190, 180} // Values 0-255 (bq ZUM Mega 3D (default): X = 150 [~1.17A]; Y = 170 [~1.33A]; Z = 180 [~1.41A]; E0 = 190 [~1.49A])
424
-
425
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }            // Values in milliamps
423
+#define DIGIPOT_MOTOR_CURRENT { 150, 170, 180, 190, 180 }   // Values 0-255 (bq ZUM Mega 3D (default): X = 150 [~1.17A]; Y = 170 [~1.33A]; Z = 180 [~1.41A]; E0 = 190 [~1.49A])
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }      // Default drive percent - X, Y, Z, E axis
426 425
 
427 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
428 427
 //#define DIGIPOT_I2C
429
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
430 429
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
431 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
432
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
431
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
433 432
 
434 433
 //===========================================================================
435 434
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/K8200/Configuration.h View File

@@ -909,12 +909,14 @@
909 909
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
910 910
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
911 911
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
912
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
913
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
912
+
913
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
914
+  #define UBL_PROBE_PT_1_Y 180
914 915
   #define UBL_PROBE_PT_2_X 39
915 916
   #define UBL_PROBE_PT_2_Y 20
916 917
   #define UBL_PROBE_PT_3_X 180
917 918
   #define UBL_PROBE_PT_3_Y 20
919
+
918 920
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
919 921
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
920 922
 

+ 5
- 5
Marlin/example_configurations/K8200/Configuration_adv.h View File

@@ -432,16 +432,16 @@
432 432
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
433 433
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
434 434
  */
435
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
436
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
437
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
435
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
436
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
437
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
438 438
 
439 439
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
440 440
 //#define DIGIPOT_I2C
441
-//#define DIGIPOT_MCP4018
441
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
442 442
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
443 443
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
444
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
444
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
445 445
 
446 446
 //===========================================================================
447 447
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/K8400/Configuration.h View File

@@ -880,12 +880,14 @@
880 880
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
881 881
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
882 882
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
883
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
884
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
883
+
884
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
885
+  #define UBL_PROBE_PT_1_Y 180
885 886
   #define UBL_PROBE_PT_2_X 39
886 887
   #define UBL_PROBE_PT_2_Y 20
887 888
   #define UBL_PROBE_PT_3_X 180
888 889
   #define UBL_PROBE_PT_3_Y 20
890
+
889 891
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
890 892
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
891 893
 

+ 5
- 5
Marlin/example_configurations/K8400/Configuration_adv.h View File

@@ -419,16 +419,16 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
425 425
 
426 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
427 427
 //#define DIGIPOT_I2C
428
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
429 429
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
430 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
431
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
431
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
432 432
 
433 433
 //===========================================================================
434 434
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/K8400/Dual-head/Configuration.h View File

@@ -880,12 +880,14 @@
880 880
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
881 881
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
882 882
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
883
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
884
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
883
+
884
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
885
+  #define UBL_PROBE_PT_1_Y 180
885 886
   #define UBL_PROBE_PT_2_X 39
886 887
   #define UBL_PROBE_PT_2_Y 20
887 888
   #define UBL_PROBE_PT_3_X 180
888 889
   #define UBL_PROBE_PT_3_Y 20
890
+
889 891
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
890 892
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
891 893
 

+ 4
- 2
Marlin/example_configurations/M150/Configuration.h View File

@@ -907,12 +907,14 @@
907 907
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
908 908
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
909 909
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
910
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
911
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
910
+
911
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
912
+  #define UBL_PROBE_PT_1_Y 180
912 913
   #define UBL_PROBE_PT_2_X 39
913 914
   #define UBL_PROBE_PT_2_Y 20
914 915
   #define UBL_PROBE_PT_3_X 180
915 916
   #define UBL_PROBE_PT_3_Y 20
917
+
916 918
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
917 919
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
918 920
 

+ 5
- 5
Marlin/example_configurations/M150/Configuration_adv.h View File

@@ -419,16 +419,16 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
425 425
 
426 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
427 427
 //#define DIGIPOT_I2C
428
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
429 429
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
430 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
431
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
431
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
432 432
 
433 433
 //===========================================================================
434 434
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h View File

@@ -880,12 +880,14 @@
880 880
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
881 881
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
882 882
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
883
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
884
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
883
+
884
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
885
+  #define UBL_PROBE_PT_1_Y 180
885 886
   #define UBL_PROBE_PT_2_X 39
886 887
   #define UBL_PROBE_PT_2_Y 20
887 888
   #define UBL_PROBE_PT_3_X 180
888 889
   #define UBL_PROBE_PT_3_Y 20
890
+
889 891
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
890 892
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
891 893
 

+ 4
- 2
Marlin/example_configurations/RigidBot/Configuration.h View File

@@ -878,12 +878,14 @@
878 878
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
879 879
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
880 880
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
881
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
882
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
881
+
882
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
883
+  #define UBL_PROBE_PT_1_Y 180
883 884
   #define UBL_PROBE_PT_2_X 39
884 885
   #define UBL_PROBE_PT_2_Y 20
885 886
   #define UBL_PROBE_PT_3_X 180
886 887
   #define UBL_PROBE_PT_3_Y 20
888
+
887 889
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
888 890
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
889 891
 

+ 5
- 5
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

@@ -419,16 +419,16 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
425 425
 
426 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
427 427
 //#define DIGIPOT_I2C
428
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
429 429
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
430 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
431
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
431
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
432 432
 
433 433
 //===========================================================================
434 434
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -895,12 +895,14 @@
895 895
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
896 896
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
897 897
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
898
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
899
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
898
+
899
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
900
+  #define UBL_PROBE_PT_1_Y 180
900 901
   #define UBL_PROBE_PT_2_X 39
901 902
   #define UBL_PROBE_PT_2_Y 20
902 903
   #define UBL_PROBE_PT_3_X 180
903 904
   #define UBL_PROBE_PT_3_Y 20
905
+
904 906
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
905 907
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
906 908
 

+ 5
- 5
Marlin/example_configurations/SCARA/Configuration_adv.h View File

@@ -419,16 +419,16 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
425 425
 
426 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
427 427
 //#define DIGIPOT_I2C
428
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
429 429
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
430 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
431
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
431
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
432 432
 
433 433
 //===========================================================================
434 434
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/TAZ4/Configuration.h View File

@@ -899,12 +899,14 @@
899 899
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
900 900
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
901 901
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
902
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
903
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
902
+
903
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
904
+  #define UBL_PROBE_PT_1_Y 180
904 905
   #define UBL_PROBE_PT_2_X 39
905 906
   #define UBL_PROBE_PT_2_Y 20
906 907
   #define UBL_PROBE_PT_3_X 180
907 908
   #define UBL_PROBE_PT_3_Y 20
909
+
908 910
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
909 911
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
910 912
 

+ 5
- 5
Marlin/example_configurations/TAZ4/Configuration_adv.h View File

@@ -419,16 +419,16 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
425 425
 
426 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
427 427
 //#define DIGIPOT_I2C
428
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
429 429
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
430 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
431
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
431
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
432 432
 
433 433
 //===========================================================================
434 434
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/TinyBoy2/Configuration.h View File

@@ -936,12 +936,14 @@
936 936
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
937 937
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
938 938
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
939
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
940
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
939
+
940
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
941
+  #define UBL_PROBE_PT_1_Y 180
941 942
   #define UBL_PROBE_PT_2_X 39
942 943
   #define UBL_PROBE_PT_2_Y 20
943 944
   #define UBL_PROBE_PT_3_X 180
944 945
   #define UBL_PROBE_PT_3_Y 20
946
+
945 947
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
946 948
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
947 949
 

+ 5
- 5
Marlin/example_configurations/TinyBoy2/Configuration_adv.h View File

@@ -419,16 +419,16 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
425 425
 
426 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
427 427
 //#define DIGIPOT_I2C
428
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
429 429
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
430 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
431
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
431
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
432 432
 
433 433
 //===========================================================================
434 434
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -870,12 +870,14 @@
870 870
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
871 871
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
872 872
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
873
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
874
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
873
+
874
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
875
+  #define UBL_PROBE_PT_1_Y 180
875 876
   #define UBL_PROBE_PT_2_X 39
876 877
   #define UBL_PROBE_PT_2_Y 20
877 878
   #define UBL_PROBE_PT_3_X 180
878 879
   #define UBL_PROBE_PT_3_Y 20
880
+
879 881
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
880 882
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
881 883
 

+ 5
- 5
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

@@ -419,16 +419,16 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
425 425
 
426 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
427 427
 //#define DIGIPOT_I2C
428
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
429 429
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
430 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
431
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
431
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
432 432
 
433 433
 //===========================================================================
434 434
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/adafruit/ST7565/Configuration.h View File

@@ -880,12 +880,14 @@
880 880
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
881 881
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
882 882
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
883
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
884
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
883
+
884
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
885
+  #define UBL_PROBE_PT_1_Y 180
885 886
   #define UBL_PROBE_PT_2_X 39
886 887
   #define UBL_PROBE_PT_2_Y 20
887 888
   #define UBL_PROBE_PT_3_X 180
888 889
   #define UBL_PROBE_PT_3_Y 20
890
+
889 891
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
890 892
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
891 893
 

+ 10
- 6
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h View File

@@ -999,12 +999,16 @@
999 999
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
1000 1000
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
1001 1001
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
1002
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
1003
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
1004
-  #define UBL_PROBE_PT_2_X 39
1005
-  #define UBL_PROBE_PT_2_Y 20
1006
-  #define UBL_PROBE_PT_3_X 180
1007
-  #define UBL_PROBE_PT_3_Y 20
1002
+
1003
+  #define _PX(R,A) (R) * cos(RADIANS(A))
1004
+  #define _PY(R,A) (R) * sin(RADIANS(A))
1005
+  #define UBL_PROBE_PT_1_X _PX(DELTA_PROBEABLE_RADIUS, 0)   // Probing points for 3-Point leveling of the mesh
1006
+  #define UBL_PROBE_PT_1_Y _PY(DELTA_PROBEABLE_RADIUS, 0)
1007
+  #define UBL_PROBE_PT_2_X _PX(DELTA_PROBEABLE_RADIUS, 120)
1008
+  #define UBL_PROBE_PT_2_Y _PY(DELTA_PROBEABLE_RADIUS, 120)
1009
+  #define UBL_PROBE_PT_3_X _PX(DELTA_PROBEABLE_RADIUS, 240)
1010
+  #define UBL_PROBE_PT_3_Y _PY(DELTA_PROBEABLE_RADIUS, 240)
1011
+
1008 1012
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
1009 1013
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
1010 1014
 

+ 5
- 5
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h View File

@@ -421,16 +421,16 @@
421 421
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
422 422
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
423 423
  */
424
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
425
-#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
426
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
424
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
425
+#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
426
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
427 427
 
428 428
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
429 429
 //#define DIGIPOT_I2C
430
-//#define DIGIPOT_MCP4018
430
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
431 431
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
432 432
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
433
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
433
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
434 434
 
435 435
 //===========================================================================
436 436
 //=============================Additional Features===========================

+ 10
- 6
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h View File

@@ -1001,12 +1001,16 @@
1001 1001
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
1002 1002
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
1003 1003
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
1004
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
1005
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
1006
-  #define UBL_PROBE_PT_2_X 39
1007
-  #define UBL_PROBE_PT_2_Y 20
1008
-  #define UBL_PROBE_PT_3_X 180
1009
-  #define UBL_PROBE_PT_3_Y 20
1004
+
1005
+  #define _PX(R,A) (R) * cos(RADIANS(A))
1006
+  #define _PY(R,A) (R) * sin(RADIANS(A))
1007
+  #define UBL_PROBE_PT_1_X _PX(DELTA_PROBEABLE_RADIUS, 0)   // Probing points for 3-Point leveling of the mesh
1008
+  #define UBL_PROBE_PT_1_Y _PY(DELTA_PROBEABLE_RADIUS, 0)
1009
+  #define UBL_PROBE_PT_2_X _PX(DELTA_PROBEABLE_RADIUS, 120)
1010
+  #define UBL_PROBE_PT_2_Y _PY(DELTA_PROBEABLE_RADIUS, 120)
1011
+  #define UBL_PROBE_PT_3_X _PX(DELTA_PROBEABLE_RADIUS, 240)
1012
+  #define UBL_PROBE_PT_3_Y _PY(DELTA_PROBEABLE_RADIUS, 240)
1013
+
1010 1014
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
1011 1015
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
1012 1016
 

+ 5
- 5
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h View File

@@ -421,16 +421,16 @@
421 421
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
422 422
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
423 423
  */
424
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
425
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
426
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
424
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
425
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
426
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
427 427
 
428 428
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
429 429
 //#define DIGIPOT_I2C
430
-//#define DIGIPOT_MCP4018
430
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
431 431
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
432 432
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
433
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
433
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
434 434
 
435 435
 //===========================================================================
436 436
 //=============================Additional Features===========================

+ 10
- 6
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -990,12 +990,16 @@
990 990
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
991 991
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
992 992
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
993
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
994
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
995
-  #define UBL_PROBE_PT_2_X 39
996
-  #define UBL_PROBE_PT_2_Y 20
997
-  #define UBL_PROBE_PT_3_X 180
998
-  #define UBL_PROBE_PT_3_Y 20
993
+
994
+  #define _PX(R,A) (R) * cos(RADIANS(A))
995
+  #define _PY(R,A) (R) * sin(RADIANS(A))
996
+  #define UBL_PROBE_PT_1_X _PX(DELTA_PROBEABLE_RADIUS, 0)   // Probing points for 3-Point leveling of the mesh
997
+  #define UBL_PROBE_PT_1_Y _PY(DELTA_PROBEABLE_RADIUS, 0)
998
+  #define UBL_PROBE_PT_2_X _PX(DELTA_PROBEABLE_RADIUS, 120)
999
+  #define UBL_PROBE_PT_2_Y _PY(DELTA_PROBEABLE_RADIUS, 120)
1000
+  #define UBL_PROBE_PT_3_X _PX(DELTA_PROBEABLE_RADIUS, 240)
1001
+  #define UBL_PROBE_PT_3_Y _PY(DELTA_PROBEABLE_RADIUS, 240)
1002
+
999 1003
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
1000 1004
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
1001 1005
 

+ 5
- 5
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

@@ -421,16 +421,16 @@
421 421
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
422 422
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
423 423
  */
424
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
425
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
426
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
424
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
425
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
426
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
427 427
 
428 428
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
429 429
 //#define DIGIPOT_I2C
430
-//#define DIGIPOT_MCP4018
430
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
431 431
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
432 432
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
433
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
433
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
434 434
 
435 435
 //===========================================================================
436 436
 //=============================Additional Features===========================

+ 10
- 6
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

@@ -993,12 +993,16 @@
993 993
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
994 994
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
995 995
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
996
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
997
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
998
-  #define UBL_PROBE_PT_2_X 39
999
-  #define UBL_PROBE_PT_2_Y 20
1000
-  #define UBL_PROBE_PT_3_X 180
1001
-  #define UBL_PROBE_PT_3_Y 20
996
+
997
+  #define _PX(R,A) (R) * cos(RADIANS(A))
998
+  #define _PY(R,A) (R) * sin(RADIANS(A))
999
+  #define UBL_PROBE_PT_1_X _PX(DELTA_PROBEABLE_RADIUS, 0)   // Probing points for 3-Point leveling of the mesh
1000
+  #define UBL_PROBE_PT_1_Y _PY(DELTA_PROBEABLE_RADIUS, 0)
1001
+  #define UBL_PROBE_PT_2_X _PX(DELTA_PROBEABLE_RADIUS, 120)
1002
+  #define UBL_PROBE_PT_2_Y _PY(DELTA_PROBEABLE_RADIUS, 120)
1003
+  #define UBL_PROBE_PT_3_X _PX(DELTA_PROBEABLE_RADIUS, 240)
1004
+  #define UBL_PROBE_PT_3_Y _PY(DELTA_PROBEABLE_RADIUS, 240)
1005
+
1002 1006
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
1003 1007
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
1004 1008
 

+ 5
- 5
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

@@ -421,16 +421,16 @@
421 421
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
422 422
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
423 423
  */
424
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
425
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
426
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
424
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
425
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
426
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
427 427
 
428 428
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
429 429
 //#define DIGIPOT_I2C
430
-//#define DIGIPOT_MCP4018
430
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
431 431
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
432 432
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
433
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
433
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
434 434
 
435 435
 //===========================================================================
436 436
 //=============================Additional Features===========================

+ 10
- 6
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

@@ -998,12 +998,16 @@
998 998
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
999 999
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
1000 1000
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
1001
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
1002
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
1003
-  #define UBL_PROBE_PT_2_X 39
1004
-  #define UBL_PROBE_PT_2_Y 20
1005
-  #define UBL_PROBE_PT_3_X 180
1006
-  #define UBL_PROBE_PT_3_Y 20
1001
+
1002
+  #define _PX(R,A) (R) * cos(RADIANS(A))
1003
+  #define _PY(R,A) (R) * sin(RADIANS(A))
1004
+  #define UBL_PROBE_PT_1_X _PX(DELTA_PROBEABLE_RADIUS, 0)   // Probing points for 3-Point leveling of the mesh
1005
+  #define UBL_PROBE_PT_1_Y _PY(DELTA_PROBEABLE_RADIUS, 0)
1006
+  #define UBL_PROBE_PT_2_X _PX(DELTA_PROBEABLE_RADIUS, 120)
1007
+  #define UBL_PROBE_PT_2_Y _PY(DELTA_PROBEABLE_RADIUS, 120)
1008
+  #define UBL_PROBE_PT_3_X _PX(DELTA_PROBEABLE_RADIUS, 240)
1009
+  #define UBL_PROBE_PT_3_Y _PY(DELTA_PROBEABLE_RADIUS, 240)
1010
+
1007 1011
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
1008 1012
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
1009 1013
 

+ 5
- 5
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h View File

@@ -426,16 +426,16 @@
426 426
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
427 427
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
428 428
  */
429
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
430
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
431
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
429
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
430
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
431
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
432 432
 
433 433
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
434 434
 //#define DIGIPOT_I2C
435
-//#define DIGIPOT_MCP4018
435
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
436 436
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
437 437
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
438
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
438
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
439 439
 
440 440
 //===========================================================================
441 441
 //=============================Additional Features===========================

+ 10
- 6
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

@@ -1056,12 +1056,16 @@
1056 1056
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
1057 1057
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
1058 1058
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
1059
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
1060
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
1061
-  #define UBL_PROBE_PT_2_X 39
1062
-  #define UBL_PROBE_PT_2_Y 20
1063
-  #define UBL_PROBE_PT_3_X 180
1064
-  #define UBL_PROBE_PT_3_Y 20
1059
+
1060
+  #define _PX(R,A) (R) * cos(RADIANS(A))
1061
+  #define _PY(R,A) (R) * sin(RADIANS(A))
1062
+  #define UBL_PROBE_PT_1_X _PX(DELTA_PROBEABLE_RADIUS, 0)   // Probing points for 3-Point leveling of the mesh
1063
+  #define UBL_PROBE_PT_1_Y _PY(DELTA_PROBEABLE_RADIUS, 0)
1064
+  #define UBL_PROBE_PT_2_X _PX(DELTA_PROBEABLE_RADIUS, 120)
1065
+  #define UBL_PROBE_PT_2_Y _PY(DELTA_PROBEABLE_RADIUS, 120)
1066
+  #define UBL_PROBE_PT_3_X _PX(DELTA_PROBEABLE_RADIUS, 240)
1067
+  #define UBL_PROBE_PT_3_Y _PY(DELTA_PROBEABLE_RADIUS, 240)
1068
+
1065 1069
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
1066 1070
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
1067 1071
 

+ 5
- 5
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h View File

@@ -421,16 +421,16 @@
421 421
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
422 422
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
423 423
  */
424
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
425
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
426
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
424
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
425
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
426
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
427 427
 
428 428
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
429 429
 //#define DIGIPOT_I2C
430
-//#define DIGIPOT_MCP4018
430
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
431 431
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
432 432
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
433
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
433
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
434 434
 
435 435
 //===========================================================================
436 436
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h View File

@@ -896,12 +896,14 @@
896 896
   #define UBL_MESH_INSET 45         // Mesh inset margin on print area
897 897
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
898 898
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
899
-  #define UBL_PROBE_PT_1_X 53       // These set the probe locations for when UBL does a 3-Point leveling
900
-  #define UBL_PROBE_PT_1_Y 323      // of the mesh.
899
+
900
+  #define UBL_PROBE_PT_1_X 53       // Probing points for 3-Point leveling of the mesh
901
+  #define UBL_PROBE_PT_1_Y 323
901 902
   #define UBL_PROBE_PT_2_X 53
902 903
   #define UBL_PROBE_PT_2_Y 63
903 904
   #define UBL_PROBE_PT_3_X 348
904 905
   #define UBL_PROBE_PT_3_Y 211
906
+
905 907
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
906 908
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
907 909
 

+ 5
- 5
Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h View File

@@ -419,16 +419,16 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
425 425
 
426 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
427 427
 //#define DIGIPOT_I2C
428
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
429 429
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
430 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
431
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
431
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
432 432
 
433 433
 //===========================================================================
434 434
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/makibox/Configuration.h View File

@@ -883,12 +883,14 @@
883 883
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
884 884
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
885 885
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
886
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
887
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
886
+
887
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
888
+  #define UBL_PROBE_PT_1_Y 180
888 889
   #define UBL_PROBE_PT_2_X 39
889 890
   #define UBL_PROBE_PT_2_Y 20
890 891
   #define UBL_PROBE_PT_3_X 180
891 892
   #define UBL_PROBE_PT_3_Y 20
893
+
892 894
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
893 895
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
894 896
 

+ 4
- 4
Marlin/example_configurations/makibox/Configuration_adv.h View File

@@ -419,13 +419,13 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
425 425
 
426 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
427 427
 //#define DIGIPOT_I2C
428
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
429 429
 #define DIGIPOT_I2C_NUM_CHANNELS 4 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
430 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
431 431
 #define DIGIPOT_I2C_MOTOR_CURRENTS { 1.7, 1.7, 1.7, 1.7 }  // 5DPRINT

+ 4
- 2
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

@@ -875,12 +875,14 @@
875 875
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
876 876
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
877 877
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
878
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
879
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
878
+
879
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
880
+  #define UBL_PROBE_PT_1_Y 180
880 881
   #define UBL_PROBE_PT_2_X 39
881 882
   #define UBL_PROBE_PT_2_Y 20
882 883
   #define UBL_PROBE_PT_3_X 180
883 884
   #define UBL_PROBE_PT_3_Y 20
885
+
884 886
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
885 887
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
886 888
 

+ 5
- 5
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

@@ -419,16 +419,16 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
425 425
 
426 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
427 427
 //#define DIGIPOT_I2C
428
-//#define DIGIPOT_MCP4018
428
+//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
429 429
 #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
430 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
431
-#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}  //  AZTEEG_X3_PRO
431
+#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
432 432
 
433 433
 //===========================================================================
434 434
 //=============================Additional Features===========================

+ 4
- 2
Marlin/example_configurations/wt150/Configuration.h View File

@@ -885,12 +885,14 @@
885 885
   #define UBL_MESH_INSET 1          // Mesh inset margin on print area
886 886
   #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
887 887
   #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
888
-  #define UBL_PROBE_PT_1_X 39       // These set the probe locations for when UBL does a 3-Point leveling
889
-  #define UBL_PROBE_PT_1_Y 180      // of the mesh.
888
+
889
+  #define UBL_PROBE_PT_1_X 39       // Probing points for 3-Point leveling of the mesh
890
+  #define UBL_PROBE_PT_1_Y 180
890 891
   #define UBL_PROBE_PT_2_X 39
891 892
   #define UBL_PROBE_PT_2_Y 20
892 893
   #define UBL_PROBE_PT_3_X 180
893 894
   #define UBL_PROBE_PT_3_Y 20
895
+
894 896
   #define UBL_G26_MESH_VALIDATION   // Enable G26 mesh validation
895 897
   #define UBL_MESH_EDIT_MOVES_Z     // Sophisticated users prefer no movement of nozzle
896 898
 

+ 4
- 4
Marlin/example_configurations/wt150/Configuration_adv.h View File

@@ -419,13 +419,13 @@
419 419
  *    M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
420 420
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
421 421
  */
422
-//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
423
-//#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
-//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
422
+//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
423
+//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
+//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
425 425
 
426 426
 // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
427 427
 #define DIGIPOT_I2C
428
-#define DIGIPOT_MCP4018
428
+#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
429 429
 #define DIGIPOT_I2C_NUM_CHANNELS 5 // 5DPRINT: 4     AZTEEG_X3_PRO: 8
430 430
 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
431 431
 #define DIGIPOT_I2C_MOTOR_CURRENTS {0.68, 0.68, 1.18, 1.27, 1.27}

+ 3
- 3
Marlin/pins.h View File

@@ -20,8 +20,8 @@
20 20
  *
21 21
  */
22 22
 
23
-#ifndef PINS_H
24
-#define PINS_H
23
+#ifndef __PINS_H__
24
+#define __PINS_H__
25 25
 
26 26
 #if MB(GEN7_CUSTOM)
27 27
   #include "pins_GEN7_CUSTOM.h"
@@ -570,4 +570,4 @@
570 570
   #define SS_PIN   AVR_SS_PIN
571 571
 #endif
572 572
 
573
-#endif // __PINS_H
573
+#endif // __PINS_H__

+ 10
- 10
Marlin/temperature.cpp View File

@@ -52,7 +52,7 @@
52 52
 #endif
53 53
 
54 54
 #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
55
-  static void* heater_ttbl_map[2] = {(void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE };
55
+  static void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE };
56 56
   static uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN };
57 57
 #else
58 58
   static void* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE, (void*)HEATER_4_TEMPTABLE);
@@ -472,8 +472,8 @@ int Temperature::getHeaterPower(int heater) {
472 472
 #if HAS_AUTO_FAN
473 473
 
474 474
   void Temperature::checkExtruderAutoFans() {
475
-    constexpr int8_t fanPin[] = { E0_AUTO_FAN_PIN, E1_AUTO_FAN_PIN, E2_AUTO_FAN_PIN, E3_AUTO_FAN_PIN, E4_AUTO_FAN_PIN };
476
-    constexpr int fanBit[] = {
475
+    static const int8_t fanPin[] PROGMEM = { E0_AUTO_FAN_PIN, E1_AUTO_FAN_PIN, E2_AUTO_FAN_PIN, E3_AUTO_FAN_PIN, E4_AUTO_FAN_PIN };
476
+    static const uint8_t fanBit[] PROGMEM = {
477 477
                     0,
478 478
       AUTO_1_IS_0 ? 0 :               1,
479 479
       AUTO_2_IS_0 ? 0 : AUTO_2_IS_1 ? 1 :               2,
@@ -482,20 +482,20 @@ int Temperature::getHeaterPower(int heater) {
482 482
     };
483 483
     uint8_t fanState = 0;
484 484
 
485
-    HOTEND_LOOP() {
485
+    HOTEND_LOOP()
486 486
       if (current_temperature[e] > EXTRUDER_AUTO_FAN_TEMPERATURE)
487
-        SBI(fanState, fanBit[e]);
488
-    }
487
+        SBI(fanState, pgm_read_byte(&fanBit[e]));
489 488
 
490 489
     uint8_t fanDone = 0;
491 490
     for (uint8_t f = 0; f < COUNT(fanPin); f++) {
492
-      int8_t pin = fanPin[f];
493
-      if (pin >= 0 && !TEST(fanDone, fanBit[f])) {
494
-        uint8_t newFanSpeed = TEST(fanState, fanBit[f]) ? EXTRUDER_AUTO_FAN_SPEED : 0;
491
+      int8_t pin = pgm_read_byte(&fanPin[f]);
492
+      const uint8_t bit = pgm_read_byte(&fanBit[f]);
493
+      if (pin >= 0 && !TEST(fanDone, bit)) {
494
+        uint8_t newFanSpeed = TEST(fanState, bit) ? EXTRUDER_AUTO_FAN_SPEED : 0;
495 495
         // this idiom allows both digital and PWM fan outputs (see M42 handling).
496 496
         digitalWrite(pin, newFanSpeed);
497 497
         analogWrite(pin, newFanSpeed);
498
-        SBI(fanDone, fanBit[f]);
498
+        SBI(fanDone, bit);
499 499
       }
500 500
     }
501 501
   }

+ 3
- 2
Marlin/ubl.h View File

@@ -138,10 +138,11 @@
138 138
         static bool look_for_lines_to_connect();
139 139
         static bool turn_on_heaters();
140 140
         static bool prime_nozzle();
141
-        static void retract_filament(float where[XYZE]);
142
-        static void recover_filament(float where[XYZE]);
141
+        static void retract_filament(const float where[XYZE]);
142
+        static void recover_filament(const float where[XYZE]);
143 143
         static void print_line_from_here_to_there(const float&, const float&, const float&, const float&, const float&, const float&);
144 144
         static void move_to(const float&, const float&, const float&, const float&);
145
+        inline static void move_to(const float where[XYZE], const float &de) { move_to(where[X_AXIS], where[Y_AXIS], where[Z_AXIS], de); }
145 146
       #endif
146 147
 
147 148
     public:

+ 23
- 14
Marlin/ubl_G29.cpp View File

@@ -1593,24 +1593,33 @@
1593 1593
   typedef struct { uint8_t sx, ex, sy, ey; bool yfirst; } smart_fill_info;
1594 1594
 
1595 1595
   void unified_bed_leveling::smart_fill_mesh() {
1596
-    const smart_fill_info info[] = {
1597
-      { 0, GRID_MAX_POINTS_X,      0, GRID_MAX_POINTS_Y - 2,  false },  // Bottom of the mesh looking up
1598
-      { 0, GRID_MAX_POINTS_X,      GRID_MAX_POINTS_Y - 1, 0,  false },  // Top of the mesh looking down
1599
-      { 0, GRID_MAX_POINTS_X - 2,  0, GRID_MAX_POINTS_Y,      true  },  // Left side of the mesh looking right
1600
-      { GRID_MAX_POINTS_X - 1, 0,  0, GRID_MAX_POINTS_Y,      true  }   // Right side of the mesh looking left
1601
-    };
1596
+    static const smart_fill_info
1597
+      info0 PROGMEM = { 0, GRID_MAX_POINTS_X,      0, GRID_MAX_POINTS_Y - 2,  false },  // Bottom of the mesh looking up
1598
+      info1 PROGMEM = { 0, GRID_MAX_POINTS_X,      GRID_MAX_POINTS_Y - 1, 0,  false },  // Top of the mesh looking down
1599
+      info2 PROGMEM = { 0, GRID_MAX_POINTS_X - 2,  0, GRID_MAX_POINTS_Y,      true  },  // Left side of the mesh looking right
1600
+      info3 PROGMEM = { GRID_MAX_POINTS_X - 1, 0,  0, GRID_MAX_POINTS_Y,      true  };  // Right side of the mesh looking left
1601
+    static const smart_fill_info * const info[] PROGMEM = { &info0, &info1, &info2, &info3 };
1602
+
1603
+    // static const smart_fill_info info[] PROGMEM = {
1604
+    //   { 0, GRID_MAX_POINTS_X,      0, GRID_MAX_POINTS_Y - 2,  false } PROGMEM,  // Bottom of the mesh looking up
1605
+    //   { 0, GRID_MAX_POINTS_X,      GRID_MAX_POINTS_Y - 1, 0,  false } PROGMEM,  // Top of the mesh looking down
1606
+    //   { 0, GRID_MAX_POINTS_X - 2,  0, GRID_MAX_POINTS_Y,      true  } PROGMEM,  // Left side of the mesh looking right
1607
+    //   { GRID_MAX_POINTS_X - 1, 0,  0, GRID_MAX_POINTS_Y,      true  } PROGMEM   // Right side of the mesh looking left
1608
+    // };
1602 1609
     for (uint8_t i = 0; i < COUNT(info); ++i) {
1603
-      const smart_fill_info &f = info[i];
1604
-      if (f.yfirst) {
1605
-        const int8_t dir = f.ex > f.sx ? 1 : -1;
1606
-        for (uint8_t y = f.sy; y != f.ey; ++y)
1607
-          for (uint8_t x = f.sx; x != f.ex; x += dir)
1610
+      const smart_fill_info *f = (smart_fill_info*)pgm_read_word(&info[i]);
1611
+      const int8_t sx = pgm_read_word(&f->sx), sy = pgm_read_word(&f->sy),
1612
+                   ex = pgm_read_word(&f->ex), ey = pgm_read_word(&f->ey);
1613
+      if (pgm_read_byte(&f->yfirst)) {
1614
+        const int8_t dir = ex > sx ? 1 : -1;
1615
+        for (uint8_t y = sy; y != ey; ++y)
1616
+          for (uint8_t x = sx; x != ex; x += dir)
1608 1617
             if (smart_fill_one(x, y, dir, 0)) break;
1609 1618
       }
1610 1619
       else {
1611
-        const int8_t dir = f.ey > f.sy ? 1 : -1;
1612
-         for (uint8_t x = f.sx; x != f.ex; ++x)
1613
-          for (uint8_t y = f.sy; y != f.ey; y += dir)
1620
+        const int8_t dir = ey > sy ? 1 : -1;
1621
+         for (uint8_t x = sx; x != ex; ++x)
1622
+          for (uint8_t y = sy; y != ey; y += dir)
1614 1623
             if (smart_fill_one(x, y, 0, dir)) break;
1615 1624
       }
1616 1625
     }

+ 8
- 10
Marlin/ubl_motion.cpp View File

@@ -67,19 +67,17 @@
67 67
 
68 68
     const float de = destination[E_AXIS] - current_position[E_AXIS];
69 69
 
70
-    if (de == 0.0) return;
70
+    if (de == 0.0) return; // Printing moves only
71 71
 
72
-    const float dx = current_position[X_AXIS] - destination[X_AXIS],
73
-                dy = current_position[Y_AXIS] - destination[Y_AXIS],
72
+    const float dx = destination[X_AXIS] - current_position[X_AXIS],
73
+                dy = destination[Y_AXIS] - current_position[Y_AXIS],
74 74
                 xy_dist = HYPOT(dx, dy);
75 75
 
76
-    if (xy_dist == 0.0)
77
-      return;
78
-    else {
79
-      SERIAL_ECHOPGM("   fpmm=");
80
-      const float fpmm = de / xy_dist;
81
-      SERIAL_ECHO_F(fpmm, 6);
82
-    }
76
+    if (xy_dist == 0.0) return;
77
+
78
+    SERIAL_ECHOPGM("   fpmm=");
79
+    const float fpmm = de / xy_dist;
80
+    SERIAL_ECHO_F(fpmm, 6);
83 81
 
84 82
     SERIAL_ECHOPGM("    current=( ");
85 83
     SERIAL_ECHO_F(current_position[X_AXIS], 6);

+ 17
- 20
Marlin/ultralcd.cpp View File

@@ -686,8 +686,13 @@ void kill_screen(const char* lcd_msg) {
686 686
     else lcd_buzz(20, 440);
687 687
   }
688 688
 
689
-  inline void line_to_current(AxisEnum axis) {
690
-    planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[axis]), active_extruder);
689
+  inline void line_to_current_z() {
690
+    planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[Z_AXIS]), active_extruder);
691
+  }
692
+
693
+  inline void line_to_z(const float &z) {
694
+    current_position[Z_AXIS] = z;
695
+    line_to_current_z();
691 696
   }
692 697
 
693 698
   #if ENABLED(SDSUPPORT)
@@ -1521,8 +1526,7 @@ void kill_screen(const char* lcd_msg) {
1521 1526
     //
1522 1527
     void _lcd_after_probing() {
1523 1528
       #if MANUAL_PROBE_HEIGHT > 0
1524
-        current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT;
1525
-        line_to_current(Z_AXIS);
1529
+        line_to_z(LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT);
1526 1530
       #endif
1527 1531
       // Display "Done" screen and wait for moves to complete
1528 1532
       #if MANUAL_PROBE_HEIGHT > 0 || ENABLED(MESH_BED_LEVELING)
@@ -1539,15 +1543,13 @@ void kill_screen(const char* lcd_msg) {
1539 1543
       // Utility to go to the next mesh point
1540 1544
       inline void _manual_probe_goto_xy(float x, float y) {
1541 1545
         #if MANUAL_PROBE_HEIGHT > 0
1542
-          current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT;
1543
-          line_to_current(Z_AXIS);
1546
+          line_to_z(LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT);
1544 1547
         #endif
1545 1548
         current_position[X_AXIS] = LOGICAL_X_POSITION(x);
1546 1549
         current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
1547 1550
         planner.buffer_line_kinematic(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder);
1548 1551
         #if MANUAL_PROBE_HEIGHT > 0
1549
-          current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS);
1550
-          line_to_current(Z_AXIS);
1552
+          line_to_z(LOGICAL_Z_POSITION(Z_MIN_POS));
1551 1553
         #endif
1552 1554
         lcd_synchronize();
1553 1555
       }
@@ -1629,10 +1631,8 @@ void kill_screen(const char* lcd_msg) {
1629 1631
       //
1630 1632
       if (encoderPosition) {
1631 1633
         refresh_cmd_timeout();
1632
-        current_position[Z_AXIS] += float((int32_t)encoderPosition) * (MBL_Z_STEP);
1633
-        NOLESS(current_position[Z_AXIS], -(LCD_PROBE_Z_RANGE) * 0.5);
1634
-        NOMORE(current_position[Z_AXIS],  (LCD_PROBE_Z_RANGE) * 0.5);
1635
-        line_to_current(Z_AXIS);
1634
+        const float z = current_position[Z_AXIS] + float((int32_t)encoderPosition) * (MBL_Z_STEP);
1635
+        line_to_z(constrain(z, -(LCD_PROBE_Z_RANGE) * 0.5, (LCD_PROBE_Z_RANGE) * 0.5));
1636 1636
         lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
1637 1637
         encoderPosition = 0;
1638 1638
       }
@@ -2299,15 +2299,13 @@ void kill_screen(const char* lcd_msg) {
2299 2299
         reset_bed_level(); // After calibration bed-level data is no longer valid
2300 2300
       #endif
2301 2301
 
2302
-      current_position[Z_AXIS] = max(Z_HOMING_HEIGHT, Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5;
2303
-      line_to_current(Z_AXIS);
2302
+      line_to_z(max(Z_HOMING_HEIGHT, Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5);
2304 2303
 
2305 2304
       current_position[X_AXIS] = a < 0 ? LOGICAL_X_POSITION(X_HOME_POS) : cos(RADIANS(a)) * delta_calibration_radius;
2306 2305
       current_position[Y_AXIS] = a < 0 ? LOGICAL_Y_POSITION(Y_HOME_POS) : sin(RADIANS(a)) * delta_calibration_radius;
2307
-      line_to_current(Z_AXIS);
2306
+      line_to_current_z();
2308 2307
 
2309
-      current_position[Z_AXIS] = 4.0;
2310
-      line_to_current(Z_AXIS);
2308
+      line_to_z(4.0);
2311 2309
 
2312 2310
       lcd_synchronize();
2313 2311
 
@@ -2536,8 +2534,7 @@ void kill_screen(const char* lcd_msg) {
2536 2534
     #if ENABLED(DELTA)
2537 2535
       #define _MOVE_XY_ALLOWED (current_position[Z_AXIS] <= delta_clip_start_height)
2538 2536
       void lcd_lower_z_to_clip_height() {
2539
-        current_position[Z_AXIS] = delta_clip_start_height;
2540
-        line_to_current(Z_AXIS);
2537
+        line_to_z(delta_clip_start_height);
2541 2538
         lcd_synchronize();
2542 2539
       }
2543 2540
     #else
@@ -4179,7 +4176,7 @@ void pad_message_string() {
4179 4176
     // pad with spaces to fill up the line
4180 4177
     while (j++ < LCD_WIDTH) lcd_status_message[i++] = ' ';
4181 4178
     // chop off at the edge
4182
-    lcd_status_message[i] = '\0';
4179
+    lcd_status_message[--i] = '\0';
4183 4180
   }
4184 4181
 }
4185 4182
 

+ 37
- 45
Marlin/ultralcd_impl_HD44780.h View File

@@ -193,18 +193,19 @@ extern volatile uint8_t buttons;  //an extended version of the last checked butt
193 193
   static void lcd_implementation_update_indicators();
194 194
 #endif
195 195
 
196
-
197
-static void createChar_P(char c, PROGMEM byte *ptr) {
196
+static void createChar_P(const char c, const byte * const ptr) {
198 197
   byte temp[8];
199
-  int8_t i;
200
-
201
-  for(i=0; i<8; i++)  {
198
+  for (uint8_t i = 0; i < 8; i++)
202 199
     temp[i] = pgm_read_byte(&ptr[i]);
203
-  }
204 200
   lcd.createChar(c, temp);
205 201
 }
206 202
 
207
-const static PROGMEM byte bedTemp[8] = {
203
+static void lcd_set_custom_characters(
204
+  #if ENABLED(LCD_PROGRESS_BAR)
205
+    const bool info_screen_charset = true
206
+  #endif
207
+) {
208
+  const static PROGMEM byte bedTemp[8] = {
208 209
     B00000,
209 210
     B11111,
210 211
     B10101,
@@ -213,9 +214,9 @@ const static PROGMEM byte bedTemp[8] = {
213 214
     B11111,
214 215
     B00000,
215 216
     B00000
216
-};
217
+  };
217 218
 
218
-const static PROGMEM byte degree[8] = {
219
+  const static PROGMEM byte degree[8] = {
219 220
     B01100,
220 221
     B10010,
221 222
     B10010,
@@ -226,7 +227,7 @@ const static PROGMEM byte degree[8] = {
226 227
     B00000
227 228
   };
228 229
 
229
-const static PROGMEM byte thermometer[8] = {
230
+  const static PROGMEM byte thermometer[8] = {
230 231
     B00100,
231 232
     B01010,
232 233
     B01010,
@@ -237,7 +238,7 @@ const static PROGMEM byte thermometer[8] = {
237 238
     B01110
238 239
   };
239 240
 
240
-const static PROGMEM byte uplevel[8] = {
241
+  const static PROGMEM byte uplevel[8] = {
241 242
     B00100,
242 243
     B01110,
243 244
     B11111,
@@ -246,9 +247,9 @@ const static PROGMEM byte uplevel[8] = {
246 247
     B00000,
247 248
     B00000,
248 249
     B00000
249
-};
250
+  };
250 251
 
251
-const static PROGMEM byte feedrate[8] = {
252
+  const static PROGMEM byte feedrate[8] = {
252 253
     B11100,
253 254
     B10000,
254 255
     B11000,
@@ -257,9 +258,9 @@ const static PROGMEM byte feedrate[8] = {
257 258
     B00110,
258 259
     B00101,
259 260
     B00000
260
-};
261
+  };
261 262
 
262
-const static PROGMEM byte clock[8] = {
263
+  const static PROGMEM byte clock[8] = {
263 264
     B00000,
264 265
     B01110,
265 266
     B10011,
@@ -268,10 +269,10 @@ const static PROGMEM byte clock[8] = {
268 269
     B01110,
269 270
     B00000,
270 271
     B00000
271
-};
272
+  };
272 273
 
273
-#if ENABLED(SDSUPPORT)
274
-  const static PROGMEM byte refresh[8] = {
274
+  #if ENABLED(SDSUPPORT)
275
+    const static PROGMEM byte refresh[8] = {
275 276
       B00000,
276 277
       B00110,
277 278
       B11001,
@@ -280,8 +281,8 @@ const static PROGMEM byte clock[8] = {
280 281
       B10011,
281 282
       B01100,
282 283
       B00000,
283
-  };
284
-  const static PROGMEM byte folder[8] = {
284
+    };
285
+    const static PROGMEM byte folder[8] = {
285 286
       B00000,
286 287
       B11100,
287 288
       B11111,
@@ -290,10 +291,10 @@ const static PROGMEM byte clock[8] = {
290 291
       B11111,
291 292
       B00000,
292 293
       B00000
293
-  };
294
+    };
294 295
 
295
-  #if ENABLED(LCD_PROGRESS_BAR)
296
-    const static PROGMEM byte progress[3][8] = { {
296
+    #if ENABLED(LCD_PROGRESS_BAR)
297
+      const static PROGMEM byte progress[3][8] = { {
297 298
         B00000,
298 299
         B10000,
299 300
         B10000,
@@ -321,14 +322,8 @@ const static PROGMEM byte clock[8] = {
321 322
         B10101,
322 323
         B00000
323 324
       } };
325
+    #endif
324 326
   #endif
325
-#endif
326
-
327
-static void lcd_set_custom_characters(
328
-  #if ENABLED(LCD_PROGRESS_BAR)
329
-    const bool info_screen_charset = true
330
-  #endif
331
-) {
332 327
 
333 328
   createChar_P(LCD_BEDTEMP_CHAR, bedTemp);
334 329
   createChar_P(LCD_DEGREE_CHAR, degree);
@@ -445,7 +440,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
445 440
   }
446 441
 
447 442
   void bootscreen() {
448
-    byte top_left[8] = {
443
+    const static PROGMEM byte corner[4][8] = { {
449 444
       B00000,
450 445
       B00000,
451 446
       B00000,
@@ -454,8 +449,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
454 449
       B00010,
455 450
       B00100,
456 451
       B00100
457
-    };
458
-    byte top_right[8] = {
452
+    }, {
459 453
       B00000,
460 454
       B00000,
461 455
       B00000,
@@ -464,8 +458,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
464 458
       B01100,
465 459
       B00100,
466 460
       B00100
467
-    };
468
-    byte botom_left[8] = {
461
+    }, {
469 462
       B00100,
470 463
       B00010,
471 464
       B00001,
@@ -474,8 +467,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
474 467
       B00000,
475 468
       B00000,
476 469
       B00000
477
-    };
478
-    byte botom_right[8] = {
470
+    }, {
479 471
       B00100,
480 472
       B01000,
481 473
       B10000,
@@ -484,11 +476,9 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
484 476
       B00000,
485 477
       B00000,
486 478
       B00000
487
-    };
488
-    lcd.createChar(0, top_left);
489
-    lcd.createChar(1, top_right);
490
-    lcd.createChar(2, botom_left);
491
-    lcd.createChar(3, botom_right);
479
+    } };
480
+    for (uint8_t i = 0; i < 4; i++)
481
+      createChar_P(i, corner[i]);
492 482
 
493 483
     lcd.clear();
494 484
 
@@ -638,10 +628,12 @@ FORCE_INLINE void _draw_heater_status(const int8_t heater, const char prefix, co
638 628
 #if ENABLED(LCD_PROGRESS_BAR)
639 629
 
640 630
   inline void lcd_draw_progress_bar(const uint8_t percent) {
641
-    int tix = (int)(percent * (LCD_WIDTH) * 3) / 100,
642
-      cel = tix / 3, rem = tix % 3, i = LCD_WIDTH;
631
+    const int tix = (int)(percent * (LCD_WIDTH) * 3) / 100,
632
+              cel = tix / 3,
633
+              rem = tix % 3;
634
+    uint8_t i = LCD_WIDTH;
643 635
     char msg[LCD_WIDTH + 1], b = ' ';
644
-    msg[i] = '\0';
636
+    msg[LCD_WIDTH] = '\0';
645 637
     while (i--) {
646 638
       if (i == cel - 1)
647 639
         b = LCD_STR_PROGRESS[2];

Loading…
Cancel
Save