Sfoglia il codice sorgente

Merge pull request #3140 from thinkyhead/rc_fix_macro_expansion

Wrap macros to prevent bad expansions
Scott Lahteine 9 anni fa
parent
commit
1c384930f3
32 ha cambiato i file con 158 aggiunte e 158 eliminazioni
  1. 7
    7
      Marlin/Conditionals.h
  2. 2
    2
      Marlin/Configuration.h
  3. 33
    33
      Marlin/Marlin_main.cpp
  4. 1
    1
      Marlin/SdBaseFile.cpp
  5. 2
    2
      Marlin/cardreader.cpp
  6. 1
    1
      Marlin/configuration_store.cpp
  7. 17
    17
      Marlin/dogm_lcd_implementation.h
  8. 3
    3
      Marlin/example_configurations/Felix/Configuration.h
  9. 3
    3
      Marlin/example_configurations/Felix/Configuration_DUAL.h
  10. 3
    3
      Marlin/example_configurations/Hephestos/Configuration.h
  11. 3
    3
      Marlin/example_configurations/Hephestos_2/Configuration.h
  12. 3
    3
      Marlin/example_configurations/K8200/Configuration.h
  13. 3
    3
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  14. 3
    3
      Marlin/example_configurations/RigidBot/Configuration.h
  15. 3
    3
      Marlin/example_configurations/SCARA/Configuration.h
  16. 3
    3
      Marlin/example_configurations/TAZ4/Configuration.h
  17. 3
    3
      Marlin/example_configurations/WITBOX/Configuration.h
  18. 2
    2
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  19. 2
    2
      Marlin/example_configurations/delta/biv2.5/Configuration.h
  20. 2
    2
      Marlin/example_configurations/delta/generic/Configuration.h
  21. 2
    2
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  22. 4
    4
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  23. 4
    4
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  24. 3
    3
      Marlin/example_configurations/makibox/Configuration.h
  25. 3
    3
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  26. 2
    2
      Marlin/mesh_bed_leveling.h
  27. 10
    10
      Marlin/planner.cpp
  28. 1
    1
      Marlin/servo.cpp
  29. 13
    13
      Marlin/temperature.cpp
  30. 15
    15
      Marlin/ultralcd.cpp
  31. 1
    1
      Marlin/ultralcd_implementation_hitachi_HD44780.h
  32. 1
    1
      Marlin/ultralcd_st7920_u8glib_rrd.h

+ 7
- 7
Marlin/Conditionals.h Vedi File

264
   /**
264
   /**
265
    * Axis lengths
265
    * Axis lengths
266
    */
266
    */
267
-  #define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
268
-  #define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
269
-  #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
267
+  #define X_MAX_LENGTH (X_MAX_POS - (X_MIN_POS))
268
+  #define Y_MAX_LENGTH (Y_MAX_POS - (Y_MIN_POS))
269
+  #define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS))
270
 
270
 
271
   /**
271
   /**
272
    * SCARA
272
    * SCARA
285
     #define Z_HOME_POS MANUAL_Z_HOME_POS
285
     #define Z_HOME_POS MANUAL_Z_HOME_POS
286
   #else //!MANUAL_HOME_POSITIONS – Use home switch positions based on homing direction and travel limits
286
   #else //!MANUAL_HOME_POSITIONS – Use home switch positions based on homing direction and travel limits
287
     #if ENABLED(BED_CENTER_AT_0_0)
287
     #if ENABLED(BED_CENTER_AT_0_0)
288
-      #define X_HOME_POS X_MAX_LENGTH * X_HOME_DIR * 0.5
289
-      #define Y_HOME_POS Y_MAX_LENGTH * Y_HOME_DIR * 0.5
288
+      #define X_HOME_POS (X_MAX_LENGTH) * (X_HOME_DIR) * 0.5
289
+      #define Y_HOME_POS (Y_MAX_LENGTH) * (Y_HOME_DIR) * 0.5
290
     #else
290
     #else
291
       #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
291
       #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
292
       #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
292
       #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
334
    * Advance calculated values
334
    * Advance calculated values
335
    */
335
    */
336
   #if ENABLED(ADVANCE)
336
   #if ENABLED(ADVANCE)
337
-    #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * M_PI)
338
-    #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS] / EXTRUSION_AREA)
337
+    #define EXTRUSION_AREA (0.25 * (D_FILAMENT) * (D_FILAMENT) * M_PI)
338
+    #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS] / (EXTRUSION_AREA))
339
   #endif
339
   #endif
340
 
340
 
341
   #if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)
341
   #if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)

+ 2
- 2
Marlin/Configuration.h Vedi File

423
 
423
 
424
 #if ENABLED(MESH_BED_LEVELING)
424
 #if ENABLED(MESH_BED_LEVELING)
425
   #define MESH_MIN_X 10
425
   #define MESH_MIN_X 10
426
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
426
+  #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
427
   #define MESH_MIN_Y 10
427
   #define MESH_MIN_Y 10
428
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
428
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
429
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
429
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
430
   #define MESH_NUM_Y_POINTS 3
430
   #define MESH_NUM_Y_POINTS 3
431
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
431
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.

+ 33
- 33
Marlin/Marlin_main.cpp Vedi File

285
 // Inactivity shutdown
285
 // Inactivity shutdown
286
 millis_t previous_cmd_ms = 0;
286
 millis_t previous_cmd_ms = 0;
287
 static millis_t max_inactive_time = 0;
287
 static millis_t max_inactive_time = 0;
288
-static millis_t stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME * 1000L;
288
+static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000L;
289
 millis_t print_job_start_ms = 0; ///< Print job start time
289
 millis_t print_job_start_ms = 0; ///< Print job start time
290
 millis_t print_job_stop_ms = 0;  ///< Print job stop time
290
 millis_t print_job_stop_ms = 0;  ///< Print job stop time
291
 static uint8_t target_extruder;
291
 static uint8_t target_extruder;
1638
 
1638
 
1639
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1639
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1640
       if (marlin_debug_flags & DEBUG_LEVELING) {
1640
       if (marlin_debug_flags & DEBUG_LEVELING) {
1641
-        SERIAL_ECHOPAIR("> do_blocking_move_to_xy ", x - X_PROBE_OFFSET_FROM_EXTRUDER);
1642
-        SERIAL_ECHOPAIR(", ", y - Y_PROBE_OFFSET_FROM_EXTRUDER);
1641
+        SERIAL_ECHOPAIR("> do_blocking_move_to_xy ", x - (X_PROBE_OFFSET_FROM_EXTRUDER));
1642
+        SERIAL_ECHOPAIR(", ", y - (Y_PROBE_OFFSET_FROM_EXTRUDER));
1643
         SERIAL_EOL;
1643
         SERIAL_EOL;
1644
       }
1644
       }
1645
     #endif
1645
     #endif
1646
 
1646
 
1647
-    do_blocking_move_to_xy(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER); // this also updates current_position
1647
+    do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER)); // this also updates current_position
1648
 
1648
 
1649
     #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY)
1649
     #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY)
1650
       if (probe_action & ProbeDeploy) {
1650
       if (probe_action & ProbeDeploy) {
2281
     sync_plan_position();
2281
     sync_plan_position();
2282
 
2282
 
2283
     // Move all carriages up together until the first endstop is hit.
2283
     // Move all carriages up together until the first endstop is hit.
2284
-    for (int i = X_AXIS; i <= Z_AXIS; i++) destination[i] = 3 * Z_MAX_LENGTH;
2284
+    for (int i = X_AXIS; i <= Z_AXIS; i++) destination[i] = 3 * (Z_MAX_LENGTH);
2285
     feedrate = 1.732 * homing_feedrate[X_AXIS];
2285
     feedrate = 1.732 * homing_feedrate[X_AXIS];
2286
     line_to_destination();
2286
     line_to_destination();
2287
     st_synchronize();
2287
     st_synchronize();
2330
         feedrate = max_feedrate[Z_AXIS] * 60;  // feedrate (mm/m) = max_feedrate (mm/s)
2330
         feedrate = max_feedrate[Z_AXIS] * 60;  // feedrate (mm/m) = max_feedrate (mm/s)
2331
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2331
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2332
           if (marlin_debug_flags & DEBUG_LEVELING) {
2332
           if (marlin_debug_flags & DEBUG_LEVELING) {
2333
-            SERIAL_ECHOPAIR("Raise Z (before homing) to ", (float)MIN_Z_HEIGHT_FOR_HOMING);
2333
+            SERIAL_ECHOPAIR("Raise Z (before homing) to ", (float)(MIN_Z_HEIGHT_FOR_HOMING));
2334
             SERIAL_EOL;
2334
             SERIAL_EOL;
2335
             print_xyz("> (home_all_axis || homeZ) > current_position", current_position);
2335
             print_xyz("> (home_all_axis || homeZ) > current_position", current_position);
2336
             print_xyz("> (home_all_axis || homeZ) > destination", destination);
2336
             print_xyz("> (home_all_axis || homeZ) > destination", destination);
2467
             //
2467
             //
2468
             // Set the Z probe (or just the nozzle) destination to the safe homing point
2468
             // Set the Z probe (or just the nozzle) destination to the safe homing point
2469
             //
2469
             //
2470
-            destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - X_PROBE_OFFSET_FROM_EXTRUDER);
2471
-            destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - Y_PROBE_OFFSET_FROM_EXTRUDER);
2470
+            destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - (X_PROBE_OFFSET_FROM_EXTRUDER));
2471
+            destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - (Y_PROBE_OFFSET_FROM_EXTRUDER));
2472
             destination[Z_AXIS] = current_position[Z_AXIS]; //z is already at the right height
2472
             destination[Z_AXIS] = current_position[Z_AXIS]; //z is already at the right height
2473
             feedrate = XY_TRAVEL_SPEED;
2473
             feedrate = XY_TRAVEL_SPEED;
2474
 
2474
 
2500
               // Make sure the Z probe is within the physical limits
2500
               // Make sure the Z probe is within the physical limits
2501
               // NOTE: This doesn't necessarily ensure the Z probe is also within the bed!
2501
               // NOTE: This doesn't necessarily ensure the Z probe is also within the bed!
2502
               float cpx = current_position[X_AXIS], cpy = current_position[Y_AXIS];
2502
               float cpx = current_position[X_AXIS], cpy = current_position[Y_AXIS];
2503
-              if (   cpx >= X_MIN_POS - X_PROBE_OFFSET_FROM_EXTRUDER
2504
-                  && cpx <= X_MAX_POS - X_PROBE_OFFSET_FROM_EXTRUDER
2505
-                  && cpy >= Y_MIN_POS - Y_PROBE_OFFSET_FROM_EXTRUDER
2506
-                  && cpy <= Y_MAX_POS - Y_PROBE_OFFSET_FROM_EXTRUDER) {
2503
+              if (   cpx >= X_MIN_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
2504
+                  && cpx <= X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
2505
+                  && cpy >= Y_MIN_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)
2506
+                  && cpy <= Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)) {
2507
 
2507
 
2508
                 // Home the Z axis
2508
                 // Home the Z axis
2509
                 HOMEAXIS(Z);
2509
                 HOMEAXIS(Z);
2669
         }
2669
         }
2670
         else {
2670
         else {
2671
           // For others, save the Z of the previous point, then raise Z again.
2671
           // For others, save the Z of the previous point, then raise Z again.
2672
-          ix = (probe_point - 1) % MESH_NUM_X_POINTS;
2673
-          iy = (probe_point - 1) / MESH_NUM_X_POINTS;
2672
+          ix = (probe_point - 1) % (MESH_NUM_X_POINTS);
2673
+          iy = (probe_point - 1) / (MESH_NUM_X_POINTS);
2674
           if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // zig-zag
2674
           if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // zig-zag
2675
           mbl.set_z(ix, iy, current_position[Z_AXIS]);
2675
           mbl.set_z(ix, iy, current_position[Z_AXIS]);
2676
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2676
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2678
           st_synchronize();
2678
           st_synchronize();
2679
         }
2679
         }
2680
         // Is there another point to sample? Move there.
2680
         // Is there another point to sample? Move there.
2681
-        if (probe_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) {
2682
-          ix = probe_point % MESH_NUM_X_POINTS;
2683
-          iy = probe_point / MESH_NUM_X_POINTS;
2681
+        if (probe_point < (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
2682
+          ix = probe_point % (MESH_NUM_X_POINTS);
2683
+          iy = probe_point / (MESH_NUM_X_POINTS);
2684
           if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // zig-zag
2684
           if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // zig-zag
2685
           current_position[X_AXIS] = mbl.get_x(ix);
2685
           current_position[X_AXIS] = mbl.get_x(ix);
2686
           current_position[Y_AXIS] = mbl.get_y(iy);
2686
           current_position[Y_AXIS] = mbl.get_y(iy);
2832
           back_probe_bed_position = code_seen('B') ? code_value_short() : BACK_PROBE_BED_POSITION;
2832
           back_probe_bed_position = code_seen('B') ? code_value_short() : BACK_PROBE_BED_POSITION;
2833
 
2833
 
2834
       bool left_out_l = left_probe_bed_position < MIN_PROBE_X,
2834
       bool left_out_l = left_probe_bed_position < MIN_PROBE_X,
2835
-           left_out = left_out_l || left_probe_bed_position > right_probe_bed_position - MIN_PROBE_EDGE,
2835
+           left_out = left_out_l || left_probe_bed_position > right_probe_bed_position - (MIN_PROBE_EDGE),
2836
            right_out_r = right_probe_bed_position > MAX_PROBE_X,
2836
            right_out_r = right_probe_bed_position > MAX_PROBE_X,
2837
            right_out = right_out_r || right_probe_bed_position < left_probe_bed_position + MIN_PROBE_EDGE,
2837
            right_out = right_out_r || right_probe_bed_position < left_probe_bed_position + MIN_PROBE_EDGE,
2838
            front_out_f = front_probe_bed_position < MIN_PROBE_Y,
2838
            front_out_f = front_probe_bed_position < MIN_PROBE_Y,
2839
-           front_out = front_out_f || front_probe_bed_position > back_probe_bed_position - MIN_PROBE_EDGE,
2839
+           front_out = front_out_f || front_probe_bed_position > back_probe_bed_position - (MIN_PROBE_EDGE),
2840
            back_out_b = back_probe_bed_position > MAX_PROBE_Y,
2840
            back_out_b = back_probe_bed_position > MAX_PROBE_Y,
2841
            back_out = back_out_b || back_probe_bed_position < front_probe_bed_position + MIN_PROBE_EDGE;
2841
            back_out = back_out_b || back_probe_bed_position < front_probe_bed_position + MIN_PROBE_EDGE;
2842
 
2842
 
2843
       if (left_out || right_out || front_out || back_out) {
2843
       if (left_out || right_out || front_out || back_out) {
2844
         if (left_out) {
2844
         if (left_out) {
2845
           out_of_range_error(PSTR("(L)eft"));
2845
           out_of_range_error(PSTR("(L)eft"));
2846
-          left_probe_bed_position = left_out_l ? MIN_PROBE_X : right_probe_bed_position - MIN_PROBE_EDGE;
2846
+          left_probe_bed_position = left_out_l ? MIN_PROBE_X : right_probe_bed_position - (MIN_PROBE_EDGE);
2847
         }
2847
         }
2848
         if (right_out) {
2848
         if (right_out) {
2849
           out_of_range_error(PSTR("(R)ight"));
2849
           out_of_range_error(PSTR("(R)ight"));
2851
         }
2851
         }
2852
         if (front_out) {
2852
         if (front_out) {
2853
           out_of_range_error(PSTR("(F)ront"));
2853
           out_of_range_error(PSTR("(F)ront"));
2854
-          front_probe_bed_position = front_out_f ? MIN_PROBE_Y : back_probe_bed_position - MIN_PROBE_EDGE;
2854
+          front_probe_bed_position = front_out_f ? MIN_PROBE_Y : back_probe_bed_position - (MIN_PROBE_EDGE);
2855
         }
2855
         }
2856
         if (back_out) {
2856
         if (back_out) {
2857
           out_of_range_error(PSTR("(B)ack"));
2857
           out_of_range_error(PSTR("(B)ack"));
3602
     bool deploy_probe_for_each_reading = code_seen('E');
3602
     bool deploy_probe_for_each_reading = code_seen('E');
3603
 
3603
 
3604
     if (code_seen('X')) {
3604
     if (code_seen('X')) {
3605
-      X_probe_location = code_value() - X_PROBE_OFFSET_FROM_EXTRUDER;
3605
+      X_probe_location = code_value() - (X_PROBE_OFFSET_FROM_EXTRUDER);
3606
       if (X_probe_location < X_MIN_POS || X_probe_location > X_MAX_POS) {
3606
       if (X_probe_location < X_MIN_POS || X_probe_location > X_MAX_POS) {
3607
         out_of_range_error(PSTR("X"));
3607
         out_of_range_error(PSTR("X"));
3608
         return;
3608
         return;
3682
 
3682
 
3683
       if (n_legs) {
3683
       if (n_legs) {
3684
         millis_t ms = millis();
3684
         millis_t ms = millis();
3685
-        double radius = ms % (X_MAX_LENGTH / 4),       // limit how far out to go
3685
+        double radius = ms % ((X_MAX_LENGTH) / 4),       // limit how far out to go
3686
                theta = RADIANS(ms % 360L);
3686
                theta = RADIANS(ms % 360L);
3687
         float dir = (ms & 0x0001) ? 1 : -1;            // clockwise or counter clockwise
3687
         float dir = (ms & 0x0001) ? 1 : -1;            // clockwise or counter clockwise
3688
 
3688
 
3837
     #if HAS_TEMP_BED
3837
     #if HAS_TEMP_BED
3838
       SERIAL_PROTOCOLPGM(" B@:");
3838
       SERIAL_PROTOCOLPGM(" B@:");
3839
       #ifdef BED_WATTS
3839
       #ifdef BED_WATTS
3840
-        SERIAL_PROTOCOL((BED_WATTS * getHeaterPower(-1)) / 127);
3840
+        SERIAL_PROTOCOL(((BED_WATTS) * getHeaterPower(-1)) / 127);
3841
         SERIAL_PROTOCOLCHAR('W');
3841
         SERIAL_PROTOCOLCHAR('W');
3842
       #else
3842
       #else
3843
         SERIAL_PROTOCOL(getHeaterPower(-1));
3843
         SERIAL_PROTOCOL(getHeaterPower(-1));
3845
     #endif
3845
     #endif
3846
     SERIAL_PROTOCOLPGM(" @:");
3846
     SERIAL_PROTOCOLPGM(" @:");
3847
     #ifdef EXTRUDER_WATTS
3847
     #ifdef EXTRUDER_WATTS
3848
-      SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(target_extruder)) / 127);
3848
+      SERIAL_PROTOCOL(((EXTRUDER_WATTS) * getHeaterPower(target_extruder)) / 127);
3849
       SERIAL_PROTOCOLCHAR('W');
3849
       SERIAL_PROTOCOLCHAR('W');
3850
     #else
3850
     #else
3851
       SERIAL_PROTOCOL(getHeaterPower(target_extruder));
3851
       SERIAL_PROTOCOL(getHeaterPower(target_extruder));
3856
         SERIAL_PROTOCOL(e);
3856
         SERIAL_PROTOCOL(e);
3857
         SERIAL_PROTOCOLCHAR(':');
3857
         SERIAL_PROTOCOLCHAR(':');
3858
         #ifdef EXTRUDER_WATTS
3858
         #ifdef EXTRUDER_WATTS
3859
-          SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(e)) / 127);
3859
+          SERIAL_PROTOCOL(((EXTRUDER_WATTS) * getHeaterPower(e)) / 127);
3860
           SERIAL_PROTOCOLCHAR('W');
3860
           SERIAL_PROTOCOLCHAR('W');
3861
         #else
3861
         #else
3862
           SERIAL_PROTOCOL(getHeaterPower(e));
3862
           SERIAL_PROTOCOL(getHeaterPower(e));
3952
   #ifdef TEMP_RESIDENCY_TIME
3952
   #ifdef TEMP_RESIDENCY_TIME
3953
     long residency_start_ms = -1;
3953
     long residency_start_ms = -1;
3954
     // Loop until the temperature has stabilized
3954
     // Loop until the temperature has stabilized
3955
-    #define TEMP_CONDITIONS (residency_start_ms < 0 || now < residency_start_ms + TEMP_RESIDENCY_TIME * 1000UL)
3955
+    #define TEMP_CONDITIONS (residency_start_ms < 0 || now < residency_start_ms + (TEMP_RESIDENCY_TIME) * 1000UL)
3956
   #else
3956
   #else
3957
     // Loop until the temperature is very close target
3957
     // Loop until the temperature is very close target
3958
     #define TEMP_CONDITIONS (fabs(degHotend(target_extruder) - degTargetHotend(target_extruder)) < 0.75f)
3958
     #define TEMP_CONDITIONS (fabs(degHotend(target_extruder) - degTargetHotend(target_extruder)) < 0.75f)
3970
       #ifdef TEMP_RESIDENCY_TIME
3970
       #ifdef TEMP_RESIDENCY_TIME
3971
         SERIAL_PROTOCOLPGM(" W:");
3971
         SERIAL_PROTOCOLPGM(" W:");
3972
         if (residency_start_ms >= 0) {
3972
         if (residency_start_ms >= 0) {
3973
-          long rem = ((TEMP_RESIDENCY_TIME * 1000UL) - (now - residency_start_ms)) / 1000UL;
3973
+          long rem = (((TEMP_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL;
3974
           SERIAL_PROTOCOLLN(rem);
3974
           SERIAL_PROTOCOLLN(rem);
3975
         }
3975
         }
3976
         else {
3976
         else {
5542
     // this one uses actual amps in floating point
5542
     // this one uses actual amps in floating point
5543
     for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) digipot_i2c_set_current(i, code_value());
5543
     for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) digipot_i2c_set_current(i, code_value());
5544
     // for each additional extruder (named B,C,D,E..., channels 4,5,6,7...)
5544
     // for each additional extruder (named B,C,D,E..., channels 4,5,6,7...)
5545
-    for (int i = NUM_AXIS; i < DIGIPOT_I2C_NUM_CHANNELS; i++) if (code_seen('B' + i - NUM_AXIS)) digipot_i2c_set_current(i, code_value());
5545
+    for (int i = NUM_AXIS; i < DIGIPOT_I2C_NUM_CHANNELS; i++) if (code_seen('B' + i - (NUM_AXIS))) digipot_i2c_set_current(i, code_value());
5546
   #endif
5546
   #endif
5547
 }
5547
 }
5548
 
5548
 
6830
       ) {
6830
       ) {
6831
         lastMotor = ms; //... set time to NOW so the fan will turn on
6831
         lastMotor = ms; //... set time to NOW so the fan will turn on
6832
       }
6832
       }
6833
-      uint8_t speed = (lastMotor == 0 || ms >= lastMotor + (CONTROLLERFAN_SECS * 1000UL)) ? 0 : CONTROLLERFAN_SPEED;
6833
+      uint8_t speed = (lastMotor == 0 || ms >= lastMotor + ((CONTROLLERFAN_SECS) * 1000UL)) ? 0 : CONTROLLERFAN_SPEED;
6834
       // allows digital or PWM fan output to be used (see M42 handling)
6834
       // allows digital or PWM fan output to be used (see M42 handling)
6835
       digitalWrite(CONTROLLERFAN_PIN, speed);
6835
       digitalWrite(CONTROLLERFAN_PIN, speed);
6836
       analogWrite(CONTROLLERFAN_PIN, speed);
6836
       analogWrite(CONTROLLERFAN_PIN, speed);
7063
   #endif
7063
   #endif
7064
 
7064
 
7065
   #if ENABLED(EXTRUDER_RUNOUT_PREVENT)
7065
   #if ENABLED(EXTRUDER_RUNOUT_PREVENT)
7066
-    if (ms > previous_cmd_ms + EXTRUDER_RUNOUT_SECONDS * 1000)
7066
+    if (ms > previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000)
7067
       if (degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) {
7067
       if (degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) {
7068
         bool oldstatus;
7068
         bool oldstatus;
7069
         switch (active_extruder) {
7069
         switch (active_extruder) {
7092
         }
7092
         }
7093
         float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS];
7093
         float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS];
7094
         plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS],
7094
         plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS],
7095
-                         destination[E_AXIS] + EXTRUDER_RUNOUT_EXTRUDE * EXTRUDER_RUNOUT_ESTEPS / axis_steps_per_unit[E_AXIS],
7096
-                         EXTRUDER_RUNOUT_SPEED / 60. * EXTRUDER_RUNOUT_ESTEPS / axis_steps_per_unit[E_AXIS], active_extruder);
7095
+                         destination[E_AXIS] + (EXTRUDER_RUNOUT_EXTRUDE) * (EXTRUDER_RUNOUT_ESTEPS) / axis_steps_per_unit[E_AXIS],
7096
+                         (EXTRUDER_RUNOUT_SPEED) / 60. * (EXTRUDER_RUNOUT_ESTEPS) / axis_steps_per_unit[E_AXIS], active_extruder);
7097
       current_position[E_AXIS] = oldepos;
7097
       current_position[E_AXIS] = oldepos;
7098
       destination[E_AXIS] = oldedes;
7098
       destination[E_AXIS] = oldedes;
7099
       plan_set_e_position(oldepos);
7099
       plan_set_e_position(oldepos);

+ 1
- 1
Marlin/SdBaseFile.cpp Vedi File

1134
       // Sanity-check the VFAT entry. The first cluster is always set to zero. And the sequence number should be higher than 0
1134
       // Sanity-check the VFAT entry. The first cluster is always set to zero. And the sequence number should be higher than 0
1135
       if (VFAT->firstClusterLow == 0 && (VFAT->sequenceNumber & 0x1F) > 0 && (VFAT->sequenceNumber & 0x1F) <= MAX_VFAT_ENTRIES) {
1135
       if (VFAT->firstClusterLow == 0 && (VFAT->sequenceNumber & 0x1F) > 0 && (VFAT->sequenceNumber & 0x1F) <= MAX_VFAT_ENTRIES) {
1136
         // TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table.
1136
         // TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table.
1137
-        n = ((VFAT->sequenceNumber & 0x1F) - 1) * FILENAME_LENGTH;
1137
+        n = ((VFAT->sequenceNumber & 0x1F) - 1) * (FILENAME_LENGTH);
1138
         for (uint8_t i = 0; i < FILENAME_LENGTH; i++)
1138
         for (uint8_t i = 0; i < FILENAME_LENGTH; i++)
1139
           longFilename[n + i] = (i < 5) ? VFAT->name1[i] : (i < 11) ? VFAT->name2[i - 5] : VFAT->name3[i - 11];
1139
           longFilename[n + i] = (i < 5) ? VFAT->name1[i] : (i < 11) ? VFAT->name2[i - 5] : VFAT->name3[i - 11];
1140
         // If this VFAT entry is the last one, add a NUL terminator at the end of the string
1140
         // If this VFAT entry is the last one, add a NUL terminator at the end of the string

+ 2
- 2
Marlin/cardreader.cpp Vedi File

264
     workDirParents[i].getFilename(t); //SDBaseFile.getfilename!
264
     workDirParents[i].getFilename(t); //SDBaseFile.getfilename!
265
     while (*t && cnt < MAXPATHNAMELENGTH) { t++; cnt++; } //crawl counter forward.
265
     while (*t && cnt < MAXPATHNAMELENGTH) { t++; cnt++; } //crawl counter forward.
266
   }
266
   }
267
-  if (cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH)
267
+  if (cnt < MAXPATHNAMELENGTH - (FILENAME_LENGTH))
268
     file.getFilename(t);
268
     file.getFilename(t);
269
   else
269
   else
270
     t[0] = 0;
270
     t[0] = 0;
500
   while (root.readDir(p, NULL) > 0) {
500
   while (root.readDir(p, NULL) > 0) {
501
     for (int8_t i = 0; i < (int8_t)strlen((char*)p.name); i++) p.name[i] = tolower(p.name[i]);
501
     for (int8_t i = 0; i < (int8_t)strlen((char*)p.name); i++) p.name[i] = tolower(p.name[i]);
502
     if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) {
502
     if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) {
503
-      char cmd[4 + (FILENAME_LENGTH + 1) * MAX_DIR_DEPTH + 2];
503
+      char cmd[4 + (FILENAME_LENGTH + 1) * (MAX_DIR_DEPTH) + 2];
504
       sprintf_P(cmd, PSTR("M23 %s"), autoname);
504
       sprintf_P(cmd, PSTR("M23 %s"), autoname);
505
       enqueuecommand(cmd);
505
       enqueuecommand(cmd);
506
       enqueuecommands_P(PSTR("M24"));
506
       enqueuecommands_P(PSTR("M24"));

+ 1
- 1
Marlin/configuration_store.cpp Vedi File

163
   uint8_t mesh_num_y = 3;
163
   uint8_t mesh_num_y = 3;
164
   #if ENABLED(MESH_BED_LEVELING)
164
   #if ENABLED(MESH_BED_LEVELING)
165
     // Compile time test that sizeof(mbl.z_values) is as expected
165
     // Compile time test that sizeof(mbl.z_values) is as expected
166
-    typedef char c_assert[(sizeof(mbl.z_values) == MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS * sizeof(dummy)) ? 1 : -1];
166
+    typedef char c_assert[(sizeof(mbl.z_values) == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS) * sizeof(dummy)) ? 1 : -1];
167
     mesh_num_x = MESH_NUM_X_POINTS;
167
     mesh_num_x = MESH_NUM_X_POINTS;
168
     mesh_num_y = MESH_NUM_Y_POINTS;
168
     mesh_num_y = MESH_NUM_Y_POINTS;
169
     EEPROM_WRITE_VAR(i, mbl.active);
169
     EEPROM_WRITE_VAR(i, mbl.active);

+ 17
- 17
Marlin/dogm_lcd_implementation.h Vedi File

225
   #endif
225
   #endif
226
 
226
 
227
   #if ENABLED(SHOW_BOOTSCREEN)
227
   #if ENABLED(SHOW_BOOTSCREEN)
228
-    int offx = (u8g.getWidth() - START_BMPWIDTH) / 2;
228
+    int offx = (u8g.getWidth() - (START_BMPWIDTH)) / 2;
229
     #if ENABLED(START_BMPHIGH)
229
     #if ENABLED(START_BMPHIGH)
230
       int offy = 0;
230
       int offy = 0;
231
     #else
231
     #else
232
       int offy = DOG_CHAR_HEIGHT;
232
       int offy = DOG_CHAR_HEIGHT;
233
     #endif
233
     #endif
234
 
234
 
235
-    int txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1) * DOG_CHAR_WIDTH) / 2;
235
+    int txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH)) / 2;
236
 
236
 
237
     u8g.firstPage();
237
     u8g.firstPage();
238
     do {
238
     do {
240
         u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
240
         u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
241
         lcd_setFont(FONT_MENU);
241
         lcd_setFont(FONT_MENU);
242
         #ifndef STRING_SPLASH_LINE2
242
         #ifndef STRING_SPLASH_LINE2
243
-          u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1);
243
+          u8g.drawStr(txt1X, u8g.getHeight() - (DOG_CHAR_HEIGHT), STRING_SPLASH_LINE1);
244
         #else
244
         #else
245
-          int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1) * DOG_CHAR_WIDTH) / 2;
246
-          u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT * 3 / 2, STRING_SPLASH_LINE1);
247
-          u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT * 1 / 2, STRING_SPLASH_LINE2);
245
+          int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1) * (DOG_CHAR_WIDTH)) / 2;
246
+          u8g.drawStr(txt1X, u8g.getHeight() - (DOG_CHAR_HEIGHT) * 3 / 2, STRING_SPLASH_LINE1);
247
+          u8g.drawStr(txt2X, u8g.getHeight() - (DOG_CHAR_HEIGHT) * 1 / 2, STRING_SPLASH_LINE2);
248
         #endif
248
         #endif
249
       }
249
       }
250
     } while (u8g.nextPage());
250
     } while (u8g.nextPage());
288
 
288
 
289
   #if ENABLED(SDSUPPORT)
289
   #if ENABLED(SDSUPPORT)
290
     // SD Card Symbol
290
     // SD Card Symbol
291
-    u8g.drawBox(42, 42 - TALL_FONT_CORRECTION, 8, 7);
292
-    u8g.drawBox(50, 44 - TALL_FONT_CORRECTION, 2, 5);
293
-    u8g.drawFrame(42, 49 - TALL_FONT_CORRECTION, 10, 4);
294
-    u8g.drawPixel(50, 43 - TALL_FONT_CORRECTION);
291
+    u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7);
292
+    u8g.drawBox(50, 44 - (TALL_FONT_CORRECTION), 2, 5);
293
+    u8g.drawFrame(42, 49 - (TALL_FONT_CORRECTION), 10, 4);
294
+    u8g.drawPixel(50, 43 - (TALL_FONT_CORRECTION));
295
 
295
 
296
     // Progress bar frame
296
     // Progress bar frame
297
-    u8g.drawFrame(54, 49, 73, 4 - TALL_FONT_CORRECTION);
297
+    u8g.drawFrame(54, 49, 73, 4 - (TALL_FONT_CORRECTION));
298
 
298
 
299
     // SD Card Progress bar and clock
299
     // SD Card Progress bar and clock
300
     lcd_setFont(FONT_STATUSMENU);
300
     lcd_setFont(FONT_STATUSMENU);
301
 
301
 
302
     if (IS_SD_PRINTING) {
302
     if (IS_SD_PRINTING) {
303
       // Progress bar solid part
303
       // Progress bar solid part
304
-      u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2 - TALL_FONT_CORRECTION);
304
+      u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2 - (TALL_FONT_CORRECTION));
305
     }
305
     }
306
 
306
 
307
     u8g.setPrintPos(80,48);
307
     u8g.setPrintPos(80,48);
443
 static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
443
 static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
444
   if (isSelected) {
444
   if (isSelected) {
445
     u8g.setColorIndex(1);  // black on white
445
     u8g.setColorIndex(1);  // black on white
446
-    u8g.drawBox(0, row * DOG_CHAR_HEIGHT + 3 - TALL_FONT_CORRECTION, LCD_PIXEL_WIDTH, DOG_CHAR_HEIGHT);
446
+    u8g.drawBox(0, row * (DOG_CHAR_HEIGHT) + 3 - (TALL_FONT_CORRECTION), LCD_PIXEL_WIDTH, DOG_CHAR_HEIGHT);
447
     u8g.setColorIndex(0);  // following text must be white on black
447
     u8g.setColorIndex(0);  // following text must be white on black
448
   }
448
   }
449
   else {
449
   else {
450
     u8g.setColorIndex(1); // unmarked text is black on white
450
     u8g.setColorIndex(1); // unmarked text is black on white
451
   }
451
   }
452
-  u8g.setPrintPos(START_ROW * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
452
+  u8g.setPrintPos((START_ROW) * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT));
453
 }
453
 }
454
 
454
 
455
 static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) {
455
 static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) {
463
     pstr++;
463
     pstr++;
464
   }
464
   }
465
   while (n--) lcd_print(' ');
465
   while (n--) lcd_print(' ');
466
-  u8g.setPrintPos(LCD_PIXEL_WIDTH - DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
466
+  u8g.setPrintPos(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT));
467
   lcd_print(post_char);
467
   lcd_print(post_char);
468
   lcd_print(' ');
468
   lcd_print(' ');
469
 }
469
 }
481
   }
481
   }
482
   lcd_print(':');
482
   lcd_print(':');
483
   while (n--) lcd_print(' ');
483
   while (n--) lcd_print(' ');
484
-  u8g.setPrintPos(LCD_PIXEL_WIDTH - DOG_CHAR_WIDTH * vallen, (row + 1) * DOG_CHAR_HEIGHT);
484
+  u8g.setPrintPos(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH) * vallen, (row + 1) * (DOG_CHAR_HEIGHT));
485
   if (pgm)  lcd_printPGM(data);  else  lcd_print((char*)data);
485
   if (pgm)  lcd_printPGM(data);  else  lcd_print((char*)data);
486
 }
486
 }
487
 
487
 
528
 
528
 
529
   if (lcd_strlen_P(pstr) > LCD_WIDTH - 2 - vallen) rows = 2;
529
   if (lcd_strlen_P(pstr) > LCD_WIDTH - 2 - vallen) rows = 2;
530
 
530
 
531
-  const float kHalfChar = DOG_CHAR_HEIGHT_EDIT / 2;
531
+  const float kHalfChar = (DOG_CHAR_HEIGHT_EDIT) / 2;
532
   float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3
532
   float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3
533
 
533
 
534
   u8g.setPrintPos(0, rowHeight + kHalfChar);
534
   u8g.setPrintPos(0, rowHeight + kHalfChar);

+ 3
- 3
Marlin/example_configurations/Felix/Configuration.h Vedi File

405
 
405
 
406
 #if ENABLED(MESH_BED_LEVELING)
406
 #if ENABLED(MESH_BED_LEVELING)
407
   #define MESH_MIN_X 10
407
   #define MESH_MIN_X 10
408
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
408
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
409
   #define MESH_MIN_Y 10
409
   #define MESH_MIN_Y 10
410
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
411
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
410
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
411
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
412
   #define MESH_NUM_Y_POINTS 3
412
   #define MESH_NUM_Y_POINTS 3
413
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
413
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
414
 
414
 

+ 3
- 3
Marlin/example_configurations/Felix/Configuration_DUAL.h Vedi File

402
 
402
 
403
 #if ENABLED(MESH_BED_LEVELING)
403
 #if ENABLED(MESH_BED_LEVELING)
404
   #define MESH_MIN_X 10
404
   #define MESH_MIN_X 10
405
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
405
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
406
   #define MESH_MIN_Y 10
406
   #define MESH_MIN_Y 10
407
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
408
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
407
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
408
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
409
   #define MESH_NUM_Y_POINTS 3
409
   #define MESH_NUM_Y_POINTS 3
410
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
410
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
411
 
411
 

+ 3
- 3
Marlin/example_configurations/Hephestos/Configuration.h Vedi File

415
 
415
 
416
 #if ENABLED(MESH_BED_LEVELING)
416
 #if ENABLED(MESH_BED_LEVELING)
417
   #define MESH_MIN_X 10
417
   #define MESH_MIN_X 10
418
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
418
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
419
   #define MESH_MIN_Y 10
419
   #define MESH_MIN_Y 10
420
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
421
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
420
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
421
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
422
   #define MESH_NUM_Y_POINTS 3
422
   #define MESH_NUM_Y_POINTS 3
423
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
423
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
424
 
424
 

+ 3
- 3
Marlin/example_configurations/Hephestos_2/Configuration.h Vedi File

418
 
418
 
419
 #if ENABLED(MESH_BED_LEVELING)
419
 #if ENABLED(MESH_BED_LEVELING)
420
   #define MESH_MIN_X 10
420
   #define MESH_MIN_X 10
421
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
421
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
422
   #define MESH_MIN_Y 10
422
   #define MESH_MIN_Y 10
423
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
424
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
423
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
424
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
425
   #define MESH_NUM_Y_POINTS 3
425
   #define MESH_NUM_Y_POINTS 3
426
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
426
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
427
 
427
 

+ 3
- 3
Marlin/example_configurations/K8200/Configuration.h Vedi File

438
 
438
 
439
 #if ENABLED(MESH_BED_LEVELING)
439
 #if ENABLED(MESH_BED_LEVELING)
440
   #define MESH_MIN_X 10
440
   #define MESH_MIN_X 10
441
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
441
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
442
   #define MESH_MIN_Y 10
442
   #define MESH_MIN_Y 10
443
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
444
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
443
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
444
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
445
   #define MESH_NUM_Y_POINTS 3
445
   #define MESH_NUM_Y_POINTS 3
446
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
446
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
447
 
447
 

+ 3
- 3
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h Vedi File

423
 
423
 
424
 #if ENABLED(MESH_BED_LEVELING)
424
 #if ENABLED(MESH_BED_LEVELING)
425
   #define MESH_MIN_X 10
425
   #define MESH_MIN_X 10
426
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
426
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
427
   #define MESH_MIN_Y 10
427
   #define MESH_MIN_Y 10
428
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
429
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
428
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
429
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
430
   #define MESH_NUM_Y_POINTS 3
430
   #define MESH_NUM_Y_POINTS 3
431
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
431
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
432
 
432
 

+ 3
- 3
Marlin/example_configurations/RigidBot/Configuration.h Vedi File

417
 
417
 
418
 #if ENABLED(MESH_BED_LEVELING)
418
 #if ENABLED(MESH_BED_LEVELING)
419
   #define MESH_MIN_X 10
419
   #define MESH_MIN_X 10
420
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
420
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
421
   #define MESH_MIN_Y 10
421
   #define MESH_MIN_Y 10
422
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
423
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
422
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
423
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
424
   #define MESH_NUM_Y_POINTS 3
424
   #define MESH_NUM_Y_POINTS 3
425
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
425
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
426
 
426
 

+ 3
- 3
Marlin/example_configurations/SCARA/Configuration.h Vedi File

431
 
431
 
432
 #if ENABLED(MESH_BED_LEVELING)
432
 #if ENABLED(MESH_BED_LEVELING)
433
   #define MESH_MIN_X 10
433
   #define MESH_MIN_X 10
434
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
434
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
435
   #define MESH_MIN_Y 10
435
   #define MESH_MIN_Y 10
436
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
437
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
436
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
437
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
438
   #define MESH_NUM_Y_POINTS 3
438
   #define MESH_NUM_Y_POINTS 3
439
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
439
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
440
 
440
 

+ 3
- 3
Marlin/example_configurations/TAZ4/Configuration.h Vedi File

443
 
443
 
444
 #if ENABLED(MESH_BED_LEVELING)
444
 #if ENABLED(MESH_BED_LEVELING)
445
   #define MESH_MIN_X 10
445
   #define MESH_MIN_X 10
446
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
446
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
447
   #define MESH_MIN_Y 10
447
   #define MESH_MIN_Y 10
448
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
449
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
448
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
449
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
450
   #define MESH_NUM_Y_POINTS 3
450
   #define MESH_NUM_Y_POINTS 3
451
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
451
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
452
 
452
 

+ 3
- 3
Marlin/example_configurations/WITBOX/Configuration.h Vedi File

415
 
415
 
416
 #if ENABLED(MESH_BED_LEVELING)
416
 #if ENABLED(MESH_BED_LEVELING)
417
   #define MESH_MIN_X 10
417
   #define MESH_MIN_X 10
418
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
418
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
419
   #define MESH_MIN_Y 10
419
   #define MESH_MIN_Y 10
420
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
421
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
420
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
421
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
422
   #define MESH_NUM_Y_POINTS 3
422
   #define MESH_NUM_Y_POINTS 3
423
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
423
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
424
 
424
 

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

423
 
423
 
424
 #if ENABLED(MESH_BED_LEVELING)
424
 #if ENABLED(MESH_BED_LEVELING)
425
   #define MESH_MIN_X 10
425
   #define MESH_MIN_X 10
426
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
426
+  #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
427
   #define MESH_MIN_Y 10
427
   #define MESH_MIN_Y 10
428
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
428
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
429
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
429
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
430
   #define MESH_NUM_Y_POINTS 3
430
   #define MESH_NUM_Y_POINTS 3
431
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
431
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.

+ 2
- 2
Marlin/example_configurations/delta/biv2.5/Configuration.h Vedi File

458
 
458
 
459
 #if ENABLED(MESH_BED_LEVELING)
459
 #if ENABLED(MESH_BED_LEVELING)
460
   #define MESH_MIN_X 10
460
   #define MESH_MIN_X 10
461
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
461
+  #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
462
   #define MESH_MIN_Y 10
462
   #define MESH_MIN_Y 10
463
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
463
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
464
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
464
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
465
   #define MESH_NUM_Y_POINTS 3
465
   #define MESH_NUM_Y_POINTS 3
466
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
466
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.

+ 2
- 2
Marlin/example_configurations/delta/generic/Configuration.h Vedi File

458
 
458
 
459
 #if ENABLED(MESH_BED_LEVELING)
459
 #if ENABLED(MESH_BED_LEVELING)
460
   #define MESH_MIN_X 10
460
   #define MESH_MIN_X 10
461
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
461
+  #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
462
   #define MESH_MIN_Y 10
462
   #define MESH_MIN_Y 10
463
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
463
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
464
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
464
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
465
   #define MESH_NUM_Y_POINTS 3
465
   #define MESH_NUM_Y_POINTS 3
466
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
466
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.

+ 2
- 2
Marlin/example_configurations/delta/kossel_mini/Configuration.h Vedi File

458
 
458
 
459
 #if ENABLED(MESH_BED_LEVELING)
459
 #if ENABLED(MESH_BED_LEVELING)
460
   #define MESH_MIN_X 10
460
   #define MESH_MIN_X 10
461
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
461
+  #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
462
   #define MESH_MIN_Y 10
462
   #define MESH_MIN_Y 10
463
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
463
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
464
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
464
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
465
   #define MESH_NUM_Y_POINTS 3
465
   #define MESH_NUM_Y_POINTS 3
466
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
466
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.

+ 4
- 4
Marlin/example_configurations/delta/kossel_pro/Configuration.h Vedi File

445
 
445
 
446
 #if ENABLED(MESH_BED_LEVELING)
446
 #if ENABLED(MESH_BED_LEVELING)
447
   #define MESH_MIN_X 10
447
   #define MESH_MIN_X 10
448
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
448
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
449
   #define MESH_MIN_Y 10
449
   #define MESH_MIN_Y 10
450
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
451
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
450
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
451
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
452
   #define MESH_NUM_Y_POINTS 3
452
   #define MESH_NUM_Y_POINTS 3
453
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
453
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
454
 
454
 
714
 #define XYZ_MICROSTEPS 32
714
 #define XYZ_MICROSTEPS 32
715
 #define XYZ_BELT_PITCH 2
715
 #define XYZ_BELT_PITCH 2
716
 #define XYZ_PULLEY_TEETH 20
716
 #define XYZ_PULLEY_TEETH 20
717
-#define XYZ_STEPS (XYZ_FULL_STEPS_PER_ROTATION * XYZ_MICROSTEPS / double(XYZ_BELT_PITCH) / double(XYZ_PULLEY_TEETH))
717
+#define XYZ_STEPS ((XYZ_FULL_STEPS_PER_ROTATION) * (XYZ_MICROSTEPS) / double(XYZ_BELT_PITCH) / double(XYZ_PULLEY_TEETH))
718
 
718
 
719
 // default settings
719
 // default settings
720
 // delta speeds must be the same on xyz
720
 // delta speeds must be the same on xyz

+ 4
- 4
Marlin/example_configurations/delta/kossel_xl/Configuration.h Vedi File

451
 
451
 
452
 #if ENABLED(MESH_BED_LEVELING)
452
 #if ENABLED(MESH_BED_LEVELING)
453
   #define MESH_MIN_X 10
453
   #define MESH_MIN_X 10
454
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
454
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
455
   #define MESH_MIN_Y 10
455
   #define MESH_MIN_Y 10
456
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
457
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
456
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
457
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
458
   #define MESH_NUM_Y_POINTS 3
458
   #define MESH_NUM_Y_POINTS 3
459
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
459
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
460
 
460
 
635
 #define XYZ_MICROSTEPS 16
635
 #define XYZ_MICROSTEPS 16
636
 #define XYZ_BELT_PITCH 2
636
 #define XYZ_BELT_PITCH 2
637
 #define XYZ_PULLEY_TEETH 16
637
 #define XYZ_PULLEY_TEETH 16
638
-#define XYZ_STEPS (XYZ_FULL_STEPS_PER_ROTATION * XYZ_MICROSTEPS / double(XYZ_BELT_PITCH) / double(XYZ_PULLEY_TEETH))
638
+#define XYZ_STEPS ((XYZ_FULL_STEPS_PER_ROTATION) * (XYZ_MICROSTEPS) / double(XYZ_BELT_PITCH) / double(XYZ_PULLEY_TEETH))
639
 
639
 
640
 #define DEFAULT_AXIS_STEPS_PER_UNIT   {XYZ_STEPS, XYZ_STEPS, XYZ_STEPS, 158}   // default steps per unit for PowerWasp
640
 #define DEFAULT_AXIS_STEPS_PER_UNIT   {XYZ_STEPS, XYZ_STEPS, XYZ_STEPS, 158}   // default steps per unit for PowerWasp
641
 #define DEFAULT_MAX_FEEDRATE          {200, 200, 200, 200}    // (mm/sec)
641
 #define DEFAULT_MAX_FEEDRATE          {200, 200, 200, 200}    // (mm/sec)

+ 3
- 3
Marlin/example_configurations/makibox/Configuration.h Vedi File

426
 
426
 
427
 #if ENABLED(MESH_BED_LEVELING)
427
 #if ENABLED(MESH_BED_LEVELING)
428
   #define MESH_MIN_X 10
428
   #define MESH_MIN_X 10
429
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
429
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
430
   #define MESH_MIN_Y 10
430
   #define MESH_MIN_Y 10
431
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
432
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
431
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
432
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
433
   #define MESH_NUM_Y_POINTS 3
433
   #define MESH_NUM_Y_POINTS 3
434
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
434
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
435
 
435
 

+ 3
- 3
Marlin/example_configurations/tvrrug/Round2/Configuration.h Vedi File

413
 
413
 
414
 #if ENABLED(MESH_BED_LEVELING)
414
 #if ENABLED(MESH_BED_LEVELING)
415
   #define MESH_MIN_X 10
415
   #define MESH_MIN_X 10
416
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
416
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
417
   #define MESH_MIN_Y 10
417
   #define MESH_MIN_Y 10
418
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
419
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
418
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
419
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
420
   #define MESH_NUM_Y_POINTS 3
420
   #define MESH_NUM_Y_POINTS 3
421
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
421
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
422
 
422
 

+ 2
- 2
Marlin/mesh_bed_leveling.h Vedi File

2
 
2
 
3
 #if ENABLED(MESH_BED_LEVELING)
3
 #if ENABLED(MESH_BED_LEVELING)
4
 
4
 
5
-  #define MESH_X_DIST ((MESH_MAX_X - MESH_MIN_X)/(MESH_NUM_X_POINTS - 1))
6
-  #define MESH_Y_DIST ((MESH_MAX_Y - MESH_MIN_Y)/(MESH_NUM_Y_POINTS - 1))
5
+  #define MESH_X_DIST ((MESH_MAX_X - (MESH_MIN_X))/(MESH_NUM_X_POINTS - 1))
6
+  #define MESH_Y_DIST ((MESH_MAX_Y - (MESH_MIN_Y))/(MESH_NUM_Y_POINTS - 1))
7
 
7
 
8
   class mesh_bed_leveling {
8
   class mesh_bed_leveling {
9
   public:
9
   public:

+ 10
- 10
Marlin/planner.cpp Vedi File

447
       }
447
       }
448
     #endif //FAN_KICKSTART_TIME
448
     #endif //FAN_KICKSTART_TIME
449
     #if defined(FAN_MIN_PWM)
449
     #if defined(FAN_MIN_PWM)
450
-      #define CALC_FAN_SPEED (tail_fan_speed ? ( FAN_MIN_PWM + (tail_fan_speed * (255 - FAN_MIN_PWM)) / 255 ) : 0)
450
+      #define CALC_FAN_SPEED (tail_fan_speed ? ( FAN_MIN_PWM + (tail_fan_speed * (255 - (FAN_MIN_PWM))) / 255 ) : 0)
451
     #else
451
     #else
452
       #define CALC_FAN_SPEED tail_fan_speed
452
       #define CALC_FAN_SPEED tail_fan_speed
453
     #endif // FAN_MIN_PWM
453
     #endif // FAN_MIN_PWM
524
         SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
524
         SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
525
       }
525
       }
526
       #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
526
       #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
527
-        if (labs(de) > axis_steps_per_unit[E_AXIS] * EXTRUDE_MAXLENGTH) {
527
+        if (labs(de) > axis_steps_per_unit[E_AXIS] * (EXTRUDE_MAXLENGTH)) {
528
           position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
528
           position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
529
           de = 0; // no difference
529
           de = 0; // no difference
530
           SERIAL_ECHO_START;
530
           SERIAL_ECHO_START;
634
           #if ENABLED(DUAL_X_CARRIAGE)
634
           #if ENABLED(DUAL_X_CARRIAGE)
635
             if (extruder_duplication_enabled) {
635
             if (extruder_duplication_enabled) {
636
               enable_e1();
636
               enable_e1();
637
-              g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE * 2;
637
+              g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
638
             }
638
             }
639
           #endif
639
           #endif
640
-          g_uc_extruder_last_move[0] = BLOCK_BUFFER_SIZE * 2;
640
+          g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2;
641
           #if EXTRUDERS > 1
641
           #if EXTRUDERS > 1
642
             if (g_uc_extruder_last_move[1] == 0) disable_e1();
642
             if (g_uc_extruder_last_move[1] == 0) disable_e1();
643
             #if EXTRUDERS > 2
643
             #if EXTRUDERS > 2
651
         #if EXTRUDERS > 1
651
         #if EXTRUDERS > 1
652
           case 1:
652
           case 1:
653
             enable_e1();
653
             enable_e1();
654
-            g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE * 2;
654
+            g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
655
             if (g_uc_extruder_last_move[0] == 0) disable_e0();
655
             if (g_uc_extruder_last_move[0] == 0) disable_e0();
656
             #if EXTRUDERS > 2
656
             #if EXTRUDERS > 2
657
               if (g_uc_extruder_last_move[2] == 0) disable_e2();
657
               if (g_uc_extruder_last_move[2] == 0) disable_e2();
663
           #if EXTRUDERS > 2
663
           #if EXTRUDERS > 2
664
             case 2:
664
             case 2:
665
               enable_e2();
665
               enable_e2();
666
-              g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE * 2;
666
+              g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2;
667
               if (g_uc_extruder_last_move[0] == 0) disable_e0();
667
               if (g_uc_extruder_last_move[0] == 0) disable_e0();
668
               if (g_uc_extruder_last_move[1] == 0) disable_e1();
668
               if (g_uc_extruder_last_move[1] == 0) disable_e1();
669
               #if EXTRUDERS > 3
669
               #if EXTRUDERS > 3
673
             #if EXTRUDERS > 3
673
             #if EXTRUDERS > 3
674
               case 3:
674
               case 3:
675
                 enable_e3();
675
                 enable_e3();
676
-                g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE * 2;
676
+                g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2;
677
                 if (g_uc_extruder_last_move[0] == 0) disable_e0();
677
                 if (g_uc_extruder_last_move[0] == 0) disable_e0();
678
                 if (g_uc_extruder_last_move[1] == 0) disable_e1();
678
                 if (g_uc_extruder_last_move[1] == 0) disable_e1();
679
                 if (g_uc_extruder_last_move[2] == 0) disable_e2();
679
                 if (g_uc_extruder_last_move[2] == 0) disable_e2();
749
 
749
 
750
   // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
750
   // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
751
   #if ENABLED(OLD_SLOWDOWN) || ENABLED(SLOWDOWN)
751
   #if ENABLED(OLD_SLOWDOWN) || ENABLED(SLOWDOWN)
752
-    bool mq = moves_queued > 1 && moves_queued < BLOCK_BUFFER_SIZE / 2;
752
+    bool mq = moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE) / 2;
753
     #if ENABLED(OLD_SLOWDOWN)
753
     #if ENABLED(OLD_SLOWDOWN)
754
-      if (mq) feed_rate *= 2.0 * moves_queued / BLOCK_BUFFER_SIZE;
754
+      if (mq) feed_rate *= 2.0 * moves_queued / (BLOCK_BUFFER_SIZE);
755
     #endif
755
     #endif
756
     #if ENABLED(SLOWDOWN)
756
     #if ENABLED(SLOWDOWN)
757
       //  segment time im micro seconds
757
       //  segment time im micro seconds
974
     }
974
     }
975
     else {
975
     else {
976
       long acc_dist = estimate_acceleration_distance(0, block->nominal_rate, block->acceleration_st);
976
       long acc_dist = estimate_acceleration_distance(0, block->nominal_rate, block->acceleration_st);
977
-      float advance = (STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K) * (cse * cse * EXTRUSION_AREA * EXTRUSION_AREA) * 256;
977
+      float advance = ((STEPS_PER_CUBIC_MM_E) * (EXTRUDER_ADVANCE_K)) * (cse * cse * (EXTRUSION_AREA) * (EXTRUSION_AREA)) * 256;
978
       block->advance = advance;
978
       block->advance = advance;
979
       block->advance_rate = acc_dist ? advance / (float)acc_dist : 0;
979
       block->advance_rate = acc_dist ? advance / (float)acc_dist : 0;
980
     }
980
     }

+ 1
- 1
Marlin/servo.cpp Vedi File

281
   byte channel = this->servoIndex;
281
   byte channel = this->servoIndex;
282
   if (channel < MAX_SERVOS) {  // ensure channel is valid
282
   if (channel < MAX_SERVOS) {  // ensure channel is valid
283
     // ensure pulse width is valid
283
     // ensure pulse width is valid
284
-    value = constrain(value, SERVO_MIN(), SERVO_MAX()) - TRIM_DURATION;
284
+    value = constrain(value, SERVO_MIN(), SERVO_MAX()) - (TRIM_DURATION);
285
     value = usToTicks(value);  // convert to ticks after compensating for interrupt overhead - 12 Aug 2009
285
     value = usToTicks(value);  // convert to ticks after compensating for interrupt overhead - 12 Aug 2009
286
 
286
 
287
     CRITICAL_SECTION_START;
287
     CRITICAL_SECTION_START;

+ 13
- 13
Marlin/temperature.cpp Vedi File

139
 #if ENABLED(PIDTEMP)
139
 #if ENABLED(PIDTEMP)
140
   #if ENABLED(PID_PARAMS_PER_EXTRUDER)
140
   #if ENABLED(PID_PARAMS_PER_EXTRUDER)
141
     float Kp[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_Kp);
141
     float Kp[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_Kp);
142
-    float Ki[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_Ki* PID_dT);
143
-    float Kd[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_Kd / PID_dT);
142
+    float Ki[EXTRUDERS] = ARRAY_BY_EXTRUDERS1((DEFAULT_Ki) * (PID_dT));
143
+    float Kd[EXTRUDERS] = ARRAY_BY_EXTRUDERS1((DEFAULT_Kd) / (PID_dT));
144
     #if ENABLED(PID_ADD_EXTRUSION_RATE)
144
     #if ENABLED(PID_ADD_EXTRUSION_RATE)
145
       float Kc[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_Kc);
145
       float Kc[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_Kc);
146
     #endif // PID_ADD_EXTRUSION_RATE
146
     #endif // PID_ADD_EXTRUSION_RATE
230
   disable_all_heaters(); // switch off all heaters.
230
   disable_all_heaters(); // switch off all heaters.
231
 
231
 
232
   if (extruder < 0)
232
   if (extruder < 0)
233
-    soft_pwm_bed = bias = d = MAX_BED_POWER / 2;
233
+    soft_pwm_bed = bias = d = (MAX_BED_POWER) / 2;
234
   else
234
   else
235
-    soft_pwm[extruder] = bias = d = PID_MAX / 2;
235
+    soft_pwm[extruder] = bias = d = (PID_MAX) / 2;
236
 
236
 
237
   // PID Tuning loop
237
   // PID Tuning loop
238
   for (;;) {
238
   for (;;) {
355
 void updatePID() {
355
 void updatePID() {
356
   #if ENABLED(PIDTEMP)
356
   #if ENABLED(PIDTEMP)
357
     for (int e = 0; e < EXTRUDERS; e++) {
357
     for (int e = 0; e < EXTRUDERS; e++) {
358
-      temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / PID_PARAM(Ki,e);
358
+      temp_iState_max[e] = (PID_INTEGRAL_DRIVE_MAX) / PID_PARAM(Ki,e);
359
       #if ENABLED(PID_ADD_EXTRUSION_RATE)
359
       #if ENABLED(PID_ADD_EXTRUSION_RATE)
360
         last_position[e] = 0;
360
         last_position[e] = 0;
361
       #endif
361
       #endif
362
     }
362
     }
363
   #endif
363
   #endif
364
   #if ENABLED(PIDTEMPBED)
364
   #if ENABLED(PIDTEMPBED)
365
-    temp_iState_max_bed = PID_BED_INTEGRAL_DRIVE_MAX / bedKi;
365
+    temp_iState_max_bed = (PID_BED_INTEGRAL_DRIVE_MAX) / bedKi;
366
   #endif
366
   #endif
367
 }
367
 }
368
 
368
 
481
         pid_output = BANG_MAX;
481
         pid_output = BANG_MAX;
482
         pid_reset[e] = true;
482
         pid_reset[e] = true;
483
       }
483
       }
484
-      else if (pid_error[e] < -PID_FUNCTIONAL_RANGE || target_temperature[e] == 0) {
484
+      else if (pid_error[e] < -(PID_FUNCTIONAL_RANGE) || target_temperature[e] == 0) {
485
         pid_output = 0;
485
         pid_output = 0;
486
         pid_reset[e] = true;
486
         pid_reset[e] = true;
487
       }
487
       }
698
       if (current_temperature_bed > BED_MINTEMP && current_temperature_bed < BED_MAXTEMP) {
698
       if (current_temperature_bed > BED_MINTEMP && current_temperature_bed < BED_MAXTEMP) {
699
         if (current_temperature_bed >= target_temperature_bed + BED_HYSTERESIS)
699
         if (current_temperature_bed >= target_temperature_bed + BED_HYSTERESIS)
700
           soft_pwm_bed = 0;
700
           soft_pwm_bed = 0;
701
-        else if (current_temperature_bed <= target_temperature_bed - BED_HYSTERESIS)
701
+        else if (current_temperature_bed <= target_temperature_bed - (BED_HYSTERESIS))
702
           soft_pwm_bed = MAX_BED_POWER >> 1;
702
           soft_pwm_bed = MAX_BED_POWER >> 1;
703
       }
703
       }
704
       else {
704
       else {
759
 
759
 
760
     return celsius;
760
     return celsius;
761
   }
761
   }
762
-  return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET;
762
+  return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN)) + TEMP_SENSOR_AD595_OFFSET;
763
 }
763
 }
764
 
764
 
765
 // Derived from RepRap FiveD extruder::getTemperature()
765
 // Derived from RepRap FiveD extruder::getTemperature()
786
 
786
 
787
   #elif defined(BED_USES_AD595)
787
   #elif defined(BED_USES_AD595)
788
 
788
 
789
-    return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET;
789
+    return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN)) + TEMP_SENSOR_AD595_OFFSET;
790
 
790
 
791
   #else
791
   #else
792
 
792
 
860
     maxttemp[e] = maxttemp[0];
860
     maxttemp[e] = maxttemp[0];
861
     #if ENABLED(PIDTEMP)
861
     #if ENABLED(PIDTEMP)
862
       temp_iState_min[e] = 0.0;
862
       temp_iState_min[e] = 0.0;
863
-      temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / PID_PARAM(Ki, e);
863
+      temp_iState_max[e] = (PID_INTEGRAL_DRIVE_MAX) / PID_PARAM(Ki, e);
864
       #if ENABLED(PID_ADD_EXTRUSION_RATE)
864
       #if ENABLED(PID_ADD_EXTRUSION_RATE)
865
         last_position[e] = 0;
865
         last_position[e] = 0;
866
       #endif
866
       #endif
867
     #endif //PIDTEMP
867
     #endif //PIDTEMP
868
     #if ENABLED(PIDTEMPBED)
868
     #if ENABLED(PIDTEMPBED)
869
       temp_iState_min_bed = 0.0;
869
       temp_iState_min_bed = 0.0;
870
-      temp_iState_max_bed = PID_BED_INTEGRAL_DRIVE_MAX / bedKi;
870
+      temp_iState_max_bed = (PID_BED_INTEGRAL_DRIVE_MAX) / bedKi;
871
     #endif //PIDTEMPBED
871
     #endif //PIDTEMPBED
872
   }
872
   }
873
 
873
 
1042
   void start_watching_heater(int e) {
1042
   void start_watching_heater(int e) {
1043
     if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) {
1043
     if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) {
1044
       watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE;
1044
       watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE;
1045
-      watch_heater_next_ms[e] = millis() + WATCH_TEMP_PERIOD * 1000UL;
1045
+      watch_heater_next_ms[e] = millis() + (WATCH_TEMP_PERIOD) * 1000UL;
1046
     }
1046
     }
1047
     else
1047
     else
1048
       watch_heater_next_ms[e] = 0;
1048
       watch_heater_next_ms[e] = 0;

+ 15
- 15
Marlin/ultralcd.cpp Vedi File

28
 typedef void (*menuFunc_t)();
28
 typedef void (*menuFunc_t)();
29
 
29
 
30
 uint8_t lcd_status_message_level;
30
 uint8_t lcd_status_message_level;
31
-char lcd_status_message[3 * LCD_WIDTH + 1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1
31
+char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1
32
 
32
 
33
 #if ENABLED(DOGLCD)
33
 #if ENABLED(DOGLCD)
34
   #include "dogm_lcd_implementation.h"
34
   #include "dogm_lcd_implementation.h"
209
     #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
209
     #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
210
   #endif //!ENCODER_RATE_MULTIPLIER
210
   #endif //!ENCODER_RATE_MULTIPLIER
211
   #define END_MENU() \
211
   #define END_MENU() \
212
-      if (encoderLine >= _menuItemNr) { encoderPosition = _menuItemNr * ENCODER_STEPS_PER_MENU_ITEM - 1; encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; }\
213
-      if (encoderLine >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = encoderLine - LCD_HEIGHT + 1; lcdDrawUpdate = 1; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \
212
+      if (encoderLine >= _menuItemNr) { encoderPosition = _menuItemNr * (ENCODER_STEPS_PER_MENU_ITEM) - 1; encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; }\
213
+      if (encoderLine >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = encoderLine - (LCD_HEIGHT) + 1; lcdDrawUpdate = 1; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \
214
       } } while(0)
214
       } } while(0)
215
 
215
 
216
   /** Used variables to keep track of the menu */
216
   /** Used variables to keep track of the menu */
356
       }
356
       }
357
       if (feedrate_multiplier == 100) {
357
       if (feedrate_multiplier == 100) {
358
         if (int(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) {
358
         if (int(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) {
359
-          feedrate_multiplier += int(encoderPosition) - ENCODER_FEEDRATE_DEADZONE;
359
+          feedrate_multiplier += int(encoderPosition) - (ENCODER_FEEDRATE_DEADZONE);
360
           encoderPosition = 0;
360
           encoderPosition = 0;
361
         }
361
         }
362
         else if (int(encoderPosition) < -ENCODER_FEEDRATE_DEADZONE) {
362
         else if (int(encoderPosition) < -ENCODER_FEEDRATE_DEADZONE) {
841
   if (LCD_CLICKED) lcd_goto_previous_menu();
841
   if (LCD_CLICKED) lcd_goto_previous_menu();
842
 }
842
 }
843
 #if ENABLED(DELTA)
843
 #if ENABLED(DELTA)
844
-  static float delta_clip_radius_2 =  DELTA_PRINTABLE_RADIUS * DELTA_PRINTABLE_RADIUS;
844
+  static float delta_clip_radius_2 =  (DELTA_PRINTABLE_RADIUS) * (DELTA_PRINTABLE_RADIUS);
845
   static int delta_clip( float a ) { return sqrt(delta_clip_radius_2 - a*a); }
845
   static int delta_clip( float a ) { return sqrt(delta_clip_radius_2 - a*a); }
846
   static void lcd_move_x() { int clip = delta_clip(current_position[Y_AXIS]); _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, max(X_MIN_POS, -clip), min(X_MAX_POS, clip)); }
846
   static void lcd_move_x() { int clip = delta_clip(current_position[Y_AXIS]); _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, max(X_MIN_POS, -clip), min(X_MAX_POS, clip)); }
847
   static void lcd_move_y() { int clip = delta_clip(current_position[X_AXIS]); _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, max(X_MIN_POS, -clip), min(X_MAX_POS, clip)); }
847
   static void lcd_move_y() { int clip = delta_clip(current_position[X_AXIS]); _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, max(X_MIN_POS, -clip), min(X_MAX_POS, clip)); }
1823
 
1823
 
1824
 void lcd_setstatus(const char* message, bool persist) {
1824
 void lcd_setstatus(const char* message, bool persist) {
1825
   if (lcd_status_message_level > 0) return;
1825
   if (lcd_status_message_level > 0) return;
1826
-  strncpy(lcd_status_message, message, 3 * LCD_WIDTH);
1826
+  strncpy(lcd_status_message, message, 3 * (LCD_WIDTH));
1827
   set_utf_strlen(lcd_status_message, LCD_WIDTH);
1827
   set_utf_strlen(lcd_status_message, LCD_WIDTH);
1828
   lcd_finishstatus(persist);
1828
   lcd_finishstatus(persist);
1829
 }
1829
 }
1830
 
1830
 
1831
 void lcd_setstatuspgm(const char* message, uint8_t level) {
1831
 void lcd_setstatuspgm(const char* message, uint8_t level) {
1832
   if (level >= lcd_status_message_level) {
1832
   if (level >= lcd_status_message_level) {
1833
-    strncpy_P(lcd_status_message, message, 3 * LCD_WIDTH);
1833
+    strncpy_P(lcd_status_message, message, 3 * (LCD_WIDTH));
1834
     set_utf_strlen(lcd_status_message, LCD_WIDTH);
1834
     set_utf_strlen(lcd_status_message, LCD_WIDTH);
1835
     lcd_status_message_level = level;
1835
     lcd_status_message_level = level;
1836
     lcd_finishstatus(level > 0);
1836
     lcd_finishstatus(level > 0);
1886
       #if ENABLED(RIGIDBOT_PANEL)
1886
       #if ENABLED(RIGIDBOT_PANEL)
1887
         if (now > next_button_update_ms) {
1887
         if (now > next_button_update_ms) {
1888
           if (READ(BTN_UP) == 0) {
1888
           if (READ(BTN_UP) == 0) {
1889
-            encoderDiff = -1 * ENCODER_STEPS_PER_MENU_ITEM;
1889
+            encoderDiff = -1 * (ENCODER_STEPS_PER_MENU_ITEM);
1890
             next_button_update_ms = now + 300;
1890
             next_button_update_ms = now + 300;
1891
           }
1891
           }
1892
           else if (READ(BTN_DWN) == 0) {
1892
           else if (READ(BTN_DWN) == 0) {
1894
             next_button_update_ms = now + 300;
1894
             next_button_update_ms = now + 300;
1895
           }
1895
           }
1896
           else if (READ(BTN_LFT) == 0) {
1896
           else if (READ(BTN_LFT) == 0) {
1897
-            encoderDiff = -1 * ENCODER_PULSES_PER_STEP;
1897
+            encoderDiff = -1 * (ENCODER_PULSES_PER_STEP);
1898
             next_button_update_ms = now + 300;
1898
             next_button_update_ms = now + 300;
1899
           }
1899
           }
1900
           else if (READ(BTN_RT) == 0) {
1900
           else if (READ(BTN_RT) == 0) {
2244
   static void _lcd_level_bed() {
2244
   static void _lcd_level_bed() {
2245
     if ((encoderPosition != 0) && (movesplanned() <= 3)) {
2245
     if ((encoderPosition != 0) && (movesplanned() <= 3)) {
2246
       refresh_cmd_timeout();
2246
       refresh_cmd_timeout();
2247
-      current_position[Z_AXIS] += float((int)encoderPosition) * MBL_Z_STEP;
2247
+      current_position[Z_AXIS] += float((int)encoderPosition) * (MBL_Z_STEP);
2248
       if (min_software_endstops) NOLESS(current_position[Z_AXIS], Z_MIN_POS);
2248
       if (min_software_endstops) NOLESS(current_position[Z_AXIS], Z_MIN_POS);
2249
       if (max_software_endstops) NOMORE(current_position[Z_AXIS], Z_MAX_POS);
2249
       if (max_software_endstops) NOMORE(current_position[Z_AXIS], Z_MAX_POS);
2250
       encoderPosition = 0;
2250
       encoderPosition = 0;
2256
     if (LCD_CLICKED) {
2256
     if (LCD_CLICKED) {
2257
       if (!debounce_click) {
2257
       if (!debounce_click) {
2258
         debounce_click = true;
2258
         debounce_click = true;
2259
-        int ix = _lcd_level_bed_position % MESH_NUM_X_POINTS,
2260
-            iy = _lcd_level_bed_position / MESH_NUM_X_POINTS;
2259
+        int ix = _lcd_level_bed_position % (MESH_NUM_X_POINTS),
2260
+            iy = _lcd_level_bed_position / (MESH_NUM_X_POINTS);
2261
         if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // Zig zag
2261
         if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // Zig zag
2262
         mbl.set_z(ix, iy, current_position[Z_AXIS]);
2262
         mbl.set_z(ix, iy, current_position[Z_AXIS]);
2263
         _lcd_level_bed_position++;
2263
         _lcd_level_bed_position++;
2264
-        if (_lcd_level_bed_position == MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) {
2264
+        if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
2265
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2265
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2266
           line_to_current(Z_AXIS);
2266
           line_to_current(Z_AXIS);
2267
           mbl.active = 1;
2267
           mbl.active = 1;
2271
         else {
2271
         else {
2272
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2272
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2273
           line_to_current(Z_AXIS);
2273
           line_to_current(Z_AXIS);
2274
-          ix = _lcd_level_bed_position % MESH_NUM_X_POINTS;
2275
-          iy = _lcd_level_bed_position / MESH_NUM_X_POINTS;
2274
+          ix = _lcd_level_bed_position % (MESH_NUM_X_POINTS);
2275
+          iy = _lcd_level_bed_position / (MESH_NUM_X_POINTS);
2276
           if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // Zig zag
2276
           if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // Zig zag
2277
           current_position[X_AXIS] = mbl.get_x(ix);
2277
           current_position[X_AXIS] = mbl.get_x(ix);
2278
           current_position[Y_AXIS] = mbl.get_y(iy);
2278
           current_position[Y_AXIS] = mbl.get_y(iy);

+ 1
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h Vedi File

731
       // Draw the progress bar if the message has shown long enough
731
       // Draw the progress bar if the message has shown long enough
732
       // or if there is no message set.
732
       // or if there is no message set.
733
       if (millis() >= progress_bar_ms + PROGRESS_BAR_MSG_TIME || !lcd_status_message[0]) {
733
       if (millis() >= progress_bar_ms + PROGRESS_BAR_MSG_TIME || !lcd_status_message[0]) {
734
-        int tix = (int)(card.percentDone() * LCD_WIDTH * 3) / 100,
734
+        int tix = (int)(card.percentDone() * (LCD_WIDTH) * 3) / 100,
735
           cel = tix / 3, rem = tix % 3, i = LCD_WIDTH;
735
           cel = tix / 3, rem = tix % 3, i = LCD_WIDTH;
736
         char msg[LCD_WIDTH + 1], b = ' ';
736
         char msg[LCD_WIDTH + 1], b = ' ';
737
         msg[i] = '\0';
737
         msg[i] = '\0';

+ 1
- 1
Marlin/ultralcd_st7920_u8glib_rrd.h Vedi File

63
         ST7920_WRITE_BYTE(0x80 | y); //set y
63
         ST7920_WRITE_BYTE(0x80 | y); //set y
64
         ST7920_WRITE_BYTE(0x80);     //set x = 0
64
         ST7920_WRITE_BYTE(0x80);     //set x = 0
65
         ST7920_SET_DAT();
65
         ST7920_SET_DAT();
66
-        for (i = 0; i < 2 * LCD_PIXEL_WIDTH / 8; i++) //2x width clears both segments
66
+        for (i = 0; i < 2 * (LCD_PIXEL_WIDTH) / 8; i++) //2x width clears both segments
67
           ST7920_WRITE_BYTE(0);
67
           ST7920_WRITE_BYTE(0);
68
         ST7920_SET_CMD();
68
         ST7920_SET_CMD();
69
       }
69
       }

Loading…
Annulla
Salva