Bläddra i källkod

Merge remote-tracking branch 'upstream/bugfix-1.1.x' into release_113

Scott Lahteine 8 år sedan
förälder
incheckning
87b591bf53
89 ändrade filer med 4066 tillägg och 521 borttagningar
  1. 5
    2
      Marlin/Conditionals_LCD.h
  2. 5
    0
      Marlin/Conditionals_post.h
  3. 2
    1
      Marlin/Configuration.h
  4. 13
    7
      Marlin/Configuration_adv.h
  5. 2
    3
      Marlin/G26_Mesh_Validation_Tool.cpp
  6. 4
    0
      Marlin/Marlin.h
  7. 254
    68
      Marlin/Marlin_main.cpp
  8. 8
    4
      Marlin/SanityCheck.h
  9. 1
    0
      Marlin/boards.h
  10. 1
    1
      Marlin/example_configurations/Cartesio/Configuration.h
  11. 11
    7
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  12. 1
    1
      Marlin/example_configurations/Felix/Configuration.h
  13. 11
    7
      Marlin/example_configurations/Felix/Configuration_adv.h
  14. 1
    1
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  15. 1
    1
      Marlin/example_configurations/FolgerTech-i3-2020/Configuration.h
  16. 12
    8
      Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h
  17. 1
    1
      Marlin/example_configurations/Hephestos/Configuration.h
  18. 11
    7
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  19. 1
    1
      Marlin/example_configurations/Hephestos_2/Configuration.h
  20. 11
    7
      Marlin/example_configurations/Hephestos_2/Configuration_adv.h
  21. 2
    1
      Marlin/example_configurations/K8200/Configuration.h
  22. 11
    7
      Marlin/example_configurations/K8200/Configuration_adv.h
  23. 2
    1
      Marlin/example_configurations/K8400/Configuration.h
  24. 11
    7
      Marlin/example_configurations/K8400/Configuration_adv.h
  25. 2
    1
      Marlin/example_configurations/K8400/Dual-head/Configuration.h
  26. 1611
    0
      Marlin/example_configurations/M150/Configuration.h
  27. 1264
    0
      Marlin/example_configurations/M150/Configuration_adv.h
  28. 3
    0
      Marlin/example_configurations/M150/README.md
  29. 104
    0
      Marlin/example_configurations/M150/_Bootscreen.h
  30. 2
    1
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  31. 1
    1
      Marlin/example_configurations/RigidBot/Configuration.h
  32. 11
    7
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  33. 1
    1
      Marlin/example_configurations/SCARA/Configuration.h
  34. 11
    7
      Marlin/example_configurations/SCARA/Configuration_adv.h
  35. 1
    1
      Marlin/example_configurations/TAZ4/Configuration.h
  36. 11
    7
      Marlin/example_configurations/TAZ4/Configuration_adv.h
  37. 2
    1
      Marlin/example_configurations/TinyBoy2/Configuration.h
  38. 11
    7
      Marlin/example_configurations/TinyBoy2/Configuration_adv.h
  39. 1
    1
      Marlin/example_configurations/WITBOX/Configuration.h
  40. 11
    7
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  41. 2
    1
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  42. 2
    1
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h
  43. 11
    7
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
  44. 2
    1
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h
  45. 11
    7
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
  46. 2
    1
      Marlin/example_configurations/delta/generic/Configuration.h
  47. 11
    7
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  48. 2
    1
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  49. 11
    7
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  50. 1
    1
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  51. 11
    7
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  52. 1
    1
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  53. 11
    7
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  54. 1
    1
      Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h
  55. 12
    8
      Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h
  56. 2
    1
      Marlin/example_configurations/makibox/Configuration.h
  57. 11
    7
      Marlin/example_configurations/makibox/Configuration_adv.h
  58. 1
    1
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  59. 11
    7
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  60. 2
    1
      Marlin/example_configurations/wt150/Configuration.h
  61. 11
    7
      Marlin/example_configurations/wt150/Configuration_adv.h
  62. 91
    1
      Marlin/fastio.h
  63. 5
    2
      Marlin/gcode.cpp
  64. 4
    4
      Marlin/gcode.h
  65. 3
    1
      Marlin/language_en.h
  66. 0
    1
      Marlin/macros.h
  67. 2
    0
      Marlin/pins.h
  68. 5
    7
      Marlin/pins_AZTEEG_X3.h
  69. 8
    10
      Marlin/pins_AZTEEG_X3_PRO.h
  70. 4
    1
      Marlin/pins_CHEAPTRONICv2.h
  71. 4
    1
      Marlin/pins_PRINTRBOARD.h
  72. 4
    1
      Marlin/pins_PRINTRBOARD_REVF.h
  73. 4
    1
      Marlin/pins_RAMBO.h
  74. 4
    4
      Marlin/pins_RAMPS.h
  75. 4
    1
      Marlin/pins_SCOOVO_X9H.h
  76. 39
    0
      Marlin/pins_ZRIB_V20.h
  77. 20
    18
      Marlin/planner.cpp
  78. 49
    13
      Marlin/stepper.cpp
  79. 0
    4
      Marlin/temperature.cpp
  80. 0
    4
      Marlin/temperature.h
  81. 11
    5
      Marlin/ubl.cpp
  82. 2
    1
      Marlin/ubl.h
  83. 42
    19
      Marlin/ubl_G29.cpp
  84. 126
    80
      Marlin/ubl_motion.cpp
  85. 49
    47
      Marlin/ultralcd.cpp
  86. 1
    1
      Marlin/ultralcd.h
  87. 11
    11
      Marlin/ultralcd_impl_DOGM.h
  88. 9
    14
      Marlin/ultralcd_impl_HD44780.h
  89. 7
    2
      Marlin/utf_mapper.h

+ 5
- 2
Marlin/Conditionals_LCD.h Visa fil

@@ -101,12 +101,15 @@
101 101
   #if ENABLED(ULTIMAKERCONTROLLER)              \
102 102
    || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
103 103
    || ENABLED(G3D_PANEL)                        \
104
-   || ENABLED(RIGIDBOT_PANEL)                   \
105
-   || ENABLED(REPRAPWORLD_KEYPAD)
104
+   || ENABLED(RIGIDBOT_PANEL)
106 105
     #define ULTIPANEL
107 106
     #define NEWPANEL
108 107
   #endif
109 108
 
109
+  #if ENABLED(REPRAPWORLD_KEYPAD)
110
+    #define NEWPANEL
111
+  #endif
112
+
110 113
   #if ENABLED(RA_CONTROL_PANEL)
111 114
     #define LCD_I2C_TYPE_PCA8574
112 115
     #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander

+ 5
- 0
Marlin/Conditionals_post.h Visa fil

@@ -847,4 +847,9 @@
847 847
   // Add commands that need sub-codes to this list
848 848
   #define USE_GCODE_SUBCODES ENABLED(G38_PROBE_TARGET)
849 849
 
850
+  // MESH_BED_LEVELING overrides PROBE_MANUALLY
851
+  #if ENABLED(MESH_BED_LEVELING)
852
+    #undef PROBE_MANUALLY
853
+  #endif
854
+
850 855
 #endif // CONDITIONALS_POST_H

+ 2
- 1
Marlin/Configuration.h Visa fil

@@ -312,6 +312,7 @@
312 312
   #define K1 0.95 //smoothing factor within the PID
313 313
 
314 314
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
315
+
315 316
   // Ultimaker
316 317
   #define  DEFAULT_Kp 22.2
317 318
   #define  DEFAULT_Ki 1.08
@@ -1154,7 +1155,7 @@
1154 1155
  *  - Click the controller to view the LCD menu
1155 1156
  *  - The LCD will display Japanese, Western, or Cyrillic text
1156 1157
  *
1157
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1158
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1158 1159
  *
1159 1160
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1160 1161
  */

+ 13
- 7
Marlin/Configuration_adv.h Visa fil

@@ -220,12 +220,18 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
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
229 235
 #endif
230 236
 
231 237
 //===========================================================================
@@ -1023,7 +1029,7 @@
1023 1029
    */
1024 1030
   #define  TMC2130_ADV() {  }
1025 1031
 
1026
-#endif // ENABLED(HAVE_TMC2130)
1032
+#endif // HAVE_TMC2130
1027 1033
 
1028 1034
 // @section L6470
1029 1035
 

+ 2
- 3
Marlin/G26_Mesh_Validation_Tool.cpp Visa fil

@@ -718,7 +718,7 @@
718 718
     /**
719 719
      * Wait until all parameters are verified before altering the state!
720 720
      */
721
-    state.active = !parser.seen('D');
721
+    set_bed_leveling_enabled(!parser.seen('D'));
722 722
 
723 723
     return UBL_OK;
724 724
   }
@@ -734,7 +734,7 @@
734 734
    * wait for them to get up to temperature.
735 735
    */
736 736
   bool unified_bed_leveling::turn_on_heaters() {
737
-    millis_t next;
737
+    millis_t next = millis() + 5000UL;
738 738
     #if HAS_TEMP_BED
739 739
       #if ENABLED(ULTRA_LCD)
740 740
         if (g26_bed_temp > 25) {
@@ -743,7 +743,6 @@
743 743
       #endif
744 744
           has_control_of_lcd_panel = true;
745 745
           thermalManager.setTargetBed(g26_bed_temp);
746
-          next = millis() + 5000UL;
747 746
           while (abs(thermalManager.degBed() - g26_bed_temp) > 3) {
748 747
             if (ubl_lcd_clicked()) return exit_from_g26();
749 748
             if (PENDING(millis(), next)) {

+ 4
- 0
Marlin/Marlin.h Visa fil

@@ -35,6 +35,10 @@
35 35
 
36 36
 #include "MarlinConfig.h"
37 37
 
38
+#ifdef DEBUG_GCODE_PARSER
39
+  #include "gcode.h"
40
+#endif
41
+
38 42
 #include "enum.h"
39 43
 #include "types.h"
40 44
 #include "fastio.h"

+ 254
- 68
Marlin/Marlin_main.cpp Visa fil

@@ -176,7 +176,7 @@
176 176
  * M304 - Set bed PID parameters P I and D. (Requires PIDTEMPBED)
177 177
  * M350 - Set microstepping mode. (Requires digital microstepping pins.)
178 178
  * M351 - Toggle MS1 MS2 pins directly. (Requires digital microstepping pins.)
179
- * M355 - Turn the Case Light on/off and set its brightness. (Requires CASE_LIGHT_PIN)
179
+ * M355 - Set Case Light on/off and set brightness. (Requires CASE_LIGHT_PIN)
180 180
  * M380 - Activate solenoid on active extruder. (Requires EXT_SOLENOID)
181 181
  * M381 - Disable all solenoids. (Requires EXT_SOLENOID)
182 182
  * M400 - Finish all moves.
@@ -566,16 +566,6 @@ static uint8_t target_extruder;
566 566
   ;
567 567
 #endif
568 568
 
569
-#if HAS_CASE_LIGHT
570
-  bool case_light_on =
571
-    #if ENABLED(CASE_LIGHT_DEFAULT_ON)
572
-      true
573
-    #else
574
-      false
575
-    #endif
576
-  ;
577
-#endif
578
-
579 569
 #if ENABLED(DELTA)
580 570
 
581 571
   float delta[ABC],
@@ -709,7 +699,8 @@ void set_current_from_steppers_for_axis(const AxisEnum axis);
709 699
 #endif
710 700
 
711 701
 void tool_change(const uint8_t tmp_extruder, const float fr_mm_s=0.0, bool no_move=false);
712
-static void report_current_position();
702
+void report_current_position();
703
+void report_current_position_detail();
713 704
 
714 705
 #if ENABLED(DEBUG_LEVELING_FEATURE)
715 706
   void print_xyz(const char* prefix, const char* suffix, const float x, const float y, const float z) {
@@ -720,7 +711,8 @@ static void report_current_position();
720 711
     SERIAL_ECHOPAIR(", ", z);
721 712
     SERIAL_CHAR(')');
722 713
 
723
-    suffix ? serialprintPGM(suffix) : SERIAL_EOL;
714
+    if (suffix) {serialprintPGM(suffix);}  //won't compile for Teensy with the previous construction
715
+    else SERIAL_EOL;
724 716
   }
725 717
 
726 718
   void print_xyz(const char* prefix, const char* suffix, const float xyz[]) {
@@ -1545,14 +1537,21 @@ inline void set_destination_to_current() { COPY(destination, current_position);
1545 1537
       if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_uninterpolated_move_to_destination", destination);
1546 1538
     #endif
1547 1539
 
1548
-    if ( current_position[X_AXIS] == destination[X_AXIS]
1549
-      && current_position[Y_AXIS] == destination[Y_AXIS]
1550
-      && current_position[Z_AXIS] == destination[Z_AXIS]
1551
-      && current_position[E_AXIS] == destination[E_AXIS]
1552
-    ) return;
1553
-
1554 1540
     refresh_cmd_timeout();
1555
-    planner.buffer_line_kinematic(destination, MMS_SCALED(fr_mm_s ? fr_mm_s : feedrate_mm_s), active_extruder);
1541
+
1542
+    #if UBL_DELTA
1543
+      // ubl segmented line will do z-only moves in single segment
1544
+      ubl.prepare_segmented_line_to(destination, MMS_SCALED(fr_mm_s ? fr_mm_s : feedrate_mm_s));
1545
+    #else
1546
+      if ( current_position[X_AXIS] == destination[X_AXIS]
1547
+        && current_position[Y_AXIS] == destination[Y_AXIS]
1548
+        && current_position[Z_AXIS] == destination[Z_AXIS]
1549
+        && current_position[E_AXIS] == destination[E_AXIS]
1550
+      ) return;
1551
+
1552
+      planner.buffer_line_kinematic(destination, MMS_SCALED(fr_mm_s ? fr_mm_s : feedrate_mm_s), active_extruder);
1553
+    #endif
1554
+
1556 1555
     set_current_to_destination();
1557 1556
   }
1558 1557
 #endif // IS_KINEMATIC
@@ -2354,18 +2353,21 @@ static void clean_up_after_endstop_or_probe_move() {
2354 2353
         if (enabling) planner.unapply_leveling(current_position);
2355 2354
 
2356 2355
       #elif ENABLED(AUTO_BED_LEVELING_UBL)
2357
-
2358 2356
         #if PLANNER_LEVELING
2359
-
2360
-          if (!enable)   // leveling from on to off
2357
+          if (ubl.state.active) {                       // leveling from on to off
2358
+            // change unleveled current_position to physical current_position without moving steppers.
2361 2359
             planner.apply_leveling(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]);
2362
-          else
2360
+            ubl.state.active = false;                   // disable only AFTER calling apply_leveling
2361
+          }
2362
+          else {                                        // leveling from off to on
2363
+            ubl.state.active = true;                    // enable BEFORE calling unapply_leveling, otherwise ignored
2364
+            // change physical current_position to unleveled current_position without moving steppers.
2363 2365
             planner.unapply_leveling(current_position);
2364
-
2366
+          }
2367
+        #else
2368
+          ubl.state.active = enable;                    // just flip the bit, current_position will be wrong until next move.
2365 2369
         #endif
2366 2370
 
2367
-        ubl.state.active = enable;
2368
-
2369 2371
       #else // ABL
2370 2372
 
2371 2373
         #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
@@ -2374,8 +2376,12 @@ static void clean_up_after_endstop_or_probe_move() {
2374 2376
           (void)bilinear_z_offset(reset);
2375 2377
         #endif
2376 2378
 
2379
+        // Enable or disable leveling compensation in the planner
2377 2380
         planner.abl_enabled = enable;
2381
+
2378 2382
         if (!enable)
2383
+          // When disabling just get the current position from the steppers.
2384
+          // This will yield the smallest error when first converted back to steps.
2379 2385
           set_current_from_steppers_for_axis(
2380 2386
             #if ABL_PLANAR
2381 2387
               ALL_AXES
@@ -2384,26 +2390,44 @@ static void clean_up_after_endstop_or_probe_move() {
2384 2390
             #endif
2385 2391
           );
2386 2392
         else
2393
+          // When enabling, remove compensation from the current position,
2394
+          // so compensation will give the right stepper counts.
2387 2395
           planner.unapply_leveling(current_position);
2388 2396
 
2389
-      #endif
2397
+      #endif // ABL
2390 2398
     }
2391 2399
   }
2392 2400
 
2393 2401
   #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
2394 2402
 
2395 2403
     void set_z_fade_height(const float zfh) {
2396
-      planner.z_fade_height = zfh;
2397
-      planner.inverse_z_fade_height = RECIPROCAL(zfh);
2398 2404
 
2399
-      if (leveling_is_active())
2400
-        set_current_from_steppers_for_axis(
2401
-          #if ABL_PLANAR
2402
-            ALL_AXES
2403
-          #else
2404
-            Z_AXIS
2405
-          #endif
2406
-        );
2405
+      const bool level_active = leveling_is_active();
2406
+
2407
+      #if ENABLED(AUTO_BED_LEVELING_UBL)
2408
+
2409
+        if (level_active)
2410
+          set_bed_leveling_enabled(false);  // turn off before changing fade height for proper apply/unapply leveling to maintain current_position
2411
+        planner.z_fade_height = zfh;
2412
+        planner.inverse_z_fade_height = RECIPROCAL(zfh);
2413
+        if (level_active)
2414
+          set_bed_leveling_enabled(true);  // turn back on after changing fade height
2415
+
2416
+      #else
2417
+
2418
+        planner.z_fade_height = zfh;
2419
+        planner.inverse_z_fade_height = RECIPROCAL(zfh);
2420
+
2421
+        if (level_active) {
2422
+          set_current_from_steppers_for_axis(
2423
+            #if ABL_PLANAR
2424
+              ALL_AXES
2425
+            #else
2426
+              Z_AXIS
2427
+            #endif
2428
+          );
2429
+        }
2430
+      #endif
2407 2431
     }
2408 2432
 
2409 2433
   #endif // LEVELING_FADE_HEIGHT
@@ -3665,6 +3689,7 @@ inline void gcode_G28(const bool always_home_all) {
3665 3689
   #if ENABLED(DELTA)
3666 3690
 
3667 3691
     home_delta();
3692
+    UNUSED(always_home_all);
3668 3693
 
3669 3694
   #else // NOT DELTA
3670 3695
 
@@ -4178,19 +4203,19 @@ void home_all_axes() { gcode_G28(true); }
4178 4203
       ABL_VAR int left_probe_bed_position, right_probe_bed_position, front_probe_bed_position, back_probe_bed_position;
4179 4204
       ABL_VAR float xGridSpacing, yGridSpacing;
4180 4205
 
4181
-      #if ABL_PLANAR
4206
+      #if ENABLED(AUTO_BED_LEVELING_LINEAR)
4182 4207
         ABL_VAR uint8_t abl_grid_points_x = GRID_MAX_POINTS_X,
4183 4208
                         abl_grid_points_y = GRID_MAX_POINTS_Y;
4184 4209
         ABL_VAR bool do_topography_map;
4185
-      #else // 3-point
4210
+      #else // Bilinear
4186 4211
         uint8_t constexpr abl_grid_points_x = GRID_MAX_POINTS_X,
4187 4212
                           abl_grid_points_y = GRID_MAX_POINTS_Y;
4188 4213
       #endif
4189 4214
 
4190 4215
       #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(PROBE_MANUALLY)
4191
-        #if ABL_PLANAR
4216
+        #if ENABLED(AUTO_BED_LEVELING_LINEAR)
4192 4217
           ABL_VAR int abl2;
4193
-        #else // 3-point
4218
+        #else // Bilinear
4194 4219
           int constexpr abl2 = GRID_MAX_POINTS;
4195 4220
         #endif
4196 4221
       #endif
@@ -4210,6 +4235,8 @@ void home_all_axes() { gcode_G28(true); }
4210 4235
 
4211 4236
     #elif ENABLED(AUTO_BED_LEVELING_3POINT)
4212 4237
 
4238
+      int constexpr abl2 = 3;
4239
+
4213 4240
       // Probe at 3 arbitrary points
4214 4241
       ABL_VAR vector_3 points[3] = {
4215 4242
         vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, 0),
@@ -4502,7 +4529,7 @@ void home_all_axes() { gcode_G28(true); }
4502 4529
 
4503 4530
         #elif ENABLED(AUTO_BED_LEVELING_3POINT)
4504 4531
 
4505
-          points[i].z = measured_z;
4532
+          points[abl_probe_index].z = measured_z;
4506 4533
 
4507 4534
         #endif
4508 4535
       }
@@ -5263,7 +5290,7 @@ void home_all_axes() { gcode_G28(true); }
5263 5290
 
5264 5291
           recalc_delta_settings(delta_radius, delta_diagonal_rod);
5265 5292
         }
5266
-        else if(zero_std_dev >= test_precision) {   // step one back
5293
+        else if (zero_std_dev >= test_precision) {   // step one back
5267 5294
           COPY(endstop_adj, e_old);
5268 5295
           delta_radius = dr_old;
5269 5296
           home_offset[Z_AXIS] = zh_old;
@@ -5940,7 +5967,8 @@ inline void gcode_M17() {
5940 5967
       idle();
5941 5968
       wait_for_heatup = false;
5942 5969
       HOTEND_LOOP() {
5943
-        if (abs(thermalManager.degHotend(e) - thermalManager.degTargetHotend(e)) > 3) {
5970
+        const int16_t target_temp = thermalManager.degTargetHotend(e);
5971
+        if (target_temp && abs(thermalManager.degHotend(e) - target_temp) > 3) {
5944 5972
           wait_for_heatup = true;
5945 5973
           break;
5946 5974
         }
@@ -6362,9 +6390,8 @@ inline void gcode_M42() {
6362 6390
       #endif
6363 6391
 
6364 6392
       SERIAL_PROTOCOLLNPGM(". deploy & stow 4 times");
6365
-      pinMode(PROBE_TEST_PIN, INPUT_PULLUP);
6366
-      bool deploy_state;
6367
-      bool stow_state;
6393
+      SET_INPUT_PULLUP(PROBE_TEST_PIN);
6394
+      bool deploy_state, stow_state;
6368 6395
       for (uint8_t i = 0; i < 4; i++) {
6369 6396
         servo[probe_index].move(z_servo_angle[0]); //deploy
6370 6397
         safe_delay(500);
@@ -7601,7 +7628,7 @@ inline void gcode_M92() {
7601 7628
 /**
7602 7629
  * Output the current position to serial
7603 7630
  */
7604
-static void report_current_position() {
7631
+void report_current_position() {
7605 7632
   SERIAL_PROTOCOLPGM("X:");
7606 7633
   SERIAL_PROTOCOL(current_position[X_AXIS]);
7607 7634
   SERIAL_PROTOCOLPGM(" Y:");
@@ -7620,10 +7647,119 @@ static void report_current_position() {
7620 7647
   #endif
7621 7648
 }
7622 7649
 
7650
+#ifdef M114_DETAIL
7651
+
7652
+  static const char axis_char[XYZE] = {'X','Y','Z','E'};
7653
+
7654
+  void report_xyze(const float pos[XYZE], uint8_t n = 4, uint8_t precision = 3) {
7655
+    char str[12];
7656
+    for(uint8_t i=0; i<n; i++) {
7657
+      SERIAL_CHAR(' ');
7658
+      SERIAL_CHAR(axis_char[i]);
7659
+      SERIAL_CHAR(':');
7660
+      SERIAL_PROTOCOL(dtostrf(pos[i],8,precision,str));
7661
+    }
7662
+    SERIAL_EOL;
7663
+  }
7664
+
7665
+  inline void report_xyz(const float pos[XYZ]) {
7666
+    report_xyze(pos,3);
7667
+  }
7668
+
7669
+  void report_current_position_detail() {
7670
+
7671
+    stepper.synchronize();
7672
+
7673
+    SERIAL_EOL;
7674
+    SERIAL_PROTOCOLPGM("Logical:");
7675
+    report_xyze(current_position);
7676
+
7677
+    SERIAL_PROTOCOLPGM("Raw:    ");
7678
+    const float raw[XYZ] = {
7679
+      RAW_X_POSITION(current_position[X_AXIS]),
7680
+      RAW_Y_POSITION(current_position[Y_AXIS]),
7681
+      RAW_Z_POSITION(current_position[Z_AXIS])
7682
+    };
7683
+    report_xyz(raw);
7684
+
7685
+    SERIAL_PROTOCOLPGM("Leveled:");
7686
+    float leveled[XYZ] = {
7687
+      current_position[X_AXIS],
7688
+      current_position[Y_AXIS],
7689
+      current_position[Z_AXIS]
7690
+    };
7691
+    planner.apply_leveling(leveled);
7692
+    report_xyz(leveled);
7693
+
7694
+    SERIAL_PROTOCOLPGM("UnLevel:");
7695
+    float unleveled[XYZ] = { leveled[X_AXIS], leveled[Y_AXIS], leveled[Z_AXIS] };
7696
+    planner.unapply_leveling(unleveled);
7697
+    report_xyz(unleveled);
7698
+
7699
+    #if IS_KINEMATIC
7700
+      #if IS_SCARA
7701
+        SERIAL_PROTOCOLPGM("ScaraK: ");
7702
+      #else
7703
+        SERIAL_PROTOCOLPGM("DeltaK: ");
7704
+      #endif
7705
+      inverse_kinematics(leveled);  // writes delta[]
7706
+      report_xyz(delta);
7707
+    #endif
7708
+
7709
+    SERIAL_PROTOCOLPGM("Stepper:");
7710
+    const float step_count[XYZE] = {
7711
+      (float)stepper.position(X_AXIS),
7712
+      (float)stepper.position(Y_AXIS),
7713
+      (float)stepper.position(Z_AXIS),
7714
+      (float)stepper.position(E_AXIS)
7715
+    };
7716
+    report_xyze(step_count,4,0);
7717
+
7718
+    #if IS_SCARA
7719
+      const float deg[XYZ] = {
7720
+        stepper.get_axis_position_degrees(A_AXIS),
7721
+        stepper.get_axis_position_degrees(B_AXIS)
7722
+      };
7723
+      SERIAL_PROTOCOLPGM("Degrees:");
7724
+      report_xyze(deg,2);
7725
+    #endif
7726
+
7727
+    SERIAL_PROTOCOLPGM("FromStp:");
7728
+    get_cartesian_from_steppers();  // writes cartes[XYZ] (with forward kinematics)
7729
+    const float from_steppers[XYZE] = {
7730
+      cartes[X_AXIS],
7731
+      cartes[Y_AXIS],
7732
+      cartes[Z_AXIS],
7733
+      stepper.get_axis_position_mm(E_AXIS)
7734
+    };
7735
+    report_xyze(from_steppers);
7736
+
7737
+    const float diff[XYZE] = {
7738
+      from_steppers[X_AXIS] - leveled[X_AXIS],
7739
+      from_steppers[Y_AXIS] - leveled[Y_AXIS],
7740
+      from_steppers[Z_AXIS] - leveled[Z_AXIS],
7741
+      from_steppers[E_AXIS] - current_position[E_AXIS]
7742
+    };
7743
+    SERIAL_PROTOCOLPGM("Differ: ");
7744
+    report_xyze(diff);
7745
+  }
7746
+#endif // M114_DETAIL
7747
+
7623 7748
 /**
7624 7749
  * M114: Output current position to serial port
7625 7750
  */
7626
-inline void gcode_M114() { stepper.synchronize(); report_current_position(); }
7751
+inline void gcode_M114() {
7752
+
7753
+  #ifdef M114_DETAIL
7754
+    if ( parser.seen('D') ) {
7755
+      report_current_position_detail();
7756
+      return;
7757
+    }
7758
+  #endif
7759
+
7760
+  stepper.synchronize();
7761
+  report_current_position();
7762
+  }
7627 7763
 
7628 7764
 /**
7629 7765
  * M115: Capabilities string
@@ -7678,11 +7814,18 @@ inline void gcode_M115() {
7678 7814
       SERIAL_PROTOCOLLNPGM("Cap:SOFTWARE_POWER:0");
7679 7815
     #endif
7680 7816
 
7681
-    // TOGGLE_LIGHTS (M355)
7817
+    // CASE LIGHTS (M355)
7682 7818
     #if HAS_CASE_LIGHT
7683 7819
       SERIAL_PROTOCOLLNPGM("Cap:TOGGLE_LIGHTS:1");
7820
+      bool USEABLE_HARDWARE_PWM(uint8_t pin);
7821
+      if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) {
7822
+        SERIAL_PROTOCOLLNPGM("Cap:CASE_LIGHT_BRIGHTNESS:1");
7823
+      }
7824
+      else
7825
+        SERIAL_PROTOCOLLNPGM("Cap:CASE_LIGHT_BRIGHTNESS:0");
7684 7826
     #else
7685 7827
       SERIAL_PROTOCOLLNPGM("Cap:TOGGLE_LIGHTS:0");
7828
+      SERIAL_PROTOCOLLNPGM("Cap:CASE_LIGHT_BRIGHTNESS:0");
7686 7829
     #endif
7687 7830
 
7688 7831
     // EMERGENCY_PARSER (M108, M112, M410)
@@ -9472,30 +9615,54 @@ inline void gcode_M907() {
9472 9615
 #endif // HAS_MICROSTEPS
9473 9616
 
9474 9617
 #if HAS_CASE_LIGHT
9475
-
9476
-  uint8_t case_light_brightness = 255;
9618
+  #ifndef INVERT_CASE_LIGHT
9619
+    #define INVERT_CASE_LIGHT false
9620
+  #endif
9621
+  int case_light_brightness;  // LCD routine wants INT
9622
+  bool case_light_on;
9477 9623
 
9478 9624
   void update_case_light() {
9479
-    WRITE(CASE_LIGHT_PIN, case_light_on != INVERT_CASE_LIGHT ? HIGH : LOW);
9480
-    analogWrite(CASE_LIGHT_PIN, case_light_on != INVERT_CASE_LIGHT ? case_light_brightness : 0);
9625
+    pinMode(CASE_LIGHT_PIN, OUTPUT); // digitalWrite doesn't set the port mode
9626
+    uint8_t case_light_bright = (uint8_t)case_light_brightness;
9627
+    if (case_light_on) {
9628
+      if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) {
9629
+        analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 - case_light_brightness : case_light_brightness );
9630
+      }
9631
+      else digitalWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? LOW : HIGH );
9632
+    }
9633
+    else digitalWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? HIGH : LOW);
9481 9634
   }
9482
-
9483 9635
 #endif // HAS_CASE_LIGHT
9484 9636
 
9485 9637
 /**
9486
- * M355: Turn case lights on/off and set brightness
9638
+ * M355: Turn case light on/off and set brightness
9487 9639
  *
9488
- *   S<bool>  Turn case light on or off
9489
- *   P<byte>  Set case light brightness (PWM pin required)
9640
+ *   P<byte>  Set case light brightness (PWM pin required - ignored otherwise)
9641
+ *
9642
+ *   S<bool>  Set case light on/off
9643
+ *
9644
+ *   When S turns on the light on a PWM pin then the current brightness level is used/restored
9645
+ *
9646
+ *   M355 P200 S0 turns off the light & sets the brightness level
9647
+ *   M355 S1 turns on the light with a brightness of 200 (assuming a PWM pin)
9490 9648
  */
9491 9649
 inline void gcode_M355() {
9492 9650
   #if HAS_CASE_LIGHT
9493
-    if (parser.seen('P')) case_light_brightness = parser.value_byte();
9494
-    if (parser.seen('S')) case_light_on = parser.value_bool();
9495
-    update_case_light();
9651
+    uint8_t args = 0;
9652
+    if (parser.seen('P')) ++args, case_light_brightness = parser.value_byte();
9653
+    if (parser.seen('S')) ++args, case_light_on = parser.value_bool();
9654
+    if (args) update_case_light();
9655
+
9656
+    // always report case light status
9496 9657
     SERIAL_ECHO_START;
9497
-    SERIAL_ECHOPGM("Case lights ");
9498
-    case_light_on ? SERIAL_ECHOLNPGM("on") : SERIAL_ECHOLNPGM("off");
9658
+    if (!case_light_on) {
9659
+      SERIAL_ECHOLN("Case light: off");
9660
+    }
9661
+    else {
9662
+      if (!USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) SERIAL_ECHOLN("Case light: on");
9663
+      else SERIAL_ECHOLNPAIR("Case light: ", case_light_brightness);
9664
+    }
9665
+
9499 9666
   #else
9500 9667
     SERIAL_ERROR_START;
9501 9668
     SERIAL_ERRORLNPGM(MSG_ERR_M355_NONE);
@@ -10710,7 +10877,7 @@ void process_next_command() {
10710 10877
 
10711 10878
       #endif // HAS_MICROSTEPS
10712 10879
 
10713
-      case 355: // M355 Turn case lights on/off
10880
+      case 355: // M355 set case light brightness
10714 10881
         gcode_M355();
10715 10882
         break;
10716 10883
 
@@ -10782,6 +10949,15 @@ void ok_to_send() {
10782 10949
   /**
10783 10950
    * Constrain the given coordinates to the software endstops.
10784 10951
    */
10952
+
10953
+  // NOTE: This makes no sense for delta beds other than Z-axis.
10954
+  //       For delta the X/Y would need to be clamped at
10955
+  //       DELTA_PRINTABLE_RADIUS from center of bed, but delta
10956
+  //       now enforces is_position_reachable for X/Y regardless
10957
+  //       of HAS_SOFTWARE_ENDSTOPS, so that enforcement would be
10958
+  //       redundant here.  Probably should #ifdef out the X/Y
10959
+  //       axis clamps here for delta and just leave the Z clamp.
10960
+
10785 10961
   void clamp_to_software_endstops(float target[XYZ]) {
10786 10962
     if (!soft_endstops_enabled) return;
10787 10963
     #if ENABLED(MIN_SOFTWARE_ENDSTOPS)
@@ -11575,14 +11751,14 @@ void prepare_move_to_destination() {
11575 11751
   if (
11576 11752
     #if IS_KINEMATIC
11577 11753
       #if UBL_DELTA
11578
-        ubl.prepare_linear_move_to(destination, feedrate_mm_s)
11754
+        ubl.prepare_segmented_line_to(destination, feedrate_mm_s)
11579 11755
       #else
11580 11756
         prepare_kinematic_move_to(destination)
11581 11757
       #endif
11582 11758
     #elif ENABLED(DUAL_X_CARRIAGE)
11583 11759
       prepare_move_to_destination_dualx()
11584 11760
     #elif UBL_DELTA // will work for CARTESIAN too (smaller segments follow mesh more closely)
11585
-      ubl.prepare_linear_move_to(destination, feedrate_mm_s)
11761
+      ubl.prepare_segmented_line_to(destination, feedrate_mm_s)
11586 11762
     #else
11587 11763
       prepare_move_to_destination_cartesian()
11588 11764
     #endif
@@ -11827,7 +12003,7 @@ void prepare_move_to_destination() {
11827 12003
     else
11828 12004
       C2 = (HYPOT2(sx, sy) - (L1_2 + L2_2)) / (2.0 * L1 * L2);
11829 12005
 
11830
-    S2 = sqrt(sq(C2) - 1);
12006
+    S2 = sqrt(1 - sq(C2));
11831 12007
 
11832 12008
     // Unrotated Arm1 plus rotated Arm2 gives the distance from Center to End
11833 12009
     SK1 = L1 + L2 * C2;
@@ -12459,6 +12635,8 @@ void setup() {
12459 12635
   #endif
12460 12636
 
12461 12637
   #if HAS_CASE_LIGHT
12638
+    case_light_on = CASE_LIGHT_DEFAULT_ON;
12639
+    case_light_brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS;
12462 12640
     update_case_light();
12463 12641
   #endif
12464 12642
 
@@ -12552,6 +12730,14 @@ void setup() {
12552 12730
   #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
12553 12731
     setup_endstop_interrupts();
12554 12732
   #endif
12733
+  
12734
+  #if ENABLED(SWITCHING_EXTRUDER)
12735
+    move_extruder_servo(0);  // Initialize extruder servo
12736
+  #endif
12737
+
12738
+  #if ENABLED(SWITCHING_NOZZLE)
12739
+    move_nozzle_servo(0);  // Initialize nozzle servo
12740
+  #endif
12555 12741
 }
12556 12742
 
12557 12743
 /**

+ 8
- 4
Marlin/SanityCheck.h Visa fil

@@ -319,11 +319,11 @@
319 319
  * Advanced Pause
320 320
  */
321 321
 #if ENABLED(ADVANCED_PAUSE_FEATURE)
322
-  #if DISABLED(ULTIPANEL)
322
+  #if DISABLED(NEWPANEL)
323 323
     #error "ADVANCED_PAUSE_FEATURE currently requires an LCD controller."
324 324
   #elif ENABLED(EXTRUDER_RUNOUT_PREVENT)
325 325
     #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE."
326
-  #elif ENABLED(PARK_HEAD_ON_PAUSE) && DISABLED(SDSUPPORT) && DISABLED(ULTIPANEL) && DISABLED(EMERGENCY_PARSER)
326
+  #elif ENABLED(PARK_HEAD_ON_PAUSE) && DISABLED(SDSUPPORT) && DISABLED(NEWPANEL) && DISABLED(EMERGENCY_PARSER)
327 327
     #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller."
328 328
   #endif
329 329
 #endif
@@ -598,8 +598,12 @@ static_assert(1 >= 0
598 598
 /**
599 599
  * LCD_BED_LEVELING requirements
600 600
  */
601
-#if ENABLED(LCD_BED_LEVELING) && DISABLED(MESH_BED_LEVELING) && !(HAS_ABL && ENABLED(PROBE_MANUALLY))
602
-  #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or PROBE_MANUALLY."
601
+#if ENABLED(LCD_BED_LEVELING)
602
+  #if DISABLED(ULTIPANEL)
603
+    #error "LCD_BED_LEVELING requires an LCD controller."
604
+  #elif DISABLED(MESH_BED_LEVELING) && !(HAS_ABL && ENABLED(PROBE_MANUALLY))
605
+    #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or PROBE_MANUALLY."
606
+  #endif
603 607
 #endif
604 608
 
605 609
 /**

+ 1
- 0
Marlin/boards.h Visa fil

@@ -95,6 +95,7 @@
95 95
 #define BOARD_BAM_DICE          401  // 2PrintBeta BAM&DICE with STK drivers
96 96
 #define BOARD_BAM_DICE_DUE      402  // 2PrintBeta BAM&DICE Due with STK drivers
97 97
 #define BOARD_BQ_ZUM_MEGA_3D    503  // bq ZUM Mega 3D
98
+#define BOARD_ZRIB_V20          504  // zrib V2.0 control board (Chinese knock off RAMPS replica)
98 99
 
99 100
 #define MB(board) (MOTHERBOARD==BOARD_##board)
100 101
 

+ 1
- 1
Marlin/example_configurations/Cartesio/Configuration.h Visa fil

@@ -1152,7 +1152,7 @@
1152 1152
  *  - Click the controller to view the LCD menu
1153 1153
  *  - The LCD will display Japanese, Western, or Cyrillic text
1154 1154
  *
1155
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1155
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1156 1156
  *
1157 1157
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1158 1158
  */

+ 11
- 7
Marlin/example_configurations/Cartesio/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 35
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1016,7 +1020,7 @@
1016 1020
    */
1017 1021
   #define  TMC2130_ADV() {  }
1018 1022
 
1019
-#endif // ENABLED(HAVE_TMC2130)
1023
+#endif // HAVE_TMC2130
1020 1024
 
1021 1025
 // @section L6470
1022 1026
 

+ 1
- 1
Marlin/example_configurations/Felix/Configuration.h Visa fil

@@ -1136,7 +1136,7 @@
1136 1136
  *  - Click the controller to view the LCD menu
1137 1137
  *  - The LCD will display Japanese, Western, or Cyrillic text
1138 1138
  *
1139
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1139
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1140 1140
  *
1141 1141
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1142 1142
  */

+ 11
- 7
Marlin/example_configurations/Felix/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1016,7 +1020,7 @@
1016 1020
    */
1017 1021
   #define  TMC2130_ADV() {  }
1018 1022
 
1019
-#endif // ENABLED(HAVE_TMC2130)
1023
+#endif // HAVE_TMC2130
1020 1024
 
1021 1025
 // @section L6470
1022 1026
 

+ 1
- 1
Marlin/example_configurations/Felix/DUAL/Configuration.h Visa fil

@@ -1136,7 +1136,7 @@
1136 1136
  *  - Click the controller to view the LCD menu
1137 1137
  *  - The LCD will display Japanese, Western, or Cyrillic text
1138 1138
  *
1139
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1139
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1140 1140
  *
1141 1141
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1142 1142
  */

+ 1
- 1
Marlin/example_configurations/FolgerTech-i3-2020/Configuration.h Visa fil

@@ -1158,7 +1158,7 @@
1158 1158
  *  - Click the controller to view the LCD menu
1159 1159
  *  - The LCD will display Japanese, Western, or Cyrillic text
1160 1160
  *
1161
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1161
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1162 1162
  *
1163 1163
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1164 1164
  */

+ 12
- 8
Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -784,7 +788,7 @@
784 788
   #define PAUSE_PARK_Z_FEEDRATE 5             // Z axis feedrate in mm/s (not used for delta printers)
785 789
   #define PAUSE_PARK_RETRACT_FEEDRATE 60      // Initial retract feedrate in mm/s
786 790
   #define PAUSE_PARK_RETRACT_LENGTH 2         // Initial retract in mm
787
- 
791
+
788 792
                                               // It is a short retract used immediately after print interrupt before move to filament exchange position
789 793
   #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10  // Unload filament feedrate in mm/s - filament unloading can be fast
790 794
   #define FILAMENT_CHANGE_UNLOAD_LENGTH 100   // Unload filament length from hotend in mm
@@ -1025,7 +1029,7 @@
1025 1029
    */
1026 1030
   #define  TMC2130_ADV() {  }
1027 1031
 
1028
-#endif // ENABLED(HAVE_TMC2130)
1032
+#endif // HAVE_TMC2130
1029 1033
 
1030 1034
 // @section L6470
1031 1035
 

+ 1
- 1
Marlin/example_configurations/Hephestos/Configuration.h Visa fil

@@ -1144,7 +1144,7 @@
1144 1144
  *  - Click the controller to view the LCD menu
1145 1145
  *  - The LCD will display Japanese, Western, or Cyrillic text
1146 1146
  *
1147
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1147
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1148 1148
  *
1149 1149
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1150 1150
  */

+ 11
- 7
Marlin/example_configurations/Hephestos/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1016,7 +1020,7 @@
1016 1020
    */
1017 1021
   #define  TMC2130_ADV() {  }
1018 1022
 
1019
-#endif // ENABLED(HAVE_TMC2130)
1023
+#endif // HAVE_TMC2130
1020 1024
 
1021 1025
 // @section L6470
1022 1026
 

+ 1
- 1
Marlin/example_configurations/Hephestos_2/Configuration.h Visa fil

@@ -1147,7 +1147,7 @@
1147 1147
  *  - Click the controller to view the LCD menu
1148 1148
  *  - The LCD will display Japanese, Western, or Cyrillic text
1149 1149
  *
1150
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1150
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1151 1151
  *
1152 1152
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1153 1153
  */

+ 11
- 7
Marlin/example_configurations/Hephestos_2/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1000,7 +1004,7 @@
1000 1004
    */
1001 1005
   #define  TMC2130_ADV() {  }
1002 1006
 
1003
-#endif // ENABLED(HAVE_TMC2130)
1007
+#endif // HAVE_TMC2130
1004 1008
 
1005 1009
 // @section L6470
1006 1010
 

+ 2
- 1
Marlin/example_configurations/K8200/Configuration.h Visa fil

@@ -332,6 +332,7 @@
332 332
   #define K1 0.95 //smoothing factor within the PID
333 333
 
334 334
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
335
+
335 336
   // Ultimaker
336 337
   //#define  DEFAULT_Kp 22.2
337 338
   //#define  DEFAULT_Ki 1.08
@@ -1185,7 +1186,7 @@
1185 1186
  *  - Click the controller to view the LCD menu
1186 1187
  *  - The LCD will display Japanese, Western, or Cyrillic text
1187 1188
  *
1188
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1189
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1189 1190
  *
1190 1191
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1191 1192
  */

+ 11
- 7
Marlin/example_configurations/K8200/Configuration_adv.h Visa fil

@@ -233,12 +233,16 @@
233 233
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
234 234
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
235 235
 
236
-// Define a pin to turn case light on/off
237
-//#define CASE_LIGHT_PIN 4
238
-#if PIN_EXISTS(CASE_LIGHT)
239
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
240
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
241
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
236
+/**
237
+ * M355 Case Light on-off / brightness
238
+ */
239
+//#define CASE_LIGHT_ENABLE
240
+#if ENABLED(CASE_LIGHT_ENABLE)
241
+  //#define CASE_LIGHT_PIN 4                  // Override the default pin if needed
242
+  #define INVERT_CASE_LIGHT false             // Set true if Case Light is ON when pin is LOW
243
+  #define CASE_LIGHT_DEFAULT_ON true          // Set default power-up state on
244
+  #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105   // Set default power-up brightness (0-255, requires PWM pin)
245
+  //#define MENU_ITEM_CASE_LIGHT              // Add a Case Light option to the LCD main menu
242 246
 #endif
243 247
 
244 248
 //===========================================================================
@@ -1029,7 +1033,7 @@
1029 1033
    */
1030 1034
   #define  TMC2130_ADV() {  }
1031 1035
 
1032
-#endif // ENABLED(HAVE_TMC2130)
1036
+#endif // HAVE_TMC2130
1033 1037
 
1034 1038
 // @section L6470
1035 1039
 

+ 2
- 1
Marlin/example_configurations/K8400/Configuration.h Visa fil

@@ -312,6 +312,7 @@
312 312
   #define K1 0.95 //smoothing factor within the PID
313 313
 
314 314
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
315
+
315 316
   // Ultimaker
316 317
   //#define  DEFAULT_Kp 22.2
317 318
   //#define  DEFAULT_Ki 1.08
@@ -1153,7 +1154,7 @@
1153 1154
  *  - Click the controller to view the LCD menu
1154 1155
  *  - The LCD will display Japanese, Western, or Cyrillic text
1155 1156
  *
1156
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1157
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1157 1158
  *
1158 1159
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1159 1160
  */

+ 11
- 7
Marlin/example_configurations/K8400/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1016,7 +1020,7 @@
1016 1020
    */
1017 1021
   #define  TMC2130_ADV() {  }
1018 1022
 
1019
-#endif // ENABLED(HAVE_TMC2130)
1023
+#endif // HAVE_TMC2130
1020 1024
 
1021 1025
 // @section L6470
1022 1026
 

+ 2
- 1
Marlin/example_configurations/K8400/Dual-head/Configuration.h Visa fil

@@ -312,6 +312,7 @@
312 312
   #define K1 0.95 //smoothing factor within the PID
313 313
 
314 314
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
315
+
315 316
   // Ultimaker
316 317
   //#define  DEFAULT_Kp 22.2
317 318
   //#define  DEFAULT_Ki 1.08
@@ -1153,7 +1154,7 @@
1153 1154
  *  - Click the controller to view the LCD menu
1154 1155
  *  - The LCD will display Japanese, Western, or Cyrillic text
1155 1156
  *
1156
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1157
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1157 1158
  *
1158 1159
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1159 1160
  */

+ 1611
- 0
Marlin/example_configurations/M150/Configuration.h
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 1264
- 0
Marlin/example_configurations/M150/Configuration_adv.h
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 3
- 0
Marlin/example_configurations/M150/README.md Visa fil

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

+ 104
- 0
Marlin/example_configurations/M150/_Bootscreen.h Visa fil

@@ -0,0 +1,104 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * Custom Bitmap for splashscreen
25
+ *
26
+ * You may use one of the following tools to generate the C++ bitmap array from
27
+ * a black and white image:
28
+ *
29
+ *  - http://www.marlinfw.org/tools/u8glib/converter.html
30
+ *  - http://www.digole.com/tools/PicturetoC_Hex_converter.php
31
+ */
32
+#include <avr/pgmspace.h>
33
+
34
+#define CUSTOM_BOOTSCREEN_TIMEOUT   1000
35
+#define CUSTOM_BOOTSCREEN_BMPWIDTH  128
36
+#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64
37
+
38
+const unsigned char custom_start_bmp[1024] PROGMEM = {
39
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
40
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
41
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
42
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
43
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
44
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
45
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
46
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
47
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
48
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
49
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
50
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
51
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
52
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
53
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
54
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
55
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
56
+,0x07,0x00,0x00,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
57
+,0x1f,0xc0,0x00,0x0f,0xe0,0x7c,0x03,0xe0,0x78,0x1c,0x07,0x81,0xe0,0xf0,0x3e,0x0e
58
+,0x7f,0xe0,0x00,0x3f,0xf0,0x7e,0x07,0xe0,0xfc,0x1c,0x03,0x81,0xc1,0xf8,0x3f,0x0e
59
+,0x7f,0xf8,0x00,0x7f,0xf0,0x7e,0x07,0xe0,0xfc,0x1c,0x03,0xc3,0xc1,0xf8,0x3f,0x0e
60
+,0x7b,0xfe,0x01,0xfe,0xf0,0x7f,0x0f,0xe1,0xfe,0x1c,0x01,0xc3,0x83,0xfc,0x3f,0x8e
61
+,0x7c,0xff,0x87,0xf9,0xf0,0x77,0x0e,0xe1,0xfe,0x1c,0x01,0xe7,0x83,0xfc,0x3b,0x8e
62
+,0x7f,0x7f,0xcf,0xf7,0xf0,0x77,0x9e,0xe1,0xce,0x1c,0x00,0xe7,0x03,0x9c,0x3b,0xce
63
+,0x7f,0x9f,0xff,0xcf,0xf0,0x73,0x9c,0xe3,0xcf,0x1c,0x00,0xff,0x07,0x9e,0x39,0xce
64
+,0x7f,0xe7,0xff,0x3f,0xf0,0x73,0xfc,0xe3,0x87,0x1c,0x00,0x7e,0x07,0x0e,0x39,0xee
65
+,0x7f,0xfb,0xfe,0xff,0xf0,0x71,0xf8,0xe3,0x87,0x1c,0x00,0x7e,0x0f,0x0f,0x38,0xee
66
+,0x7f,0xfc,0xf9,0xff,0xf0,0x71,0xf8,0xe7,0xff,0x9c,0x00,0x3c,0x0f,0xff,0x38,0xfe
67
+,0x7f,0xff,0x27,0xff,0xf0,0x70,0xf0,0xe7,0xff,0x9c,0x00,0x3c,0x0f,0xff,0x38,0x7e
68
+,0x7f,0xff,0xdf,0xff,0xf0,0x70,0xf0,0xef,0xff,0xdc,0x00,0x3c,0x1f,0xff,0xb8,0x7e
69
+,0x7f,0xdf,0xff,0xdf,0xf0,0x70,0x60,0xef,0x03,0xdf,0xf8,0x3c,0x1e,0x07,0xb8,0x3e
70
+,0x7f,0xc7,0xff,0x1f,0xf0,0x70,0x60,0xee,0x01,0xdf,0xf8,0x3c,0x1c,0x03,0xb8,0x3e
71
+,0x7f,0xc3,0xfe,0x1f,0xf0,0x70,0x00,0xee,0x01,0xdf,0xf8,0x3c,0x1c,0x03,0xb8,0x1e
72
+,0x7f,0xc3,0xfe,0x1f,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
73
+,0x7f,0xc3,0xde,0x1f,0xf0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe
74
+,0x7f,0xc3,0xde,0x1f,0xf0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe
75
+,0x7f,0xc3,0xde,0x1f,0xf0,0x7c,0x3f,0xfa,0xfb,0xff,0xff,0xff,0xfd,0x7a,0xbf,0xfe
76
+,0x7f,0xc3,0xde,0x1f,0xf0,0x7d,0x9f,0xfb,0xff,0xff,0xff,0xff,0xff,0x7e,0xf7,0xfe
77
+,0x7f,0xc3,0xde,0x1f,0xf0,0x7d,0x93,0x1a,0x8a,0x18,0xe3,0x8c,0x45,0x1a,0xa2,0xde
78
+,0x3f,0xc3,0xde,0x0f,0xf0,0x7c,0x2d,0xca,0xca,0xd6,0xe9,0x24,0xcd,0x6a,0xb6,0xbe
79
+,0x1f,0x83,0xde,0x07,0xe0,0x7d,0xa3,0x6a,0x9a,0xd6,0xe9,0x26,0x65,0x6a,0xb6,0x3e
80
+,0x06,0x03,0xde,0x01,0x80,0x7d,0x91,0x0a,0x8a,0xd8,0xe3,0x8c,0x45,0x1a,0xb3,0x7e
81
+,0x00,0x03,0xde,0x00,0x00,0x7f,0xff,0xff,0xff,0xfe,0xef,0xff,0xff,0xff,0xff,0x7e
82
+,0x00,0x03,0xde,0x00,0x00,0x7f,0xff,0xff,0xff,0xf1,0xef,0xff,0xff,0xff,0xfe,0xfe
83
+,0x00,0x03,0xde,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe
84
+,0x00,0x03,0xde,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe
85
+,0x00,0x03,0xde,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
86
+,0x00,0x01,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
87
+,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
88
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
89
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
90
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
91
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
92
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
93
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
94
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
95
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
96
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
97
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
98
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
99
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
100
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
101
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
102
+,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
103
+
104
+};

+ 2
- 1
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h Visa fil

@@ -312,6 +312,7 @@
312 312
   #define K1 0.95 //smoothing factor within the PID
313 313
 
314 314
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
315
+
315 316
   // Ultimaker
316 317
   #define  DEFAULT_Kp 22.2
317 318
   #define  DEFAULT_Ki 1.08
@@ -1153,7 +1154,7 @@
1153 1154
  *  - Click the controller to view the LCD menu
1154 1155
  *  - The LCD will display Japanese, Western, or Cyrillic text
1155 1156
  *
1156
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1157
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1157 1158
  *
1158 1159
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1159 1160
  */

+ 1
- 1
Marlin/example_configurations/RigidBot/Configuration.h Visa fil

@@ -1152,7 +1152,7 @@
1152 1152
  *  - Click the controller to view the LCD menu
1153 1153
  *  - The LCD will display Japanese, Western, or Cyrillic text
1154 1154
  *
1155
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1155
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1156 1156
  *
1157 1157
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1158 1158
  */

+ 11
- 7
Marlin/example_configurations/RigidBot/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1016,7 +1020,7 @@
1016 1020
    */
1017 1021
   #define  TMC2130_ADV() {  }
1018 1022
 
1019
-#endif // ENABLED(HAVE_TMC2130)
1023
+#endif // HAVE_TMC2130
1020 1024
 
1021 1025
 // @section L6470
1022 1026
 

+ 1
- 1
Marlin/example_configurations/SCARA/Configuration.h Visa fil

@@ -1169,7 +1169,7 @@
1169 1169
  *  - Click the controller to view the LCD menu
1170 1170
  *  - The LCD will display Japanese, Western, or Cyrillic text
1171 1171
  *
1172
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1172
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1173 1173
  *
1174 1174
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1175 1175
  */

+ 11
- 7
Marlin/example_configurations/SCARA/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1016,7 +1020,7 @@
1016 1020
    */
1017 1021
   #define  TMC2130_ADV() {  }
1018 1022
 
1019
-#endif // ENABLED(HAVE_TMC2130)
1023
+#endif // HAVE_TMC2130
1020 1024
 
1021 1025
 // @section L6470
1022 1026
 

+ 1
- 1
Marlin/example_configurations/TAZ4/Configuration.h Visa fil

@@ -1173,7 +1173,7 @@
1173 1173
  *  - Click the controller to view the LCD menu
1174 1174
  *  - The LCD will display Japanese, Western, or Cyrillic text
1175 1175
  *
1176
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1176
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1177 1177
  *
1178 1178
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1179 1179
  */

+ 11
- 7
Marlin/example_configurations/TAZ4/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1016,7 +1020,7 @@
1016 1020
    */
1017 1021
   #define  TMC2130_ADV() {  }
1018 1022
 
1019
-#endif // ENABLED(HAVE_TMC2130)
1023
+#endif // HAVE_TMC2130
1020 1024
 
1021 1025
 // @section L6470
1022 1026
 

+ 2
- 1
Marlin/example_configurations/TinyBoy2/Configuration.h Visa fil

@@ -339,6 +339,7 @@
339 339
   #define K1 0.95 //smoothing factor within the PID
340 340
 
341 341
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
342
+
342 343
   // Ultimaker
343 344
   //#define  DEFAULT_Kp 22.2
344 345
   //#define  DEFAULT_Ki 1.08
@@ -1209,7 +1210,7 @@
1209 1210
  *  - Click the controller to view the LCD menu
1210 1211
  *  - The LCD will display Japanese, Western, or Cyrillic text
1211 1212
  *
1212
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1213
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1213 1214
  *
1214 1215
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1215 1216
  */

+ 11
- 7
Marlin/example_configurations/TinyBoy2/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1019,7 +1023,7 @@
1019 1023
    */
1020 1024
   #define  TMC2130_ADV() {  }
1021 1025
 
1022
-#endif // ENABLED(HAVE_TMC2130)
1026
+#endif // HAVE_TMC2130
1023 1027
 
1024 1028
 // @section L6470
1025 1029
 

+ 1
- 1
Marlin/example_configurations/WITBOX/Configuration.h Visa fil

@@ -1144,7 +1144,7 @@
1144 1144
  *  - Click the controller to view the LCD menu
1145 1145
  *  - The LCD will display Japanese, Western, or Cyrillic text
1146 1146
  *
1147
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1147
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1148 1148
  *
1149 1149
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1150 1150
  */

+ 11
- 7
Marlin/example_configurations/WITBOX/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1016,7 +1020,7 @@
1016 1020
    */
1017 1021
   #define  TMC2130_ADV() {  }
1018 1022
 
1019
-#endif // ENABLED(HAVE_TMC2130)
1023
+#endif // HAVE_TMC2130
1020 1024
 
1021 1025
 // @section L6470
1022 1026
 

+ 2
- 1
Marlin/example_configurations/adafruit/ST7565/Configuration.h Visa fil

@@ -312,6 +312,7 @@
312 312
   #define K1 0.95 //smoothing factor within the PID
313 313
 
314 314
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
315
+
315 316
   // Ultimaker
316 317
   #define  DEFAULT_Kp 22.2
317 318
   #define  DEFAULT_Ki 1.08
@@ -1153,7 +1154,7 @@
1153 1154
  *  - Click the controller to view the LCD menu
1154 1155
  *  - The LCD will display Japanese, Western, or Cyrillic text
1155 1156
  *
1156
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1157
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1157 1158
  *
1158 1159
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1159 1160
  */

+ 2
- 1
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h Visa fil

@@ -312,6 +312,7 @@
312 312
   #define K1 0.95 //smoothing factor within the PID
313 313
 
314 314
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
315
+
315 316
   // Ultimaker
316 317
   //#define  DEFAULT_Kp 22.2
317 318
   //#define  DEFAULT_Ki 1.08
@@ -1271,7 +1272,7 @@
1271 1272
  *  - Click the controller to view the LCD menu
1272 1273
  *  - The LCD will display Japanese, Western, or Cyrillic text
1273 1274
  *
1274
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1275
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1275 1276
  *
1276 1277
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1277 1278
  */

+ 11
- 7
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1021,7 +1025,7 @@
1021 1025
    */
1022 1026
   #define  TMC2130_ADV() {  }
1023 1027
 
1024
-#endif // ENABLED(HAVE_TMC2130)
1028
+#endif // HAVE_TMC2130
1025 1029
 
1026 1030
 // @section L6470
1027 1031
 

+ 2
- 1
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h Visa fil

@@ -312,6 +312,7 @@
312 312
   #define K1 0.95 //smoothing factor within the PID
313 313
 
314 314
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
315
+
315 316
   // Ultimaker
316 317
   //#define  DEFAULT_Kp 22.2
317 318
   //#define  DEFAULT_Ki 1.08
@@ -1273,7 +1274,7 @@
1273 1274
  *  - Click the controller to view the LCD menu
1274 1275
  *  - The LCD will display Japanese, Western, or Cyrillic text
1275 1276
  *
1276
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1277
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1277 1278
  *
1278 1279
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1279 1280
  */

+ 11
- 7
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1020,7 +1024,7 @@
1020 1024
    */
1021 1025
   #define  TMC2130_ADV() {  }
1022 1026
 
1023
-#endif // ENABLED(HAVE_TMC2130)
1027
+#endif // HAVE_TMC2130
1024 1028
 
1025 1029
 // @section L6470
1026 1030
 

+ 2
- 1
Marlin/example_configurations/delta/generic/Configuration.h Visa fil

@@ -312,6 +312,7 @@
312 312
   #define K1 0.95 //smoothing factor within the PID
313 313
 
314 314
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
315
+
315 316
   // Ultimaker
316 317
   #define  DEFAULT_Kp 22.2
317 318
   #define  DEFAULT_Ki 1.08
@@ -1262,7 +1263,7 @@
1262 1263
  *  - Click the controller to view the LCD menu
1263 1264
  *  - The LCD will display Japanese, Western, or Cyrillic text
1264 1265
  *
1265
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1266
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1266 1267
  *
1267 1268
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1268 1269
  */

+ 11
- 7
Marlin/example_configurations/delta/generic/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1018,7 +1022,7 @@
1018 1022
    */
1019 1023
   #define  TMC2130_ADV() {  }
1020 1024
 
1021
-#endif // ENABLED(HAVE_TMC2130)
1025
+#endif // HAVE_TMC2130
1022 1026
 
1023 1027
 // @section L6470
1024 1028
 

+ 2
- 1
Marlin/example_configurations/delta/kossel_mini/Configuration.h Visa fil

@@ -312,6 +312,7 @@
312 312
   #define K1 0.95 //smoothing factor within the PID
313 313
 
314 314
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
315
+
315 316
   // Ultimaker
316 317
   #define  DEFAULT_Kp 22.2
317 318
   #define  DEFAULT_Ki 1.08
@@ -1265,7 +1266,7 @@
1265 1266
  *  - Click the controller to view the LCD menu
1266 1267
  *  - The LCD will display Japanese, Western, or Cyrillic text
1267 1268
  *
1268
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1269
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1269 1270
  *
1270 1271
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1271 1272
  */

+ 11
- 7
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1018,7 +1022,7 @@
1018 1022
    */
1019 1023
   #define  TMC2130_ADV() {  }
1020 1024
 
1021
-#endif // ENABLED(HAVE_TMC2130)
1025
+#endif // HAVE_TMC2130
1022 1026
 
1023 1027
 // @section L6470
1024 1028
 

+ 1
- 1
Marlin/example_configurations/delta/kossel_pro/Configuration.h Visa fil

@@ -1271,7 +1271,7 @@
1271 1271
  *  - Click the controller to view the LCD menu
1272 1272
  *  - The LCD will display Japanese, Western, or Cyrillic text
1273 1273
  *
1274
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1274
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1275 1275
  *
1276 1276
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1277 1277
  */

+ 11
- 7
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h Visa fil

@@ -225,12 +225,16 @@
225 225
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
226 226
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
227 227
 
228
-// Define a pin to turn case light on/off
229
-//#define CASE_LIGHT_PIN 4
230
-#if PIN_EXISTS(CASE_LIGHT)
231
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
232
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
233
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
228
+/**
229
+ * M355 Case Light on-off / brightness
230
+ */
231
+//#define CASE_LIGHT_ENABLE
232
+#if ENABLED(CASE_LIGHT_ENABLE)
233
+  //#define CASE_LIGHT_PIN 4                  // Override the default pin if needed
234
+  #define INVERT_CASE_LIGHT false             // Set true if Case Light is ON when pin is LOW
235
+  #define CASE_LIGHT_DEFAULT_ON true          // Set default power-up state on
236
+  #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105   // Set default power-up brightness (0-255, requires PWM pin)
237
+  //#define MENU_ITEM_CASE_LIGHT              // Add a Case Light option to the LCD main menu
234 238
 #endif
235 239
 
236 240
 //===========================================================================
@@ -1023,7 +1027,7 @@
1023 1027
    */
1024 1028
   #define  TMC2130_ADV() {  }
1025 1029
 
1026
-#endif // ENABLED(HAVE_TMC2130)
1030
+#endif // HAVE_TMC2130
1027 1031
 
1028 1032
 // @section L6470
1029 1033
 

+ 1
- 1
Marlin/example_configurations/delta/kossel_xl/Configuration.h Visa fil

@@ -1329,7 +1329,7 @@
1329 1329
  *  - Click the controller to view the LCD menu
1330 1330
  *  - The LCD will display Japanese, Western, or Cyrillic text
1331 1331
  *
1332
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1332
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1333 1333
  *
1334 1334
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1335 1335
  */

+ 11
- 7
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1018,7 +1022,7 @@
1018 1022
    */
1019 1023
   #define  TMC2130_ADV() {  }
1020 1024
 
1021
-#endif // ENABLED(HAVE_TMC2130)
1025
+#endif // HAVE_TMC2130
1022 1026
 
1023 1027
 // @section L6470
1024 1028
 

+ 1
- 1
Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h Visa fil

@@ -1170,7 +1170,7 @@
1170 1170
  *  - Click the controller to view the LCD menu
1171 1171
  *  - The LCD will display Japanese, Western, or Cyrillic text
1172 1172
  *
1173
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1173
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1174 1174
  *
1175 1175
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1176 1176
  */

+ 12
- 8
Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -784,7 +788,7 @@
784 788
   #define PAUSE_PARK_Z_FEEDRATE 5             // Z axis feedrate in mm/s (not used for delta printers)
785 789
   #define PAUSE_PARK_RETRACT_FEEDRATE 60      // Initial retract feedrate in mm/s
786 790
   #define PAUSE_PARK_RETRACT_LENGTH 2         // Initial retract in mm
787
- 
791
+
788 792
                                               // It is a short retract used immediately after print interrupt before move to filament exchange position
789 793
   #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10  // Unload filament feedrate in mm/s - filament unloading can be fast
790 794
   #define FILAMENT_CHANGE_UNLOAD_LENGTH 100   // Unload filament length from hotend in mm
@@ -1025,7 +1029,7 @@
1025 1029
    */
1026 1030
   #define  TMC2130_ADV() {  }
1027 1031
 
1028
-#endif // ENABLED(HAVE_TMC2130)
1032
+#endif // HAVE_TMC2130
1029 1033
 
1030 1034
 // @section L6470
1031 1035
 

+ 2
- 1
Marlin/example_configurations/makibox/Configuration.h Visa fil

@@ -312,6 +312,7 @@
312 312
   #define K1 0.95 //smoothing factor within the PID
313 313
 
314 314
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
315
+
315 316
   // Ultimaker
316 317
   #define  DEFAULT_Kp 22.2
317 318
   #define  DEFAULT_Ki 1.08
@@ -1156,7 +1157,7 @@
1156 1157
  *  - Click the controller to view the LCD menu
1157 1158
  *  - The LCD will display Japanese, Western, or Cyrillic text
1158 1159
  *
1159
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1160
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1160 1161
  *
1161 1162
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1162 1163
  */

+ 11
- 7
Marlin/example_configurations/makibox/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1016,7 +1020,7 @@
1016 1020
    */
1017 1021
   #define  TMC2130_ADV() {  }
1018 1022
 
1019
-#endif // ENABLED(HAVE_TMC2130)
1023
+#endif // HAVE_TMC2130
1020 1024
 
1021 1025
 // @section L6470
1022 1026
 

+ 1
- 1
Marlin/example_configurations/tvrrug/Round2/Configuration.h Visa fil

@@ -1149,7 +1149,7 @@
1149 1149
  *  - Click the controller to view the LCD menu
1150 1150
  *  - The LCD will display Japanese, Western, or Cyrillic text
1151 1151
  *
1152
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1152
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1153 1153
  *
1154 1154
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1155 1155
  */

+ 11
- 7
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1016,7 +1020,7 @@
1016 1020
    */
1017 1021
   #define  TMC2130_ADV() {  }
1018 1022
 
1019
-#endif // ENABLED(HAVE_TMC2130)
1023
+#endif // HAVE_TMC2130
1020 1024
 
1021 1025
 // @section L6470
1022 1026
 

+ 2
- 1
Marlin/example_configurations/wt150/Configuration.h Visa fil

@@ -317,6 +317,7 @@
317 317
   #define  DEFAULT_Kd 110.78
318 318
 
319 319
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
320
+
320 321
   // Ultimaker
321 322
   //#define  DEFAULT_Kp 22.2
322 323
   //#define  DEFAULT_Ki 1.08
@@ -1158,7 +1159,7 @@
1158 1159
  *  - Click the controller to view the LCD menu
1159 1160
  *  - The LCD will display Japanese, Western, or Cyrillic text
1160 1161
  *
1161
- * See https: *github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1162
+ * See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
1162 1163
  *
1163 1164
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1164 1165
  */

+ 11
- 7
Marlin/example_configurations/wt150/Configuration_adv.h Visa fil

@@ -220,12 +220,16 @@
220 220
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
221 221
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
222 222
 
223
-// Define a pin to turn case light on/off
224
-//#define CASE_LIGHT_PIN 4
225
-#if PIN_EXISTS(CASE_LIGHT)
226
-  #define INVERT_CASE_LIGHT false   // Set to true if HIGH is the OFF state (active low)
227
-  //#define CASE_LIGHT_DEFAULT_ON   // Uncomment to set default state to on
228
-  //#define MENU_ITEM_CASE_LIGHT    // Uncomment to have a Case Light On / Off entry in main menu
223
+/**
224
+ * M355 Case Light on-off / brightness
225
+ */
226
+//#define CASE_LIGHT_ENABLE
227
+#if ENABLED(CASE_LIGHT_ENABLE)
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
229 233
 #endif
230 234
 
231 235
 //===========================================================================
@@ -1019,7 +1023,7 @@
1019 1023
    */
1020 1024
   #define  TMC2130_ADV() {  }
1021 1025
 
1022
-#endif // ENABLED(HAVE_TMC2130)
1026
+#endif // HAVE_TMC2130
1023 1027
 
1024 1028
 // @section L6470
1025 1029
 

+ 91
- 1
Marlin/fastio.h Visa fil

@@ -26,10 +26,11 @@
26 26
  * Contributed by Triffid_Hunter. Modified by Kliment and the Marlin team.
27 27
  */
28 28
 
29
-#ifndef _FASTIO_ARDUINO_H 
29
+#ifndef _FASTIO_ARDUINO_H
30 30
 #define _FASTIO_ARDUINO_H
31 31
 
32 32
 #include <avr/io.h>
33
+#include "macros.h"
33 34
 
34 35
 /**
35 36
  * Enable this option to use Teensy++ 2.0 assignments for AT90USB processors.
@@ -238,4 +239,93 @@ typedef enum {
238 239
 #define SET_FOCB(T,V) SET_FOC(T,B,V)
239 240
 #define SET_FOCC(T,V) SET_FOC(T,C,V)
240 241
 
242
+
243
+/**
244
+ * PWM availability macros
245
+ */
246
+#define AVR_AT90USB1286_FAMILY (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1286P__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB646P__)  || defined(__AVR_AT90USB647__))
247
+#define AVR_ATmega1284_FAMILY (defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__))
248
+#define AVR_ATmega2560_FAMILY (defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__))
249
+#define AVR_ATmega2561_FAMILY (defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__))
250
+#define AVR_ATmega328_FAMILY (defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328p__))
251
+
252
+//find out which harware PWMs are already in use
253
+#if PIN_EXISTS(CONTROLLER_FAN)
254
+  #define PWM_CHK_FAN_B(p) (p == CONTROLLER_FAN_PIN || p == E0_AUTO_FAN_PIN || p ==  E1_AUTO_FAN_PIN || p ==  E2_AUTO_FAN_PIN || p ==  E3_AUTO_FAN_PIN || p ==  E4_AUTO_FAN_PIN)
255
+#else
256
+  #define PWM_CHK_FAN_B(p) (p == E0_AUTO_FAN_PIN || p ==  E1_AUTO_FAN_PIN || p ==  E2_AUTO_FAN_PIN || p ==  E3_AUTO_FAN_PIN || p ==  E4_AUTO_FAN_PIN)
257
+#endif
258
+
259
+#if PIN_EXISTS(FAN) || PIN_EXISTS(FAN1) || PIN_EXISTS(FAN2)
260
+  #if PIN_EXISTS(FAN2)
261
+    #define PWM_CHK_FAN_A(p) (p == FAN_PIN || p == FAN1_PIN || p == FAN2_PIN)
262
+  #elif PIN_EXISTS(FAN1)
263
+    #define PWM_CHK_FAN_A(p) (p == FAN_PIN || p == FAN1_PIN)
264
+  #else
265
+    #define PWM_CHK_FAN_A(p) p == FAN_PIN
266
+  #endif
267
+#else
268
+  #define PWM_CHK_FAN_A(p) false
269
+#endif
270
+
271
+#if HAS_MOTOR_CURRENT_PWM
272
+  #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
273
+    #define PWM_CHK_MOTOR_CURRENT(p) (p == MOTOR_CURRENT_PWM_E || p == MOTOR_CURRENT_PWM_Z || p == MOTOR_CURRENT_PWM_XY)
274
+  #elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
275
+    #define PWM_CHK_MOTOR_CURRENT(p) (p == MOTOR_CURRENT_PWM_E || p == MOTOR_CURRENT_PWM_Z)
276
+  #else
277
+    #define PWM_CHK_MOTOR_CURRENT(p) (p == MOTOR_CURRENT_PWM_E)
278
+  #endif
279
+#else
280
+  #define PWM_CHK_MOTOR_CURRENT(p) false
281
+#endif
282
+
283
+#if defined(NUM_SERVOS)
284
+  #if AVR_ATmega2560_FAMILY
285
+    #define PWM_CHK_SERVO(p) ( p == 5 || NUM_SERVOS > 12 && p == 6 || NUM_SERVOS > 24 && p == 46)  //PWMS 3A, 4A & 5A
286
+  #elif AVR_ATmega2561_FAMILY
287
+    #define PWM_CHK_SERVO(p)   p ==  5  //PWM3A
288
+  #elif AVR_ATmega1284_FAMILY
289
+    #define PWM_CHK_SERVO(p)   false
290
+  #elif AVR_AT90USB1286_FAMILY
291
+    #define PWM_CHK_SERVO(p)   p ==  16 //PWM3A
292
+  #elif AVR_ATmega328_FAMILY
293
+    #define PWM_CHK_SERVO(p)   false
294
+  #endif
295
+#else
296
+  #define PWM_CHK_SERVO(p) false
297
+#endif
298
+
299
+#if ENABLED(BARICUDA)
300
+  #if HAS_HEATER_1 && HAS_HEATER_2
301
+    #define PWM_CHK_HEATER(p) (p == HEATER_1_PIN || p == HEATER_2_PIN)
302
+  #elif HAS_HEATER_1
303
+    #define PWM_CHK_HEATER(p) (p == HEATER_1_PIN)
304
+  #endif
305
+#else
306
+    #define PWM_CHK_HEATER(p) false
307
+#endif
308
+
309
+#define PWM_CHK(p) (PWM_CHK_HEATER(p) || PWM_CHK_SERVO(p)  || PWM_CHK_MOTOR_CURRENT(p)\
310
+                     || PWM_CHK_FAN_A(p) || PWM_CHK_FAN_B(p))
311
+
312
+// define which hardware PWMs are available for the current CPU
313
+// all timer 1 PWMS deleted from this list because they are never available
314
+#if AVR_ATmega2560_FAMILY
315
+  #define PWM_PINS(p)  ((p >= 2 && p <= 10 ) || p ==  13 || p ==  44 || p ==  45 || p ==  46 )
316
+#elif AVR_ATmega2561_FAMILY
317
+  #define PWM_PINS(p)  ((p >= 2 && p <= 6 ) || p ==  9)
318
+#elif AVR_ATmega1284_FAMILY
319
+  #define PWM_PINS(p)  (p == 3 || p ==  4 || p ==  14 || p ==  15)
320
+#elif AVR_AT90USB1286_FAMILY
321
+  #define PWM_PINS(p)  (p == 0 || p ==  1 || p ==  14 || p ==  15 || p ==  16 || p ==  24)
322
+#elif AVR_ATmega328_FAMILY
323
+  #define PWM_PINS(p)  (p == 3 || p ==  5 || p ==  6 || p ==  11)
324
+#else
325
+  #error "unknown CPU"
326
+#endif
327
+
328
+// finally - the macro that tells us if a pin is an available hardware PWM
329
+#define USEABLE_HARDWARE_PWM(p) (PWM_PINS(p) && !PWM_CHK(p))
330
+
241 331
 #endif // _FASTIO_ARDUINO_H

+ 5
- 2
Marlin/gcode.cpp Visa fil

@@ -184,6 +184,7 @@ void GCodeParser::parse(char *p) {
184 184
 
185 185
     if (PARAM_TEST) {
186 186
 
187
+      while (*p == ' ') p++;                    // skip spaces vetween parameters & values
187 188
       const bool has_num = DECIMAL_SIGNED(*p);  // The parameter has a number [-+0-9.]
188 189
 
189 190
       #if ENABLED(DEBUG_GCODE_PARSER)
@@ -220,8 +221,10 @@ void GCodeParser::parse(char *p) {
220 221
       #endif
221 222
     }
222 223
 
223
-    while (*p && *p != ' ') p++;                // Skip over the parameter
224
-    while (*p == ' ') p++;                      // Skip over all spaces
224
+    if (!WITHIN(*p, 'A', 'Z')) {
225
+      while (*p && NUMERIC(*p)) p++;              // Skip over the value section of a parameter
226
+      while (*p == ' ') p++;                      // Skip over all spaces
227
+    }
225 228
   }
226 229
 }
227 230
 

+ 4
- 4
Marlin/gcode.h Visa fil

@@ -120,7 +120,7 @@ public:
120 120
 
121 121
     // Code seen bit was set. If not found, value_ptr is unchanged.
122 122
     // This allows "if (seen('A')||seen('B'))" to use the last-found value.
123
-    static bool seen(const char c) {
123
+    static volatile bool seen(const char c) {
124 124
       const uint8_t ind = c - 'A';
125 125
       if (ind >= COUNT(param)) return false; // Only A-Z
126 126
       const bool b = TEST(codebits[ind >> 3], ind & 0x7);
@@ -132,10 +132,10 @@ public:
132 132
 
133 133
     // Code is found in the string. If not found, value_ptr is unchanged.
134 134
     // This allows "if (seen('A')||seen('B'))" to use the last-found value.
135
-    static bool seen(const char c) {
135
+    static volatile bool seen(const char c) {
136 136
       const char *p = strchr(command_args, c);
137 137
       const bool b = !!p;
138
-      if (b) value_ptr = DECIMAL_SIGNED(p[1]) ? &p[1] : NULL;
138
+      if (b) value_ptr = DECIMAL_SIGNED(p[1]) ? &p[1] : (char*)NULL;
139 139
       return b;
140 140
     }
141 141
 
@@ -227,7 +227,7 @@ public:
227 227
         return input_temp_units == TEMPUNIT_K ? 'K' : input_temp_units == TEMPUNIT_F ? 'F' : 'C';
228 228
       }
229 229
       FORCE_INLINE static char* temp_units_name() {
230
-        return input_temp_units == TEMPUNIT_K ? PSTR("Kelvin") : input_temp_units == TEMPUNIT_F ? PSTR("Fahrenheit") : PSTR("Celsius")
230
+        return input_temp_units == TEMPUNIT_K ? PSTR("Kelvin") : input_temp_units == TEMPUNIT_F ? PSTR("Fahrenheit") : PSTR("Celsius");
231 231
       }
232 232
       inline static float to_temp_units(const float &f) {
233 233
         switch (input_temp_units) {

+ 3
- 1
Marlin/language_en.h Visa fil

@@ -706,7 +706,9 @@
706 706
 #ifndef MSG_CASE_LIGHT
707 707
   #define MSG_CASE_LIGHT                      _UxGT("Case light")
708 708
 #endif
709
-
709
+#ifndef MSG_CASE_LIGHT_BRIGHTNESS
710
+  #define MSG_CASE_LIGHT_BRIGHTNESS           _UxGT("Light BRIGHTNESS")
711
+#endif
710 712
 #if LCD_WIDTH >= 20
711 713
   #ifndef MSG_INFO_PRINT_COUNT
712 714
     #define MSG_INFO_PRINT_COUNT              _UxGT("Print Count")

+ 0
- 1
Marlin/macros.h Visa fil

@@ -127,7 +127,6 @@
127 127
 #define DECIMAL(a) (NUMERIC(a) || a == '.')
128 128
 #define NUMERIC_SIGNED(a) (NUMERIC(a) || (a) == '-' || (a) == '+')
129 129
 #define DECIMAL_SIGNED(a) (DECIMAL(a) || (a) == '-' || (a) == '+')
130
-#define PRINTABLE(C) (((C) & 0xC0u) != 0x80u)
131 130
 #define COUNT(a) (sizeof(a)/sizeof(*a))
132 131
 #define ZERO(a) memset(a,0,sizeof(a))
133 132
 #define COPY(a,b) memcpy(a,b,min(sizeof(a),sizeof(b)))

+ 2
- 0
Marlin/pins.h Visa fil

@@ -174,6 +174,8 @@
174 174
   #include "pins_MKS_13.h"
175 175
 #elif MB(SAINSMART_2IN1)
176 176
   #include "pins_SAINSMART_2IN1.h"
177
+#elif MB(ZRIB_V20)
178
+  #include "pins_ZRIB_V20.h"
177 179
 #else
178 180
   #error "Unknown MOTHERBOARD value set in Configuration.h"
179 181
 #endif

+ 5
- 7
Marlin/pins_AZTEEG_X3.h Visa fil

@@ -32,11 +32,10 @@
32 32
   #error "Azteeg X3 supports up to 2 hotends / E-steppers. Comment out this line to continue."
33 33
 #endif
34 34
 
35
-#define BOARD_NAME "Azteeg X3"
36
-
37
-#if !PIN_EXISTS(CASE_LIGHT)         // doesn't already exist so OK to change the definition coming
38
-  #define OK_TO_CHANGE_CASE_LIGHT   // in from from the include file
35
+#if ENABLED(CASE_LIGHT_ENABLE)  && !PIN_EXISTS(CASE_LIGHT)
36
+  #define CASE_LIGHT_PIN 6     // must define it here or else RAMPS will define it
39 37
 #endif
38
+#define BOARD_NAME "Azteeg X3"
40 39
 
41 40
 #include "pins_RAMPS_13.h"
42 41
 
@@ -75,10 +74,8 @@
75 74
 //
76 75
 // Misc
77 76
 //
78
-#if ENABLED(OK_TO_CHANGE_CASE_LIGHT) && STAT_LED_RED_PIN == 6
77
+#if ENABLED(CASE_LIGHT_ENABLE)  && PIN_EXISTS(CASE_LIGHT) && PIN_EXISTS(STAT_LED_RED) && STAT_LED_RED_PIN == CASE_LIGHT_PIN
79 78
   #undef STAT_LED_RED_PIN
80
-  #undef CASE_LIGHT_PIN
81
-  #define CASE_LIGHT_PIN 6  // open collector FET driver
82 79
 #endif
83 80
 
84 81
 //
@@ -94,6 +91,7 @@
94 91
   #if SERVO0_PIN == 7
95 92
     #undef SERVO0_PIN
96 93
     #def SERVO0_PIN 11
94
+  #endif
97 95
   #define SPINDLE_LASER_PWM_PIN     7  // MUST BE HARDWARE PWM
98 96
   #define SPINDLE_LASER_ENABLE_PIN 20  // Pin should have a pullup!
99 97
   #define SPINDLE_DIR_PIN          21

+ 8
- 10
Marlin/pins_AZTEEG_X3_PRO.h Visa fil

@@ -28,12 +28,13 @@
28 28
   #error "Azteeg X3 Pro supports up to 5 hotends / E-steppers. Comment out this line to continue."
29 29
 #endif
30 30
 
31
-#define BOARD_NAME "Azteeg X3 Pro"
32
-
33
-#if !PIN_EXISTS(CASE_LIGHT)         // doesn't already exist so OK to change the definition coming
34
-  #define OK_TO_CHANGE_CASE_LIGHT   // in from from the include file
31
+#if ENABLED(CASE_LIGHT_ENABLE)  && !PIN_EXISTS(CASE_LIGHT)
32
+  #define CASE_LIGHT_PIN 44     // must define it here or else RAMPS will define it
35 33
 #endif
36 34
 
35
+
36
+#define BOARD_NAME "Azteeg X3 Pro"
37
+
37 38
 #include "pins_RAMPS.h"
38 39
 
39 40
 #ifndef __AVR_ATmega2560__
@@ -144,19 +145,16 @@
144 145
 //
145 146
 // Misc. Functions
146 147
 //
147
-#if ENABLED(OK_TO_CHANGE_CASE_LIGHT)
148
+#if ENABLED(CASE_LIGHT_ENABLE)  && PIN_EXISTS(CASE_LIGHT) && defined(DOGLCD_A0) && DOGLCD_A0 == CASE_LIGHT_PIN
148 149
   #undef DOGLCD_A0            // steal pin 44 for the case light; if you have a Viki2 and have connected it
149 150
   #define DOGLCD_A0      57   // following the Panucatt wiring diagram, you may need to tweak these pin assignments
150
-                              // as the wiring diagram uses pin 44 for DOGLCD_A0
151
-
152
-  #undef CASE_LIGHT_PIN
153
-  #define CASE_LIGHT_PIN 44    // must have a hardware PWM
151
+                                // as the wiring diagram uses pin 44 for DOGLCD_A0
154 152
 #endif
155 153
 
156 154
 //
157 155
 // M3/M4/M5 - Spindle/Laser Control
158 156
 //
159
-#undef SPINDLE_LASER_PWM_PIN    // Definitions in pins_RAMPS.h are no good with the AzteegX3 board
157
+#undef SPINDLE_LASER_PWM_PIN    // Definitions in pins_RAMPS.h are no good with the AzteegX3pro board
160 158
 #undef SPINDLE_LASER_ENABLE_PIN
161 159
 #undef SPINDLE_DIR_PIN
162 160
 

+ 4
- 1
Marlin/pins_CHEAPTRONICv2.h Visa fil

@@ -111,9 +111,12 @@
111 111
 //
112 112
 // Other board specific pins
113 113
 //
114
-#define FILWIDTH_PIN       37
115 114
 #define LED_PIN            13
116 115
 #define SPINDLE_ENABLE_PIN  4
117 116
 #define FAN_PIN             3
118 117
 #define PS_ON_PIN          45
119 118
 #define KILL_PIN           46
119
+
120
+#ifndef FILWIDTH_PIN
121
+  #define FILWIDTH_PIN     37   // should be Analog Input (0-15)
122
+#endif

+ 4
- 1
Marlin/pins_PRINTRBOARD.h Visa fil

@@ -99,7 +99,10 @@
99 99
 // Misc. Functions
100 100
 //
101 101
 #define SDSS               26
102
-#define FILWIDTH_PIN        2   // Analog Input
102
+
103
+#ifndef FILWIDTH_PIN
104
+  #define FILWIDTH_PIN      2   // Analog Input
105
+#endif
103 106
 
104 107
 //
105 108
 // LCD / Controller

+ 4
- 1
Marlin/pins_PRINTRBOARD_REVF.h Visa fil

@@ -102,7 +102,10 @@
102 102
 // Misc. Functions
103 103
 //
104 104
 #define SDSS               20 // Teensylu pin mapping
105
-#define FILWIDTH_PIN        2 // Analog Input
105
+
106
+#ifndef FILWIDTH_PIN
107
+  #define FILWIDTH_PIN      2   // Analog Input
108
+#endif
106 109
 
107 110
 //
108 111
 // LCD / Controller

+ 4
- 1
Marlin/pins_RAMBO.h Visa fil

@@ -135,10 +135,13 @@
135 135
 //
136 136
 #define SDSS               53
137 137
 #define LED_PIN            13
138
-#define FILWIDTH_PIN        3   // Analog Input
139 138
 #define PS_ON_PIN           4
140 139
 #define CASE_LIGHT_PIN     46
141 140
 
141
+#ifndef FILWIDTH_PIN
142
+  #define FILWIDTH_PIN      3   // Analog Input
143
+#endif
144
+
142 145
 //
143 146
 // LCD / Controller
144 147
 //

+ 4
- 4
Marlin/pins_RAMPS.h Visa fil

@@ -196,16 +196,16 @@
196 196
 #define SDSS               53
197 197
 #define LED_PIN            13
198 198
 
199
-// Use the RAMPS 1.4 Analog input 5 on the AUX2 connector
200
-#define FILWIDTH_PIN        5   // Analog Input
199
+#ifndef FILWIDTH_PIN
200
+  #define FILWIDTH_PIN      5   // Analog Input on AUX2
201
+#endif
201 202
 
202 203
 // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
203 204
 #define FIL_RUNOUT_PIN      4
204 205
 
205 206
 #define PS_ON_PIN          12
206 207
 
207
-#if !PIN_EXISTS(CASE_LIGHT) && !defined(SPINDLE_LASER_ENABLE_PIN)
208
-  #undef CASE_LIGHT_PIN
208
+#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) && !defined(SPINDLE_LASER_ENABLE_PIN)
209 209
   #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // try to use servo connector first
210 210
     #define CASE_LIGHT_PIN   6      // MUST BE HARDWARE PWM
211 211
   #elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) \

+ 4
- 1
Marlin/pins_SCOOVO_X9H.h Visa fil

@@ -118,7 +118,10 @@
118 118
 #define SDSS                53
119 119
 #define LED_PIN             13
120 120
 #define PS_ON_PIN            4
121
-#define FILWIDTH_PIN         3   // Analog Input
121
+
122
+#ifndef FILWIDTH_PIN
123
+  #define FILWIDTH_PIN       3   // Analog Input
124
+#endif
122 125
 
123 126
 //
124 127
 // LCD / Controller

+ 39
- 0
Marlin/pins_ZRIB_V20.h Visa fil

@@ -0,0 +1,39 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * ZRIB V2.0 pin assignments
25
+ */
26
+
27
+#define ZRIB_V20_D6_PIN 6
28
+#define ZRIB_V20_D9_PIN 9
29
+#define RAMPS_D9_PIN         ZRIB_V20_D6_PIN
30
+#define ORIG_E0_AUTO_FAN_PIN ZRIB_V20_D9_PIN
31
+#define ORIG_E1_AUTO_FAN_PIN ZRIB_V20_D9_PIN
32
+#define ORIG_E2_AUTO_FAN_PIN ZRIB_V20_D9_PIN
33
+#define ORIG_E3_AUTO_FAN_PIN ZRIB_V20_D9_PIN
34
+
35
+#ifndef FILWIDTH_PIN
36
+  #define FILWIDTH_PIN 11   // Analog Input
37
+#endif
38
+
39
+#include "pins_MKS_13.h"

+ 20
- 18
Marlin/planner.cpp Visa fil

@@ -535,7 +535,7 @@ void Planner::check_axes_activity() {
535 535
    */
536 536
   void Planner::apply_leveling(float &lx, float &ly, float &lz) {
537 537
 
538
-    #if ENABLED(AUTO_BED_LEVELING_UBL) && UBL_DELTA  // probably should also be enabled for UBL without UBL_DELTA
538
+    #if ENABLED(AUTO_BED_LEVELING_UBL)
539 539
       if (!ubl.state.active) return;
540 540
       #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
541 541
         // if z_fade_height enabled (nonzero) and raw_z above it, no leveling required
@@ -550,7 +550,7 @@ void Planner::check_axes_activity() {
550 550
       if (!abl_enabled) return;
551 551
     #endif
552 552
 
553
-    #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
553
+    #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_UBL)
554 554
       static float z_fade_factor = 1.0, last_raw_lz = -999.0;
555 555
       if (z_fade_height) {
556 556
         const float raw_lz = RAW_Z_POSITION(lz);
@@ -599,36 +599,38 @@ void Planner::check_axes_activity() {
599 599
 
600 600
   void Planner::unapply_leveling(float logical[XYZ]) {
601 601
 
602
-    #if ENABLED(AUTO_BED_LEVELING_UBL) && UBL_DELTA
602
+    #if ENABLED(AUTO_BED_LEVELING_UBL)
603 603
 
604 604
       if (ubl.state.active) {
605 605
 
606
-        const float z_leveled = RAW_Z_POSITION(logical[Z_AXIS]),
607
-                    z_ublmesh = ubl.get_z_correction(logical[X_AXIS], logical[Y_AXIS]);
608
-              float z_unlevel = z_leveled - ubl.state.z_offset - z_ublmesh;
606
+        const float z_physical = RAW_Z_POSITION(logical[Z_AXIS]);
607
+        const float z_ublmesh  = ubl.get_z_correction(logical[X_AXIS], logical[Y_AXIS]);
608
+        const float z_virtual  = z_physical - ubl.state.z_offset - z_ublmesh;
609
+              float z_logical  = LOGICAL_Z_POSITION(z_virtual);
609 610
 
610 611
         #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
611 612
 
612
-          // for L=leveled, U=unleveled, M=mesh, O=offset, H=fade_height,
613
-          // Given L==U+O+M(1-U/H) (faded mesh correction formula for U<H)
614
-          //  then U==L-O-M(1-U/H)
615
-          //    so U==L-O-M+MU/H
616
-          //    so U-MU/H==L-O-M
617
-          //    so U(1-M/H)==L-O-M
618
-          //    so U==(L-O-M)/(1-M/H) for U<H
613
+          // for P=physical_z, L=logical_z, M=mesh_z, O=z_offset, H=fade_height,
614
+          // Given P=L+O+M(1-L/H) (faded mesh correction formula for L<H)
615
+          //  then L=P-O-M(1-L/H)
616
+          //    so L=P-O-M+ML/H
617
+          //    so L-ML/H=P-O-M
618
+          //    so L(1-M/H)=P-O-M
619
+          //    so L=(P-O-M)/(1-M/H) for L<H
619 620
 
620 621
           if (planner.z_fade_height) {
621
-            const float z_unfaded = z_unlevel / (1.0 - z_ublmesh * planner.inverse_z_fade_height);
622
-            if (z_unfaded < planner.z_fade_height)  // don't know until after compute
623
-              z_unlevel = z_unfaded;
622
+            if (z_logical < planner.z_fade_height )
623
+              z_logical = z_logical / (1.0 - (z_ublmesh * planner.inverse_z_fade_height));
624
+            if (z_logical >= planner.z_fade_height)
625
+              z_logical = LOGICAL_Z_POSITION(z_physical - ubl.state.z_offset);
624 626
           }
625 627
 
626 628
         #endif // ENABLE_LEVELING_FADE_HEIGHT
627 629
 
628
-        logical[Z_AXIS] = z_unlevel;
630
+        logical[Z_AXIS] = z_logical;
629 631
       }
630 632
 
631
-      return; // don't fall thru to HAS_ABL or other ENABLE_LEVELING_FADE_HEIGHT logic
633
+      return; // don't fall thru to other ENABLE_LEVELING_FADE_HEIGHT logic
632 634
 
633 635
     #endif
634 636
 

+ 49
- 13
Marlin/stepper.cpp Visa fil

@@ -528,33 +528,69 @@ void Stepper::isr() {
528 528
         _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS),0); \
529 529
       }
530 530
 
531
+    /**
532
+     * Estimate the number of cycles that the stepper logic already takes
533
+     * up between the start and stop of the X stepper pulse.
534
+     *
535
+     * Currently this uses very modest estimates of around 5 cycles.
536
+     * True values may be derived by careful testing.
537
+     *
538
+     * Once any delay is added, the cost of the delay code itself
539
+     * may be subtracted from this value to get a more accurate delay.
540
+     * Delays under 20 cycles (1.25µs) will be very accurate, using NOPs.
541
+     * Longer delays use a loop. The resolution is 8 cycles.
542
+     */
531 543
     #if HAS_X_STEP
532
-      #define _COUNT_STEPPERS_1 1
544
+      #define _CYCLE_APPROX_1 5
533 545
     #else
534
-      #define _COUNT_STEPPERS_1 0
546
+      #define _CYCLE_APPROX_1 0
547
+    #endif
548
+    #if ENABLED(X_DUAL_STEPPER_DRIVERS)
549
+      #define _CYCLE_APPROX_2 _CYCLE_APPROX_1 + 4
550
+    #else
551
+      #define _CYCLE_APPROX_2 _CYCLE_APPROX_1
535 552
     #endif
536 553
     #if HAS_Y_STEP
537
-      #define _COUNT_STEPPERS_2 _COUNT_STEPPERS_1 + 1
554
+      #define _CYCLE_APPROX_3 _CYCLE_APPROX_2 + 5
555
+    #else
556
+      #define _CYCLE_APPROX_3 _CYCLE_APPROX_2
557
+    #endif
558
+    #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
559
+      #define _CYCLE_APPROX_4 _CYCLE_APPROX_3 + 4
538 560
     #else
539
-      #define _COUNT_STEPPERS_2 _COUNT_STEPPERS_1
561
+      #define _CYCLE_APPROX_4 _CYCLE_APPROX_3
540 562
     #endif
541 563
     #if HAS_Z_STEP
542
-      #define _COUNT_STEPPERS_3 _COUNT_STEPPERS_2 + 1
564
+      #define _CYCLE_APPROX_5 _CYCLE_APPROX_4 + 5
565
+    #else
566
+      #define _CYCLE_APPROX_5 _CYCLE_APPROX_4
567
+    #endif
568
+    #if ENABLED(Z_DUAL_STEPPER_DRIVERS)
569
+      #define _CYCLE_APPROX_6 _CYCLE_APPROX_5 + 4
543 570
     #else
544
-      #define _COUNT_STEPPERS_3 _COUNT_STEPPERS_2
571
+      #define _CYCLE_APPROX_6 _CYCLE_APPROX_5
545 572
     #endif
546 573
     #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)
547
-      #define _COUNT_STEPPERS_4 _COUNT_STEPPERS_3 + 1
574
+      #if ENABLED(MIXING_EXTRUDER)
575
+        #define _CYCLE_APPROX_7 _CYCLE_APPROX_6 + (MIXING_STEPPERS) * 6
576
+      #else
577
+        #define _CYCLE_APPROX_7 _CYCLE_APPROX_6 + 5
578
+      #endif
548 579
     #else
549
-      #define _COUNT_STEPPERS_4 _COUNT_STEPPERS_3
580
+      #define _CYCLE_APPROX_7 _CYCLE_APPROX_6
550 581
     #endif
551 582
 
552
-    #define CYCLES_EATEN_XYZE ((_COUNT_STEPPERS_4) * 5)
583
+    #define CYCLES_EATEN_XYZE _CYCLE_APPROX_7
553 584
     #define EXTRA_CYCLES_XYZE (STEP_PULSE_CYCLES - (CYCLES_EATEN_XYZE))
554 585
 
555
-    // If a minimum pulse time was specified get the timer 0 value
556
-    // which increments every 4µs on 16MHz and every 3.2µs on 20MHz.
557
-    // Two or 3 counts of TCNT0 should be a sufficient delay.
586
+    /**
587
+     * If a minimum pulse time was specified get the timer 0 value.
588
+     *
589
+     * TCNT0 has an 8x prescaler, so it increments every 8 cycles.
590
+     * That's every 0.5µs on 16MHz and every 0.4µs on 20MHz.
591
+     * 20 counts of TCNT0 -by itself- is a good pulse delay.
592
+     * 10µs = 160 or 200 cycles.
593
+     */
558 594
     #if EXTRA_CYCLES_XYZE > 20
559 595
       uint32_t pulse_start = TCNT0;
560 596
     #endif
@@ -627,7 +663,7 @@ void Stepper::isr() {
627 663
       break;
628 664
     }
629 665
 
630
-    // For minimum pulse time wait before stopping pulses
666
+    // For minimum pulse time wait after stopping pulses also
631 667
     #if EXTRA_CYCLES_XYZE > 20
632 668
       if (i) while (EXTRA_CYCLES_XYZE > (uint32_t)(TCNT0 - pulse_start) * (INT0_PRESCALER)) { /* nada */ }
633 669
     #elif EXTRA_CYCLES_XYZE > 0

+ 0
- 4
Marlin/temperature.cpp Visa fil

@@ -73,10 +73,6 @@ int16_t Temperature::current_temperature_raw[HOTENDS] = { 0 },
73 73
   int16_t Temperature::target_temperature_bed = 0;
74 74
 #endif
75 75
 
76
-#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
77
-  float Temperature::redundant_temperature = 0.0;
78
-#endif
79
-
80 76
 #if ENABLED(PIDTEMP)
81 77
   #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
82 78
     float Temperature::Kp[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kp),

+ 0
- 4
Marlin/temperature.h Visa fil

@@ -112,10 +112,6 @@ class Temperature {
112 112
 
113 113
     static volatile bool in_temp_isr;
114 114
 
115
-    #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
116
-      static float redundant_temperature;
117
-    #endif
118
-
119 115
     static uint8_t soft_pwm_amount[HOTENDS],
120 116
                    soft_pwm_amount_bed;
121 117
 

+ 11
- 5
Marlin/ubl.cpp Visa fil

@@ -83,7 +83,7 @@
83 83
   }
84 84
 
85 85
   void unified_bed_leveling::reset() {
86
-    state.active = false;
86
+    set_bed_leveling_enabled(false);
87 87
     state.z_offset = 0;
88 88
     state.storage_slot = -1;
89 89
     #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
@@ -94,11 +94,17 @@
94 94
   }
95 95
 
96 96
   void unified_bed_leveling::invalidate() {
97
-    state.active = false;
97
+    set_bed_leveling_enabled(false);
98 98
     state.z_offset = 0;
99
-    for (int x = 0; x < GRID_MAX_POINTS_X; x++)
100
-      for (int y = 0; y < GRID_MAX_POINTS_Y; y++)
101
-        z_values[x][y] = NAN;
99
+    set_all_mesh_points_to_value(NAN);
100
+  }
101
+
102
+  void unified_bed_leveling::set_all_mesh_points_to_value(float value) {
103
+    for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) {
104
+      for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) {
105
+        z_values[x][y] = value;
106
+      }
107
+    }
102 108
   }
103 109
 
104 110
   void unified_bed_leveling::display_map(const int map_type) {

+ 2
- 1
Marlin/ubl.h Visa fil

@@ -154,6 +154,7 @@
154 154
       static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const float&, const float&, const bool, unsigned int[16], bool);
155 155
       static void reset();
156 156
       static void invalidate();
157
+      static void set_all_mesh_points_to_value(float);
157 158
       static bool sanity_check();
158 159
 
159 160
       static void G29() _O0;                          // O0 for no optimization
@@ -385,7 +386,7 @@
385 386
       FORCE_INLINE static float mesh_index_to_xpos(const uint8_t i) { return pgm_read_float(&_mesh_index_to_xpos[i]); }
386 387
       FORCE_INLINE static float mesh_index_to_ypos(const uint8_t i) { return pgm_read_float(&_mesh_index_to_ypos[i]); }
387 388
 
388
-      static bool prepare_linear_move_to(const float ltarget[XYZE], const float &feedrate);
389
+      static bool prepare_segmented_line_to(const float ltarget[XYZE], const float &feedrate);
389 390
       static void line_to_destination_cartesian(const float &fr, uint8_t e);
390 391
 
391 392
   }; // class unified_bed_leveling

+ 42
- 19
Marlin/ubl_G29.cpp Visa fil

@@ -30,6 +30,7 @@
30 30
   #include "configuration_store.h"
31 31
   #include "ultralcd.h"
32 32
   #include "stepper.h"
33
+  #include "planner.h"
33 34
   #include "gcode.h"
34 35
 
35 36
   #include <math.h>
@@ -48,6 +49,7 @@
48 49
   extern long babysteps_done;
49 50
   extern float probe_pt(const float &x, const float &y, bool, int);
50 51
   extern bool set_probe_deployed(bool);
52
+  extern void set_bed_leveling_enabled(bool);
51 53
 
52 54
   #define SIZE_OF_LITTLE_RAISE 1
53 55
   #define BIG_RAISE_NOT_NEEDED 0
@@ -325,15 +327,23 @@
325 327
     if (parser.seen('I')) {
326 328
       uint8_t cnt = 0;
327 329
       g29_repetition_cnt = parser.has_value() ? parser.value_int() : 1;
328
-      while (g29_repetition_cnt--) {
329
-        if (cnt > 20) { cnt = 0; idle(); }
330
-        const mesh_index_pair location = find_closest_mesh_point_of_type(REAL, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, NULL, false);
331
-        if (location.x_index < 0) {
332
-          SERIAL_PROTOCOLLNPGM("Entire Mesh invalidated.\n");
333
-          break;            // No more invalid Mesh Points to populate
330
+      if (g29_repetition_cnt >= GRID_MAX_POINTS) {
331
+        set_all_mesh_points_to_value(NAN);
332
+      } else {
333
+        while (g29_repetition_cnt--) {
334
+          if (cnt > 20) { cnt = 0; idle(); }
335
+          const mesh_index_pair location = find_closest_mesh_point_of_type(REAL, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, NULL, false);
336
+          if (location.x_index < 0) {
337
+            // No more REACHABLE mesh points to invalidate, so we ASSUME the user
338
+            // meant to invalidate the ENTIRE mesh, which cannot be done with
339
+            // find_closest_mesh_point loop which only returns REACHABLE points.
340
+            set_all_mesh_points_to_value(NAN);
341
+            SERIAL_PROTOCOLLNPGM("Entire Mesh invalidated.\n");
342
+            break;            // No more invalid Mesh Points to populate
343
+          }
344
+          z_values[location.x_index][location.y_index] = NAN;
345
+          cnt++;
334 346
         }
335
-        z_values[location.x_index][location.y_index] = NAN;
336
-        cnt++;
337 347
       }
338 348
       SERIAL_PROTOCOLLNPGM("Locations invalidated.\n");
339 349
     }
@@ -497,18 +507,26 @@
497 507
            *   - Specify a constant with the 'C' parameter.
498 508
            *   - Allow 'G29 P3' to choose a 'reasonable' constant.
499 509
            */
510
+
500 511
           if (g29_c_flag) {
501 512
             if (g29_repetition_cnt >= GRID_MAX_POINTS) {
502
-              for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) {
503
-                for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) {
504
-                  z_values[x][y] = g29_constant;
505
-                }
506
-              }
513
+              set_all_mesh_points_to_value(g29_constant);
507 514
             }
508 515
             else {
509 516
               while (g29_repetition_cnt--) {  // this only populates reachable mesh points near
510 517
                 const mesh_index_pair location = find_closest_mesh_point_of_type(INVALID, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, NULL, false);
511
-                if (location.x_index < 0) break; // No more reachable invalid Mesh Points to populate
518
+                if (location.x_index < 0) {
519
+                  // No more REACHABLE INVALID mesh points to populate, so we ASSUME
520
+                  // user meant to populate ALL INVALID mesh points to value
521
+                  for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) {
522
+                    for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) {
523
+                      if ( isnan(z_values[x][y])) {
524
+                        z_values[x][y] = g29_constant;
525
+                      }
526
+                    }
527
+                  }
528
+                  break; // No more invalid Mesh Points to populate
529
+                }
512 530
                 z_values[location.x_index][location.y_index] = g29_constant;
513 531
               }
514 532
             }
@@ -999,12 +1017,15 @@
999 1017
 
1000 1018
       serialprintPGM(parser.seen('B') ? PSTR("Place shim & measure") : PSTR("Measure")); // TODO: Make translatable strings
1001 1019
 
1020
+      const float z_step = 0.01;                                        // existing behavior: 0.01mm per click, occasionally step
1021
+      //const float z_step = 1.0 / planner.axis_steps_per_mm[Z_AXIS];   // approx one step each click
1022
+
1002 1023
       while (ubl_lcd_clicked()) delay(50);             // wait for user to release encoder wheel
1003 1024
       delay(50);                                       // debounce
1004 1025
       while (!ubl_lcd_clicked()) {                     // we need the loop to move the nozzle based on the encoder wheel here!
1005 1026
         idle();
1006 1027
         if (encoder_diff) {
1007
-          do_blocking_move_to_z(current_position[Z_AXIS] + float(encoder_diff) / 100.0);
1028
+          do_blocking_move_to_z(current_position[Z_AXIS] + float(encoder_diff) * z_step);
1008 1029
           encoder_diff = 0;
1009 1030
         }
1010 1031
       }
@@ -1115,11 +1136,11 @@
1115 1136
         SERIAL_PROTOCOLLNPGM("?Can't activate and deactivate at the same time.\n");
1116 1137
         return UBL_ERR;
1117 1138
       }
1118
-      state.active = true;
1139
+      set_bed_leveling_enabled(true);
1119 1140
       report_state();
1120 1141
     }
1121 1142
     else if (parser.seen('D')) {
1122
-      state.active = false;
1143
+      set_bed_leveling_enabled(false);
1123 1144
       report_state();
1124 1145
     }
1125 1146
 
@@ -1158,7 +1179,7 @@
1158 1179
       return;
1159 1180
     }
1160 1181
     ubl_state_at_invocation = state.active;
1161
-    state.active = 0;
1182
+    set_bed_leveling_enabled(false);
1162 1183
   }
1163 1184
 
1164 1185
   void unified_bed_leveling::restore_ubl_active_state_and_leave() {
@@ -1168,7 +1189,7 @@
1168 1189
       lcd_quick_feedback();
1169 1190
       return;
1170 1191
     }
1171
-    state.active = ubl_state_at_invocation;
1192
+    set_bed_leveling_enabled(ubl_state_at_invocation);
1172 1193
   }
1173 1194
 
1174 1195
   /**
@@ -1695,6 +1716,8 @@
1695 1716
         SERIAL_EOL;
1696 1717
       }
1697 1718
     #endif
1719
+
1720
+    if (do_ubl_mesh_map) display_map(g29_map_type);
1698 1721
   }
1699 1722
 
1700 1723
   #if ENABLED(UBL_G29_P31)

+ 126
- 80
Marlin/ubl_motion.cpp Visa fil

@@ -32,7 +32,25 @@
32 32
 
33 33
   extern float destination[XYZE];
34 34
   extern void set_current_to_destination();
35
-  extern float delta_segments_per_second;
35
+
36
+#if ENABLED(DELTA)
37
+
38
+  extern float delta[ABC],
39
+               endstop_adj[ABC];
40
+
41
+  extern float delta_radius,
42
+               delta_tower_angle_trim[2],
43
+               delta_tower[ABC][2],
44
+               delta_diagonal_rod,
45
+               delta_calibration_radius,
46
+               delta_diagonal_rod_2_tower[ABC],
47
+               delta_segments_per_second,
48
+               delta_clip_start_height;
49
+
50
+  extern float delta_safe_distance_from_top();
51
+
52
+#endif
53
+
36 54
 
37 55
   static void debug_echo_axis(const AxisEnum axis) {
38 56
     if (current_position[axis] == destination[axis])
@@ -470,51 +488,76 @@
470 488
     #endif
471 489
 
472 490
     // We don't want additional apply_leveling() performed by regular buffer_line or buffer_line_kinematic,
473
-    // so we call _buffer_line directly here.  Per-segmented leveling performed first.
491
+    // so we call _buffer_line directly here.  Per-segmented leveling and kinematics performed first.
474 492
 
475
-    static inline void ubl_buffer_line_segment(const float ltarget[XYZE], const float &fr_mm_s, const uint8_t extruder) {
493
+    inline void _O2 ubl_buffer_segment_raw( float rx, float ry, float rz, float le, float fr ) {
476 494
 
477
-      #if IS_KINEMATIC
495
+      #if ENABLED(DELTA)  // apply delta inverse_kinematics
478 496
 
479
-        inverse_kinematics(ltarget); // this writes delta[ABC] from ltarget[XYZ] but does not modify ltarget
480
-        float feedrate = fr_mm_s;
497
+        const float delta_A = rz + sqrt( delta_diagonal_rod_2_tower[A_AXIS]
498
+                                         - HYPOT2( delta_tower[A_AXIS][X_AXIS] - rx,
499
+                                                   delta_tower[A_AXIS][Y_AXIS] - ry ));
481 500
 
482
-        #if IS_SCARA // scale the feed rate from mm/s to degrees/s
483
-          float adiff = abs(delta[A_AXIS] - scara_oldA),
484
-                bdiff = abs(delta[B_AXIS] - scara_oldB);
485
-          scara_oldA = delta[A_AXIS];
486
-          scara_oldB = delta[B_AXIS];
487
-          feedrate = max(adiff, bdiff) * scara_feed_factor;
488
-        #endif
501
+        const float delta_B = rz + sqrt( delta_diagonal_rod_2_tower[B_AXIS]
502
+                                         - HYPOT2( delta_tower[B_AXIS][X_AXIS] - rx,
503
+                                                   delta_tower[B_AXIS][Y_AXIS] - ry ));
504
+
505
+        const float delta_C = rz + sqrt( delta_diagonal_rod_2_tower[C_AXIS]
506
+                                         - HYPOT2( delta_tower[C_AXIS][X_AXIS] - rx,
507
+                                                   delta_tower[C_AXIS][Y_AXIS] - ry ));
508
+
509
+        planner._buffer_line(delta_A, delta_B, delta_C, le, fr, active_extruder);
510
+
511
+      #elif IS_SCARA  // apply scara inverse_kinematics (should be changed to save raw->logical->raw)
512
+
513
+        const float lseg[XYZ] = { LOGICAL_X_POSITION(rx),
514
+                                  LOGICAL_Y_POSITION(ry),
515
+                                  LOGICAL_Z_POSITION(rz)
516
+                                };
517
+
518
+        inverse_kinematics(lseg); // this writes delta[ABC] from lseg[XYZ]
519
+                                  // should move the feedrate scaling to scara inverse_kinematics
489 520
 
490
-        planner._buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], ltarget[E_AXIS], feedrate, extruder);
521
+        float adiff = abs(delta[A_AXIS] - scara_oldA),
522
+              bdiff = abs(delta[B_AXIS] - scara_oldB);
523
+        scara_oldA = delta[A_AXIS];
524
+        scara_oldB = delta[B_AXIS];
525
+        float s_feedrate = max(adiff, bdiff) * scara_feed_factor;
491 526
 
492
-      #else // cartesian
527
+        planner._buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], le, s_feedrate, active_extruder);
493 528
 
494
-        planner._buffer_line(ltarget[X_AXIS], ltarget[Y_AXIS], ltarget[Z_AXIS], ltarget[E_AXIS], fr_mm_s, extruder);
529
+      #else // CARTESIAN
530
+
531
+        // Cartesian _buffer_line seems to take LOGICAL, not RAW coordinates
532
+
533
+        const float lx = LOGICAL_X_POSITION(rx),
534
+                    ly = LOGICAL_Y_POSITION(ry),
535
+                    lz = LOGICAL_Z_POSITION(rz);
536
+
537
+        planner._buffer_line(lx, ly, lz, le, fr, active_extruder);
495 538
 
496 539
       #endif
540
+
497 541
     }
498 542
 
543
+
499 544
     /**
500
-     * Prepare a linear move for DELTA/SCARA/CARTESIAN with UBL and FADE semantics.
545
+     * Prepare a segmented linear move for DELTA/SCARA/CARTESIAN with UBL and FADE semantics.
501 546
      * This calls planner._buffer_line multiple times for small incremental moves.
502
-     * Returns true if the caller did NOT update current_position, otherwise false.
547
+     * Returns true if did NOT move, false if moved (requires current_position update).
503 548
      */
504 549
 
505
-    static bool unified_bed_leveling::prepare_linear_move_to(const float ltarget[XYZE], const float &feedrate) {
550
+    bool _O2 unified_bed_leveling::prepare_segmented_line_to(const float ltarget[XYZE], const float &feedrate) {
506 551
 
507 552
       if (!position_is_reachable_xy(ltarget[X_AXIS], ltarget[Y_AXIS]))  // fail if moving outside reachable boundary
508 553
         return true; // did not move, so current_position still accurate
509 554
 
510
-      const float difference[XYZE] = {    // cartesian distances moved in XYZE
511
-                    ltarget[X_AXIS] - current_position[X_AXIS],
512
-                    ltarget[Y_AXIS] - current_position[Y_AXIS],
513
-                    ltarget[Z_AXIS] - current_position[Z_AXIS],
514
-                    ltarget[E_AXIS] - current_position[E_AXIS]
515
-                  };
555
+      const float tot_dx = ltarget[X_AXIS] - current_position[X_AXIS],
556
+                  tot_dy = ltarget[Y_AXIS] - current_position[Y_AXIS],
557
+                  tot_dz = ltarget[Z_AXIS] - current_position[Z_AXIS],
558
+                  tot_de = ltarget[E_AXIS] - current_position[E_AXIS];
516 559
 
517
-      const float cartesian_xy_mm = HYPOT(difference[X_AXIS], difference[Y_AXIS]);         // total horizontal xy distance
560
+      const float cartesian_xy_mm = HYPOT(tot_dx, tot_dy);  // total horizontal xy distance
518 561
 
519 562
       #if IS_KINEMATIC
520 563
         const float seconds = cartesian_xy_mm / feedrate;                                  // seconds to move xy distance at requested rate
@@ -534,16 +577,19 @@
534 577
         scara_oldB = stepper.get_axis_position_degrees(B_AXIS);
535 578
       #endif
536 579
 
537
-      const float segment_distance[XYZE] = {            // length for each segment
538
-                    difference[X_AXIS] * inv_segments,
539
-                    difference[Y_AXIS] * inv_segments,
540
-                    difference[Z_AXIS] * inv_segments,
541
-                    difference[E_AXIS] * inv_segments
542
-                  };
580
+      const float seg_dx = tot_dx * inv_segments,
581
+                  seg_dy = tot_dy * inv_segments,
582
+                  seg_dz = tot_dz * inv_segments,
583
+                  seg_de = tot_de * inv_segments;
543 584
 
544 585
       // Note that E segment distance could vary slightly as z mesh height
545 586
       // changes for each segment, but small enough to ignore.
546 587
 
588
+      float seg_rx = RAW_X_POSITION(current_position[X_AXIS]),
589
+            seg_ry = RAW_Y_POSITION(current_position[Y_AXIS]),
590
+            seg_rz = RAW_Z_POSITION(current_position[Z_AXIS]),
591
+            seg_le = current_position[E_AXIS];
592
+
547 593
       const bool above_fade_height = (
548 594
         #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
549 595
           planner.z_fade_height != 0 && planner.z_fade_height < RAW_Z_POSITION(ltarget[Z_AXIS])
@@ -558,21 +604,24 @@
558 604
 
559 605
         const float z_offset = state.active ? state.z_offset : 0.0;
560 606
 
561
-        float seg_dest[XYZE];                   // per-segment destination,
562
-        COPY_XYZE(seg_dest, current_position);  // starting from current position
607
+        do {
608
+
609
+          if (--segments) {     // not the last segment
610
+            seg_rx += seg_dx;
611
+            seg_ry += seg_dy;
612
+            seg_rz += seg_dz;
613
+            seg_le += seg_de;
614
+          } else {              // last segment, use exact destination
615
+            seg_rx = RAW_X_POSITION(ltarget[X_AXIS]);
616
+            seg_ry = RAW_Y_POSITION(ltarget[Y_AXIS]);
617
+            seg_rz = RAW_Z_POSITION(ltarget[Z_AXIS]);
618
+            seg_le = ltarget[E_AXIS];
619
+          }
563 620
 
564
-        while (--segments) {
565
-          LOOP_XYZE(i) seg_dest[i] += segment_distance[i];
566
-          float ztemp = seg_dest[Z_AXIS];
567
-          seg_dest[Z_AXIS] += z_offset;
568
-          ubl_buffer_line_segment(seg_dest, feedrate, active_extruder);
569
-          seg_dest[Z_AXIS] = ztemp;
570
-        }
621
+          ubl_buffer_segment_raw( seg_rx, seg_ry, seg_rz + z_offset, seg_le, feedrate );
622
+
623
+        } while (segments);
571 624
 
572
-        // Since repeated adding segment_distance accumulates small errors, final move to exact destination.
573
-        COPY_XYZE(seg_dest, ltarget);
574
-        seg_dest[Z_AXIS] += z_offset;
575
-        ubl_buffer_line_segment(seg_dest, feedrate, active_extruder);
576 625
         return false; // moved but did not set_current_to_destination();
577 626
       }
578 627
 
@@ -582,14 +631,11 @@
582 631
         const float fade_scaling_factor = fade_scaling_factor_for_z(ltarget[Z_AXIS]);
583 632
       #endif
584 633
 
585
-      float seg_dest[XYZE];  // per-segment destination, initialize to first segment
586
-      LOOP_XYZE(i) seg_dest[i] = current_position[i] + segment_distance[i];
587
-
588
-      const float &dx_seg = segment_distance[X_AXIS];  // alias for clarity
589
-      const float &dy_seg = segment_distance[Y_AXIS];
590
-
591
-      float rx = RAW_X_POSITION(seg_dest[X_AXIS]),  // assume raw vs logical coordinates shifted but not scaled.
592
-            ry = RAW_Y_POSITION(seg_dest[Y_AXIS]);
634
+      // increment to first segment destination
635
+      seg_rx += seg_dx;
636
+      seg_ry += seg_dy;
637
+      seg_rz += seg_dz;
638
+      seg_le += seg_de;
593 639
 
594 640
       for(;;) {  // for each mesh cell encountered during the move
595 641
 
@@ -600,20 +646,16 @@
600 646
         // in top of loop and again re-find same adjacent cell and use it, just less efficient
601 647
         // for mesh inset area.
602 648
 
603
-        int8_t cell_xi = (rx - (UBL_MESH_MIN_X)) * (1.0 / (MESH_X_DIST)),
604
-               cell_yi = (ry - (UBL_MESH_MIN_Y)) * (1.0 / (MESH_X_DIST));
649
+        int8_t cell_xi = (seg_rx - (UBL_MESH_MIN_X)) * (1.0 / (MESH_X_DIST)),
650
+               cell_yi = (seg_ry - (UBL_MESH_MIN_Y)) * (1.0 / (MESH_X_DIST));
605 651
 
606 652
         cell_xi = constrain(cell_xi, 0, (GRID_MAX_POINTS_X) - 1);
607 653
         cell_yi = constrain(cell_yi, 0, (GRID_MAX_POINTS_Y) - 1);
608 654
 
609
-        const float x0 = mesh_index_to_xpos(cell_xi),     // 64 byte table lookup avoids mul+add
610
-                    y0 = mesh_index_to_ypos(cell_yi),     // 64 byte table lookup avoids mul+add
611
-                    x1 = mesh_index_to_xpos(cell_xi + 1), // 64 byte table lookup avoids mul+add
612
-                    y1 = mesh_index_to_ypos(cell_yi + 1); // 64 byte table lookup avoids mul+add
655
+        const float x0 = mesh_index_to_xpos(cell_xi),   // 64 byte table lookup avoids mul+add
656
+                    y0 = mesh_index_to_ypos(cell_yi);
613 657
 
614
-        float cx = rx - x0,   // cell-relative x
615
-              cy = ry - y0,   // cell-relative y
616
-              z_x0y0 = z_values[cell_xi  ][cell_yi  ],  // z at lower left corner
658
+        float z_x0y0 = z_values[cell_xi  ][cell_yi  ],  // z at lower left corner
617 659
               z_x1y0 = z_values[cell_xi+1][cell_yi  ],  // z at upper left corner
618 660
               z_x0y1 = z_values[cell_xi  ][cell_yi+1],  // z at lower right corner
619 661
               z_x1y1 = z_values[cell_xi+1][cell_yi+1];  // z at upper right corner
@@ -623,15 +665,18 @@
623 665
         if (isnan(z_x0y1)) z_x0y1 = 0;              //   in order to avoid isnan tests per cell,
624 666
         if (isnan(z_x1y1)) z_x1y1 = 0;              //   thus guessing zero for undefined points
625 667
 
668
+        float cx = seg_rx - x0,   // cell-relative x and y
669
+              cy = seg_ry - y0;
670
+
626 671
         const float z_xmy0 = (z_x1y0 - z_x0y0) * (1.0 / (MESH_X_DIST)),   // z slope per x along y0 (lower left to lower right)
627 672
                     z_xmy1 = (z_x1y1 - z_x0y1) * (1.0 / (MESH_X_DIST));   // z slope per x along y1 (upper left to upper right)
628 673
 
629
-              float z_cxy0 = z_x0y0 + z_xmy0 * cx;            // z height along y0 at cx
674
+              float z_cxy0 = z_x0y0 + z_xmy0 * cx;            // z height along y0 at cx (changes for each cx in cell)
630 675
 
631 676
         const float z_cxy1 = z_x0y1 + z_xmy1 * cx,            // z height along y1 at cx
632 677
                     z_cxyd = z_cxy1 - z_cxy0;                 // z height difference along cx from y0 to y1
633 678
 
634
-              float z_cxym = z_cxyd * (1.0 / (MESH_Y_DIST));  // z slope per y along cx from y0 to y1
679
+              float z_cxym = z_cxyd * (1.0 / (MESH_Y_DIST));  // z slope per y along cx from y0 to y1 (changes for each cx in cell)
635 680
 
636 681
         //    float z_cxcy = z_cxy0 + z_cxym * cy;            // interpolated mesh z height along cx at cy (do inside the segment loop)
637 682
 
@@ -639,8 +684,8 @@
639 684
         // and the z_cxym slope will change, both as a function of cx within the cell, and
640 685
         // each change by a constant for fixed segment lengths.
641 686
 
642
-        const float z_sxy0 = z_xmy0 * dx_seg,                                     // per-segment adjustment to z_cxy0
643
-                    z_sxym = (z_xmy1 - z_xmy0) * (1.0 / (MESH_Y_DIST)) * dx_seg;  // per-segment adjustment to z_cxym
687
+        const float z_sxy0 = z_xmy0 * seg_dx,                                     // per-segment adjustment to z_cxy0
688
+                    z_sxym = (z_xmy1 - z_xmy0) * (1.0 / (MESH_Y_DIST)) * seg_dx;  // per-segment adjustment to z_cxym
644 689
 
645 690
         for(;;) {  // for all segments within this mesh cell
646 691
 
@@ -650,28 +695,29 @@
650 695
             z_cxcy *= fade_scaling_factor;          // apply fade factor to interpolated mesh height
651 696
           #endif
652 697
 
653
-          z_cxcy += state.z_offset;             // add fixed mesh offset from G29 Z
698
+          z_cxcy += state.z_offset;                 // add fixed mesh offset from G29 Z
654 699
 
655 700
           if (--segments == 0) {                    // if this is last segment, use ltarget for exact
656
-            COPY_XYZE(seg_dest, ltarget);
657
-            seg_dest[Z_AXIS] += z_cxcy;
658
-            ubl_buffer_line_segment(seg_dest, feedrate, active_extruder);
659
-            return false;   // did not set_current_to_destination()
701
+            seg_rx = RAW_X_POSITION(ltarget[X_AXIS]);
702
+            seg_ry = RAW_Y_POSITION(ltarget[Y_AXIS]);
703
+            seg_rz = RAW_Z_POSITION(ltarget[Z_AXIS]);
704
+            seg_le = ltarget[E_AXIS];
660 705
           }
661 706
 
662
-          const float z_orig = seg_dest[Z_AXIS];  // remember the pre-leveled segment z value
663
-          seg_dest[Z_AXIS] = z_orig + z_cxcy;     // adjust segment z height per mesh leveling
664
-          ubl_buffer_line_segment(seg_dest, feedrate, active_extruder);
665
-          seg_dest[Z_AXIS] = z_orig;              // restore pre-leveled z before incrementing
707
+          ubl_buffer_segment_raw( seg_rx, seg_ry, seg_rz + z_cxcy, seg_le, feedrate );
708
+
709
+          if (segments == 0 )                       // done with last segment
710
+            return false;                           // did not set_current_to_destination()
666 711
 
667
-          LOOP_XYZE(i) seg_dest[i] += segment_distance[i];  // adjust seg_dest for next segment
712
+          seg_rx += seg_dx;
713
+          seg_ry += seg_dy;
714
+          seg_rz += seg_dz;
715
+          seg_le += seg_de;
668 716
 
669
-          cx += dx_seg;
670
-          cy += dy_seg;
717
+          cx += seg_dx;
718
+          cy += seg_dy;
671 719
 
672 720
           if (!WITHIN(cx, 0, MESH_X_DIST) || !WITHIN(cy, 0, MESH_Y_DIST)) {  // done within this cell, break to next
673
-            rx = RAW_X_POSITION(seg_dest[X_AXIS]);
674
-            ry = RAW_Y_POSITION(seg_dest[Y_AXIS]);
675 721
             break;
676 722
           }
677 723
 

+ 49
- 47
Marlin/ultralcd.cpp Visa fil

@@ -60,6 +60,7 @@ int lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2
60 60
 
61 61
 uint8_t lcd_status_message_level;
62 62
 char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1
63
+
63 64
 #if ENABLED(STATUS_MESSAGE_SCROLLING)
64 65
   uint8_t status_scroll_pos = 0;
65 66
 #endif
@@ -726,6 +727,24 @@ void kill_screen(const char* lcd_msg) {
726 727
 
727 728
   #endif // SDSUPPORT
728 729
 
730
+  #if ENABLED(MENU_ITEM_CASE_LIGHT)
731
+
732
+    extern int case_light_brightness;
733
+    extern bool case_light_on;
734
+    extern void update_case_light();
735
+
736
+    void case_light_menu() {
737
+      START_MENU();
738
+      //
739
+      // ^ Main
740
+      //
741
+      MENU_BACK(MSG_MAIN);
742
+      MENU_ITEM_EDIT_CALLBACK(int3, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true);
743
+      MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light);
744
+      END_MENU();
745
+    }
746
+  #endif // MENU_ITEM_CASE_LIGHT
747
+
729 748
   #if ENABLED(BLTOUCH)
730 749
 
731 750
     /**
@@ -847,11 +866,6 @@ void kill_screen(const char* lcd_msg) {
847 866
    *
848 867
    */
849 868
 
850
-  #if ENABLED(MENU_ITEM_CASE_LIGHT)
851
-    extern bool case_light_on;
852
-    extern void update_case_light();
853
-  #endif
854
-
855 869
   void lcd_main_menu() {
856 870
     START_MENU();
857 871
     MENU_BACK(MSG_WATCH);
@@ -868,10 +882,14 @@ void kill_screen(const char* lcd_msg) {
868 882
     #endif
869 883
 
870 884
     //
871
-    // Switch case light on/off
885
+    // Set Case light on/off/brightness
872 886
     //
873 887
     #if ENABLED(MENU_ITEM_CASE_LIGHT)
874
-      MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, &case_light_on, update_case_light);
888
+      if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) {
889
+        MENU_ITEM(submenu, MSG_CASE_LIGHT, case_light_menu);
890
+      }
891
+      else
892
+        MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light);
875 893
     #endif
876 894
 
877 895
     if (planner.movesplanned() || IS_SD_PRINTING) {
@@ -1580,7 +1598,6 @@ void kill_screen(const char* lcd_msg) {
1580 1598
 
1581 1599
             //
1582 1600
             // The last G29 will record and enable but not move.
1583
-            // Since G29 is deferred, 
1584 1601
             //
1585 1602
             lcd_wait_for_move = true;
1586 1603
             enqueue_and_echo_commands_P(PSTR("G29 V1"));
@@ -1847,7 +1864,7 @@ void kill_screen(const char* lcd_msg) {
1847 1864
      */
1848 1865
     void _lcd_ubl_validate_custom_mesh() {
1849 1866
       char UBL_LCD_GCODE[24];
1850
-      const int temp = 
1867
+      const int temp =
1851 1868
         #if WATCH_THE_BED
1852 1869
           custom_bed_temp
1853 1870
         #else
@@ -2574,16 +2591,9 @@ void kill_screen(const char* lcd_msg) {
2574 2591
    *
2575 2592
    */
2576 2593
 
2577
-  /**
2578
-   *
2579
-   * Callback for LCD contrast
2580
-   *
2581
-   */
2582 2594
   #if HAS_LCD_CONTRAST
2583
-
2584 2595
     void lcd_callback_set_contrast() { set_lcd_contrast(lcd_contrast); }
2585
-
2586
-  #endif // HAS_LCD_CONTRAST
2596
+  #endif
2587 2597
 
2588 2598
   static void lcd_factory_settings() {
2589 2599
     settings.reset();
@@ -2598,7 +2608,7 @@ void kill_screen(const char* lcd_msg) {
2598 2608
     MENU_ITEM(submenu, MSG_FILAMENT, lcd_control_filament_menu);
2599 2609
 
2600 2610
     #if HAS_LCD_CONTRAST
2601
-      MENU_ITEM_EDIT_CALLBACK(int3, MSG_CONTRAST, &lcd_contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, lcd_callback_set_contrast, true);
2611
+      MENU_ITEM_EDIT_CALLBACK(int3, MSG_CONTRAST, (int*)&lcd_contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, lcd_callback_set_contrast, true);
2602 2612
     #endif
2603 2613
     #if ENABLED(FWRETRACT)
2604 2614
       MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu);
@@ -3867,11 +3877,7 @@ void lcd_init() {
3867 3877
 int lcd_strlen(const char* s) {
3868 3878
   int i = 0, j = 0;
3869 3879
   while (s[i]) {
3870
-    #if ENABLED(MAPPER_NON)
3871
-      j++;
3872
-    #else
3873
-      if (PRINTABLE(s[i])) j++;
3874
-    #endif
3880
+    if (PRINTABLE(s[i])) j++;
3875 3881
     i++;
3876 3882
   }
3877 3883
   return j;
@@ -3880,11 +3886,7 @@ int lcd_strlen(const char* s) {
3880 3886
 int lcd_strlen_P(const char* s) {
3881 3887
   int j = 0;
3882 3888
   while (pgm_read_byte(s)) {
3883
-    #if ENABLED(MAPPER_NON)
3884
-      j++;
3885
-    #else
3886
-      if (PRINTABLE(pgm_read_byte(s))) j++;
3887
-    #endif
3889
+    if (PRINTABLE(pgm_read_byte(s))) j++;
3888 3890
     s++;
3889 3891
   }
3890 3892
   return j;
@@ -4144,28 +4146,28 @@ void lcd_update() {
4144 4146
   } // ELAPSED(ms, next_lcd_update_ms)
4145 4147
 }
4146 4148
 
4147
-#if DISABLED(STATUS_MESSAGE_SCROLLING)
4148
-
4149
-  void set_utf_strlen(char* s, uint8_t n) {
4150
-    uint8_t i = 0, j = 0;
4151
-    while (s[i] && (j < n)) {
4152
-      #if ENABLED(MAPPER_NON)
4153
-        j++;
4154
-      #else
4155
-        if (PRINTABLE(s[i])) j++;
4156
-      #endif
4157
-      i++;
4158
-    }
4159
-    while (j++ < n) s[i++] = ' ';
4160
-    s[i] = '\0';
4149
+void pad_message_string() {
4150
+  uint8_t i = 0, j = 0;
4151
+  char c;
4152
+  while ((c = lcd_status_message[i]) && j < LCD_WIDTH) {
4153
+    if (PRINTABLE(c)) j++;
4154
+    i++;
4161 4155
   }
4162
-
4163
-#endif // !STATUS_MESSAGE_SCROLLING
4156
+  if (true
4157
+    #if ENABLED(STATUS_MESSAGE_SCROLLING)
4158
+      && j < LCD_WIDTH
4159
+    #endif
4160
+  ) {
4161
+    // pad with spaces to fill up the line
4162
+    while (j++ < LCD_WIDTH) lcd_status_message[i++] = ' ';
4163
+    // chop off at the edge
4164
+    lcd_status_message[i] = '\0';
4165
+  }
4166
+}
4164 4167
 
4165 4168
 void lcd_finishstatus(bool persist=false) {
4166
-  #if DISABLED(STATUS_MESSAGE_SCROLLING)
4167
-    set_utf_strlen(lcd_status_message, LCD_WIDTH);
4168
-  #endif
4169
+
4170
+  pad_message_string();
4169 4171
 
4170 4172
   #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0))
4171 4173
     UNUSED(persist);

+ 1
- 1
Marlin/ultralcd.h Visa fil

@@ -59,7 +59,7 @@
59 59
 
60 60
   #if ENABLED(DOGLCD)
61 61
     extern uint16_t lcd_contrast;
62
-    void set_lcd_contrast(uint16_t value);
62
+    void set_lcd_contrast(const uint16_t value);
63 63
   #elif ENABLED(SHOW_BOOTSCREEN)
64 64
     void bootscreen();
65 65
   #endif

+ 11
- 11
Marlin/ultralcd_impl_DOGM.h Visa fil

@@ -239,19 +239,17 @@ char lcd_print_and_count(const char c) {
239 239
  * On DOGM all strings go through a filter for utf
240 240
  * But only use lcd_print_utf and lcd_printPGM_utf for translated text
241 241
  */
242
-void lcd_print(const char* const str) { for (uint8_t i = 0; char c = str[i]; ++i) lcd_print(c); }
243
-void lcd_printPGM(const char* str) { for (; char c = pgm_read_byte(str); ++str) lcd_print(c); }
242
+void lcd_print(const char *str) { while (*str) lcd_print(*str++); }
243
+void lcd_printPGM(const char *str) { while (const char c = pgm_read_byte(str)) lcd_print(c), ++str; }
244 244
 
245
-void lcd_print_utf(const char* const str, const uint8_t maxLength=LCD_WIDTH) {
245
+void lcd_print_utf(const char *str, uint8_t n=LCD_WIDTH) {
246 246
   char c;
247
-  for (uint8_t i = 0, n = maxLength; n && (c = str[i]); ++i)
248
-    n -= charset_mapper(c);
247
+  while (n && (c = *str)) n -= charset_mapper(c), ++str;
249 248
 }
250 249
 
251
-void lcd_printPGM_utf(const char* str, const uint8_t maxLength=LCD_WIDTH) {
250
+void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
252 251
   char c;
253
-  for (uint8_t i = 0, n = maxLength; n && (c = str[i]); ++i)
254
-    n -= charset_mapper(c);
252
+  while (n && (c = pgm_read_byte(str))) n -= charset_mapper(c), ++str;
255 253
 }
256 254
 
257 255
 // Initialize or re-initialize the LCD
@@ -412,8 +410,8 @@ inline void lcd_implementation_status_message() {
412 410
     const uint8_t slen = lcd_strlen(lcd_status_message);
413 411
     if (slen > LCD_WIDTH) {
414 412
       // Skip any non-printing bytes
415
-      while (!PRINTABLE(lcd_status_message[status_scroll_pos])) ++status_scroll_pos;
416
-      if (++status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0;
413
+      while (!PRINTABLE(lcd_status_message[status_scroll_pos++])) { /* nada */ }
414
+      if (status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0;
417 415
     }
418 416
   #else
419 417
     lcd_print_utf(lcd_status_message);
@@ -706,7 +704,9 @@ static void lcd_implementation_status_screen() {
706 704
       lcd_print(' ');
707 705
       lcd_print(itostr3(thermalManager.degHotend(active_extruder)));
708 706
       lcd_print('/');
709
-      lcd_print(itostr3(thermalManager.degTargetHotend(active_extruder)));
707
+
708
+      if (lcd_blink() || !thermalManager.is_heater_idle(active_extruder))
709
+        lcd_print(itostr3(thermalManager.degTargetHotend(active_extruder)));
710 710
     }
711 711
 
712 712
   #endif // ADVANCED_PAUSE_FEATURE

+ 9
- 14
Marlin/ultralcd_impl_HD44780.h Visa fil

@@ -382,19 +382,17 @@ void lcd_implementation_clear() { lcd.clear(); }
382 382
 
383 383
 void lcd_print(const char c) { charset_mapper(c); }
384 384
 
385
-void lcd_print(const char * const str) { for (uint8_t i = 0; char c = str[i]; ++i) lcd.print(c); }
386
-void lcd_printPGM(const char* str) { for (; char c = pgm_read_byte(str); ++str) lcd.print(c); }
385
+void lcd_print(const char *str) { while (*str) lcd.print(*str++); }
386
+void lcd_printPGM(const char *str) { while (const char c = pgm_read_byte(str)) lcd.print(c), ++str; }
387 387
 
388
-void lcd_print_utf(const char * const str, const uint8_t maxLength=LCD_WIDTH) {
388
+void lcd_print_utf(const char *str, uint8_t n=LCD_WIDTH) {
389 389
   char c;
390
-  for (uint8_t i = 0, n = maxLength; n && (c = str[i]); ++i)
391
-    n -= charset_mapper(c);
390
+  while (n && (c = *str)) n -= charset_mapper(c), ++str;
392 391
 }
393 392
 
394
-void lcd_printPGM_utf(const char* str, const uint8_t maxLength=LCD_WIDTH) {
393
+void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
395 394
   char c;
396
-  for (uint8_t i = 0, n = maxLength; n && (c = str[i]); ++i)
397
-    n -= charset_mapper(c);
395
+  while (n && (c = pgm_read_byte(str))) n -= charset_mapper(c), ++str;
398 396
 }
399 397
 
400 398
 #if ENABLED(SHOW_BOOTSCREEN)
@@ -831,8 +829,8 @@ static void lcd_implementation_status_screen() {
831 829
     const uint8_t slen = lcd_strlen(lcd_status_message);
832 830
     if (slen > LCD_WIDTH) {
833 831
       // Skip any non-printing bytes
834
-      while (!PRINTABLE(lcd_status_message[status_scroll_pos])) ++status_scroll_pos;
835
-      if (++status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0;
832
+      while (!PRINTABLE(lcd_status_message[status_scroll_pos++])) { /* nada */ }
833
+      if (status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0;
836 834
     }
837 835
   #else
838 836
     lcd_print_utf(lcd_status_message);
@@ -846,10 +844,7 @@ static void lcd_implementation_status_screen() {
846 844
     static void lcd_implementation_hotend_status(const uint8_t row) {
847 845
       if (row < LCD_HEIGHT) {
848 846
         lcd.setCursor(LCD_WIDTH - 9, row);
849
-        lcd.print(LCD_STR_THERMOMETER[0]);
850
-        lcd.print(itostr3(thermalManager.degHotend(active_extruder)));
851
-        lcd.print('/');
852
-        lcd.print(itostr3(thermalManager.degTargetHotend(active_extruder)));
847
+        _draw_heater_status(active_extruder, LCD_STR_THERMOMETER[0], lcd_blink());
853 848
       }
854 849
     }
855 850
 

+ 7
- 2
Marlin/utf_mapper.h Visa fil

@@ -23,7 +23,7 @@
23 23
 #ifndef UTF_MAPPER_H
24 24
 #define UTF_MAPPER_H
25 25
 
26
-#include  "language.h"
26
+#include "language.h"
27 27
 
28 28
 #if ENABLED(DOGLCD)
29 29
   #define HARDWARE_CHAR_OUT u8g.print
@@ -144,6 +144,8 @@
144 144
   #endif // DISPLAY_CHARSET_HD44780
145 145
 #endif // SIMULATE_ROMFONT
146 146
 
147
+#define PRINTABLE(C) (((C) & 0xC0u) != 0x80u)
148
+
147 149
 #if ENABLED(MAPPER_C2C3)
148 150
 
149 151
   char charset_mapper(const char c) {
@@ -466,8 +468,11 @@
466 468
 
467 469
   #define MAPPER_NON
468 470
 
471
+  #undef PRINTABLE
472
+  #define PRINTABLE(C) true
473
+
469 474
   char charset_mapper(const char c) {
470
-    HARDWARE_CHAR_OUT( c );
475
+    HARDWARE_CHAR_OUT(c);
471 476
     return 1;
472 477
   }
473 478
 

Laddar…
Avbryt
Spara