Browse Source

Wrap macros to prevent bad expansions

Scott Lahteine 8 years ago
parent
commit
f9ded2a7c4
32 changed files with 158 additions and 158 deletions
  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 View File

@@ -264,9 +264,9 @@
264 264
   /**
265 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 272
    * SCARA
@@ -285,8 +285,8 @@
285 285
     #define Z_HOME_POS MANUAL_Z_HOME_POS
286 286
   #else //!MANUAL_HOME_POSITIONS – Use home switch positions based on homing direction and travel limits
287 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 290
     #else
291 291
       #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
292 292
       #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
@@ -334,8 +334,8 @@
334 334
    * Advance calculated values
335 335
    */
336 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 339
   #endif
340 340
 
341 341
   #if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)

+ 2
- 2
Marlin/Configuration.h View File

@@ -422,9 +422,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
422 422
 
423 423
 #if ENABLED(MESH_BED_LEVELING)
424 424
   #define MESH_MIN_X 10
425
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
425
+  #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
426 426
   #define MESH_MIN_Y 10
427
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
427
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
428 428
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
429 429
   #define MESH_NUM_Y_POINTS 3
430 430
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.

+ 33
- 33
Marlin/Marlin_main.cpp View File

@@ -285,7 +285,7 @@ const int sensitive_pins[] = SENSITIVE_PINS; ///< Sensitive pin list for M42
285 285
 // Inactivity shutdown
286 286
 millis_t previous_cmd_ms = 0;
287 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 289
 millis_t print_job_start_ms = 0; ///< Print job start time
290 290
 millis_t print_job_stop_ms = 0;  ///< Print job stop time
291 291
 static uint8_t target_extruder;
@@ -1638,13 +1638,13 @@ static void setup_for_endstop_move() {
1638 1638
 
1639 1639
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1640 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 1643
         SERIAL_EOL;
1644 1644
       }
1645 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 1649
     #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY)
1650 1650
       if (probe_action & ProbeDeploy) {
@@ -2281,7 +2281,7 @@ inline void gcode_G28() {
2281 2281
     sync_plan_position();
2282 2282
 
2283 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 2285
     feedrate = 1.732 * homing_feedrate[X_AXIS];
2286 2286
     line_to_destination();
2287 2287
     st_synchronize();
@@ -2330,7 +2330,7 @@ inline void gcode_G28() {
2330 2330
         feedrate = max_feedrate[Z_AXIS] * 60;  // feedrate (mm/m) = max_feedrate (mm/s)
2331 2331
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2332 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 2334
             SERIAL_EOL;
2335 2335
             print_xyz("> (home_all_axis || homeZ) > current_position", current_position);
2336 2336
             print_xyz("> (home_all_axis || homeZ) > destination", destination);
@@ -2467,8 +2467,8 @@ inline void gcode_G28() {
2467 2467
             //
2468 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 2472
             destination[Z_AXIS] = current_position[Z_AXIS]; //z is already at the right height
2473 2473
             feedrate = XY_TRAVEL_SPEED;
2474 2474
 
@@ -2500,10 +2500,10 @@ inline void gcode_G28() {
2500 2500
               // Make sure the Z probe is within the physical limits
2501 2501
               // NOTE: This doesn't necessarily ensure the Z probe is also within the bed!
2502 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 2508
                 // Home the Z axis
2509 2509
                 HOMEAXIS(Z);
@@ -2669,8 +2669,8 @@ inline void gcode_G28() {
2669 2669
         }
2670 2670
         else {
2671 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 2674
           if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // zig-zag
2675 2675
           mbl.set_z(ix, iy, current_position[Z_AXIS]);
2676 2676
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
@@ -2678,9 +2678,9 @@ inline void gcode_G28() {
2678 2678
           st_synchronize();
2679 2679
         }
2680 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 2684
           if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // zig-zag
2685 2685
           current_position[X_AXIS] = mbl.get_x(ix);
2686 2686
           current_position[Y_AXIS] = mbl.get_y(iy);
@@ -2832,18 +2832,18 @@ inline void gcode_G28() {
2832 2832
           back_probe_bed_position = code_seen('B') ? code_value_short() : BACK_PROBE_BED_POSITION;
2833 2833
 
2834 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 2836
            right_out_r = right_probe_bed_position > MAX_PROBE_X,
2837 2837
            right_out = right_out_r || right_probe_bed_position < left_probe_bed_position + MIN_PROBE_EDGE,
2838 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 2840
            back_out_b = back_probe_bed_position > MAX_PROBE_Y,
2841 2841
            back_out = back_out_b || back_probe_bed_position < front_probe_bed_position + MIN_PROBE_EDGE;
2842 2842
 
2843 2843
       if (left_out || right_out || front_out || back_out) {
2844 2844
         if (left_out) {
2845 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 2848
         if (right_out) {
2849 2849
           out_of_range_error(PSTR("(R)ight"));
@@ -2851,7 +2851,7 @@ inline void gcode_G28() {
2851 2851
         }
2852 2852
         if (front_out) {
2853 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 2856
         if (back_out) {
2857 2857
           out_of_range_error(PSTR("(B)ack"));
@@ -3597,7 +3597,7 @@ inline void gcode_M42() {
3597 3597
     bool deploy_probe_for_each_reading = code_seen('E');
3598 3598
 
3599 3599
     if (code_seen('X')) {
3600
-      X_probe_location = code_value() - X_PROBE_OFFSET_FROM_EXTRUDER;
3600
+      X_probe_location = code_value() - (X_PROBE_OFFSET_FROM_EXTRUDER);
3601 3601
       if (X_probe_location < X_MIN_POS || X_probe_location > X_MAX_POS) {
3602 3602
         out_of_range_error(PSTR("X"));
3603 3603
         return;
@@ -3677,7 +3677,7 @@ inline void gcode_M42() {
3677 3677
 
3678 3678
       if (n_legs) {
3679 3679
         millis_t ms = millis();
3680
-        double radius = ms % (X_MAX_LENGTH / 4),       // limit how far out to go
3680
+        double radius = ms % ((X_MAX_LENGTH) / 4),       // limit how far out to go
3681 3681
                theta = RADIANS(ms % 360L);
3682 3682
         float dir = (ms & 0x0001) ? 1 : -1;            // clockwise or counter clockwise
3683 3683
 
@@ -3832,7 +3832,7 @@ inline void gcode_M104() {
3832 3832
     #if HAS_TEMP_BED
3833 3833
       SERIAL_PROTOCOLPGM(" B@:");
3834 3834
       #ifdef BED_WATTS
3835
-        SERIAL_PROTOCOL((BED_WATTS * getHeaterPower(-1)) / 127);
3835
+        SERIAL_PROTOCOL(((BED_WATTS) * getHeaterPower(-1)) / 127);
3836 3836
         SERIAL_PROTOCOLCHAR('W');
3837 3837
       #else
3838 3838
         SERIAL_PROTOCOL(getHeaterPower(-1));
@@ -3840,7 +3840,7 @@ inline void gcode_M104() {
3840 3840
     #endif
3841 3841
     SERIAL_PROTOCOLPGM(" @:");
3842 3842
     #ifdef EXTRUDER_WATTS
3843
-      SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(target_extruder)) / 127);
3843
+      SERIAL_PROTOCOL(((EXTRUDER_WATTS) * getHeaterPower(target_extruder)) / 127);
3844 3844
       SERIAL_PROTOCOLCHAR('W');
3845 3845
     #else
3846 3846
       SERIAL_PROTOCOL(getHeaterPower(target_extruder));
@@ -3851,7 +3851,7 @@ inline void gcode_M104() {
3851 3851
         SERIAL_PROTOCOL(e);
3852 3852
         SERIAL_PROTOCOLCHAR(':');
3853 3853
         #ifdef EXTRUDER_WATTS
3854
-          SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(e)) / 127);
3854
+          SERIAL_PROTOCOL(((EXTRUDER_WATTS) * getHeaterPower(e)) / 127);
3855 3855
           SERIAL_PROTOCOLCHAR('W');
3856 3856
         #else
3857 3857
           SERIAL_PROTOCOL(getHeaterPower(e));
@@ -3943,7 +3943,7 @@ inline void gcode_M109() {
3943 3943
   #ifdef TEMP_RESIDENCY_TIME
3944 3944
     long residency_start_ms = -1;
3945 3945
     // Loop until the temperature has stabilized
3946
-    #define TEMP_CONDITIONS (residency_start_ms < 0 || now < residency_start_ms + TEMP_RESIDENCY_TIME * 1000UL)
3946
+    #define TEMP_CONDITIONS (residency_start_ms < 0 || now < residency_start_ms + (TEMP_RESIDENCY_TIME) * 1000UL)
3947 3947
   #else
3948 3948
     // Loop until the temperature is very close target
3949 3949
     #define TEMP_CONDITIONS (fabs(degHotend(target_extruder) - degTargetHotend(target_extruder)) < 0.75f)
@@ -3961,7 +3961,7 @@ inline void gcode_M109() {
3961 3961
       #ifdef TEMP_RESIDENCY_TIME
3962 3962
         SERIAL_PROTOCOLPGM(" W:");
3963 3963
         if (residency_start_ms >= 0) {
3964
-          long rem = ((TEMP_RESIDENCY_TIME * 1000UL) - (now - residency_start_ms)) / 1000UL;
3964
+          long rem = (((TEMP_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL;
3965 3965
           SERIAL_PROTOCOLLN(rem);
3966 3966
         }
3967 3967
         else {
@@ -5533,7 +5533,7 @@ inline void gcode_M907() {
5533 5533
     // this one uses actual amps in floating point
5534 5534
     for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) digipot_i2c_set_current(i, code_value());
5535 5535
     // for each additional extruder (named B,C,D,E..., channels 4,5,6,7...)
5536
-    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());
5536
+    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());
5537 5537
   #endif
5538 5538
 }
5539 5539
 
@@ -6821,7 +6821,7 @@ void plan_arc(
6821 6821
       ) {
6822 6822
         lastMotor = ms; //... set time to NOW so the fan will turn on
6823 6823
       }
6824
-      uint8_t speed = (lastMotor == 0 || ms >= lastMotor + (CONTROLLERFAN_SECS * 1000UL)) ? 0 : CONTROLLERFAN_SPEED;
6824
+      uint8_t speed = (lastMotor == 0 || ms >= lastMotor + ((CONTROLLERFAN_SECS) * 1000UL)) ? 0 : CONTROLLERFAN_SPEED;
6825 6825
       // allows digital or PWM fan output to be used (see M42 handling)
6826 6826
       digitalWrite(CONTROLLERFAN_PIN, speed);
6827 6827
       analogWrite(CONTROLLERFAN_PIN, speed);
@@ -7054,7 +7054,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
7054 7054
   #endif
7055 7055
 
7056 7056
   #if ENABLED(EXTRUDER_RUNOUT_PREVENT)
7057
-    if (ms > previous_cmd_ms + EXTRUDER_RUNOUT_SECONDS * 1000)
7057
+    if (ms > previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000)
7058 7058
       if (degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) {
7059 7059
         bool oldstatus;
7060 7060
         switch (active_extruder) {
@@ -7083,8 +7083,8 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
7083 7083
         }
7084 7084
         float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS];
7085 7085
         plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS],
7086
-                         destination[E_AXIS] + EXTRUDER_RUNOUT_EXTRUDE * EXTRUDER_RUNOUT_ESTEPS / axis_steps_per_unit[E_AXIS],
7087
-                         EXTRUDER_RUNOUT_SPEED / 60. * EXTRUDER_RUNOUT_ESTEPS / axis_steps_per_unit[E_AXIS], active_extruder);
7086
+                         destination[E_AXIS] + (EXTRUDER_RUNOUT_EXTRUDE) * (EXTRUDER_RUNOUT_ESTEPS) / axis_steps_per_unit[E_AXIS],
7087
+                         (EXTRUDER_RUNOUT_SPEED) / 60. * (EXTRUDER_RUNOUT_ESTEPS) / axis_steps_per_unit[E_AXIS], active_extruder);
7088 7088
       current_position[E_AXIS] = oldepos;
7089 7089
       destination[E_AXIS] = oldedes;
7090 7090
       plan_set_e_position(oldepos);

+ 1
- 1
Marlin/SdBaseFile.cpp View File

@@ -1134,7 +1134,7 @@ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) {
1134 1134
       // Sanity-check the VFAT entry. The first cluster is always set to zero. And the sequence number should be higher than 0
1135 1135
       if (VFAT->firstClusterLow == 0 && (VFAT->sequenceNumber & 0x1F) > 0 && (VFAT->sequenceNumber & 0x1F) <= MAX_VFAT_ENTRIES) {
1136 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 1138
         for (uint8_t i = 0; i < FILENAME_LENGTH; i++)
1139 1139
           longFilename[n + i] = (i < 5) ? VFAT->name1[i] : (i < 11) ? VFAT->name2[i - 5] : VFAT->name3[i - 11];
1140 1140
         // If this VFAT entry is the last one, add a NUL terminator at the end of the string

+ 2
- 2
Marlin/cardreader.cpp View File

@@ -264,7 +264,7 @@ void CardReader::getAbsFilename(char *t) {
264 264
     workDirParents[i].getFilename(t); //SDBaseFile.getfilename!
265 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 268
     file.getFilename(t);
269 269
   else
270 270
     t[0] = 0;
@@ -500,7 +500,7 @@ void CardReader::checkautostart(bool force) {
500 500
   while (root.readDir(p, NULL) > 0) {
501 501
     for (int8_t i = 0; i < (int8_t)strlen((char*)p.name); i++) p.name[i] = tolower(p.name[i]);
502 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 504
       sprintf_P(cmd, PSTR("M23 %s"), autoname);
505 505
       enqueuecommand(cmd);
506 506
       enqueuecommands_P(PSTR("M24"));

+ 1
- 1
Marlin/configuration_store.cpp View File

@@ -163,7 +163,7 @@ void Config_StoreSettings()  {
163 163
   uint8_t mesh_num_y = 3;
164 164
   #if ENABLED(MESH_BED_LEVELING)
165 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 167
     mesh_num_x = MESH_NUM_X_POINTS;
168 168
     mesh_num_y = MESH_NUM_Y_POINTS;
169 169
     EEPROM_WRITE_VAR(i, mbl.active);

+ 17
- 17
Marlin/dogm_lcd_implementation.h View File

@@ -225,14 +225,14 @@ static void lcd_implementation_init() {
225 225
   #endif
226 226
 
227 227
   #if ENABLED(SHOW_BOOTSCREEN)
228
-    int offx = (u8g.getWidth() - START_BMPWIDTH) / 2;
228
+    int offx = (u8g.getWidth() - (START_BMPWIDTH)) / 2;
229 229
     #if ENABLED(START_BMPHIGH)
230 230
       int offy = 0;
231 231
     #else
232 232
       int offy = DOG_CHAR_HEIGHT;
233 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 237
     u8g.firstPage();
238 238
     do {
@@ -240,11 +240,11 @@ static void lcd_implementation_init() {
240 240
         u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
241 241
         lcd_setFont(FONT_MENU);
242 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 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 248
         #endif
249 249
       }
250 250
     } while (u8g.nextPage());
@@ -288,20 +288,20 @@ static void lcd_implementation_status_screen() {
288 288
 
289 289
   #if ENABLED(SDSUPPORT)
290 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 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 299
     // SD Card Progress bar and clock
300 300
     lcd_setFont(FONT_STATUSMENU);
301 301
 
302 302
     if (IS_SD_PRINTING) {
303 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 307
     u8g.setPrintPos(80,48);
@@ -443,13 +443,13 @@ static void lcd_implementation_status_screen() {
443 443
 static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
444 444
   if (isSelected) {
445 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 447
     u8g.setColorIndex(0);  // following text must be white on black
448 448
   }
449 449
   else {
450 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 455
 static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) {
@@ -463,7 +463,7 @@ static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, co
463 463
     pstr++;
464 464
   }
465 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 467
   lcd_print(post_char);
468 468
   lcd_print(' ');
469 469
 }
@@ -481,7 +481,7 @@ static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const c
481 481
   }
482 482
   lcd_print(':');
483 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 485
   if (pgm)  lcd_printPGM(data);  else  lcd_print((char*)data);
486 486
 }
487 487
 
@@ -528,7 +528,7 @@ void lcd_implementation_drawedit(const char* pstr, char* value) {
528 528
 
529 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 532
   float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3
533 533
 
534 534
   u8g.setPrintPos(0, rowHeight + kHalfChar);

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

@@ -404,10 +404,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
404 404
 
405 405
 #if ENABLED(MESH_BED_LEVELING)
406 406
   #define MESH_MIN_X 10
407
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
407
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
408 408
   #define MESH_MIN_Y 10
409
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
410
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
409
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
410
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
411 411
   #define MESH_NUM_Y_POINTS 3
412 412
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
413 413
 

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

@@ -401,10 +401,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
401 401
 
402 402
 #if ENABLED(MESH_BED_LEVELING)
403 403
   #define MESH_MIN_X 10
404
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
404
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
405 405
   #define MESH_MIN_Y 10
406
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
407
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
406
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
407
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
408 408
   #define MESH_NUM_Y_POINTS 3
409 409
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
410 410
 

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

@@ -414,10 +414,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
414 414
 
415 415
 #if ENABLED(MESH_BED_LEVELING)
416 416
   #define MESH_MIN_X 10
417
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
417
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
418 418
   #define MESH_MIN_Y 10
419
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
420
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
419
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
420
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
421 421
   #define MESH_NUM_Y_POINTS 3
422 422
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
423 423
 

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

@@ -417,10 +417,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
417 417
 
418 418
 #if ENABLED(MESH_BED_LEVELING)
419 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 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 424
   #define MESH_NUM_Y_POINTS 3
425 425
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
426 426
 

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

@@ -437,10 +437,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
437 437
 
438 438
 #if ENABLED(MESH_BED_LEVELING)
439 439
   #define MESH_MIN_X 10
440
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
440
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
441 441
   #define MESH_MIN_Y 10
442
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
443
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
442
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
443
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
444 444
   #define MESH_NUM_Y_POINTS 3
445 445
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
446 446
 

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

@@ -422,10 +422,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
422 422
 
423 423
 #if ENABLED(MESH_BED_LEVELING)
424 424
   #define MESH_MIN_X 10
425
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
425
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
426 426
   #define MESH_MIN_Y 10
427
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
428
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
427
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
428
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
429 429
   #define MESH_NUM_Y_POINTS 3
430 430
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
431 431
 

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

@@ -416,10 +416,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
416 416
 
417 417
 #if ENABLED(MESH_BED_LEVELING)
418 418
   #define MESH_MIN_X 10
419
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
419
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
420 420
   #define MESH_MIN_Y 10
421
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
422
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
421
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
422
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
423 423
   #define MESH_NUM_Y_POINTS 3
424 424
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
425 425
 

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

@@ -430,10 +430,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
430 430
 
431 431
 #if ENABLED(MESH_BED_LEVELING)
432 432
   #define MESH_MIN_X 10
433
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
433
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
434 434
   #define MESH_MIN_Y 10
435
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
436
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
435
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
436
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
437 437
   #define MESH_NUM_Y_POINTS 3
438 438
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
439 439
 

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

@@ -442,10 +442,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
442 442
 
443 443
 #if ENABLED(MESH_BED_LEVELING)
444 444
   #define MESH_MIN_X 10
445
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
445
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
446 446
   #define MESH_MIN_Y 10
447
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
448
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
447
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
448
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
449 449
   #define MESH_NUM_Y_POINTS 3
450 450
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
451 451
 

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

@@ -414,10 +414,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
414 414
 
415 415
 #if ENABLED(MESH_BED_LEVELING)
416 416
   #define MESH_MIN_X 10
417
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
417
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
418 418
   #define MESH_MIN_Y 10
419
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
420
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
419
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
420
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
421 421
   #define MESH_NUM_Y_POINTS 3
422 422
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
423 423
 

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

@@ -422,9 +422,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
422 422
 
423 423
 #if ENABLED(MESH_BED_LEVELING)
424 424
   #define MESH_MIN_X 10
425
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
425
+  #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
426 426
   #define MESH_MIN_Y 10
427
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
427
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
428 428
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
429 429
   #define MESH_NUM_Y_POINTS 3
430 430
   #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 View File

@@ -457,9 +457,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
457 457
 
458 458
 #if ENABLED(MESH_BED_LEVELING)
459 459
   #define MESH_MIN_X 10
460
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
460
+  #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
461 461
   #define MESH_MIN_Y 10
462
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
462
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
463 463
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
464 464
   #define MESH_NUM_Y_POINTS 3
465 465
   #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 View File

@@ -457,9 +457,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
457 457
 
458 458
 #if ENABLED(MESH_BED_LEVELING)
459 459
   #define MESH_MIN_X 10
460
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
460
+  #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
461 461
   #define MESH_MIN_Y 10
462
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
462
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
463 463
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
464 464
   #define MESH_NUM_Y_POINTS 3
465 465
   #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 View File

@@ -457,9 +457,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
457 457
 
458 458
 #if ENABLED(MESH_BED_LEVELING)
459 459
   #define MESH_MIN_X 10
460
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
460
+  #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
461 461
   #define MESH_MIN_Y 10
462
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
462
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
463 463
   #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
464 464
   #define MESH_NUM_Y_POINTS 3
465 465
   #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 View File

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

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

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

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

@@ -425,10 +425,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
425 425
 
426 426
 #if ENABLED(MESH_BED_LEVELING)
427 427
   #define MESH_MIN_X 10
428
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
428
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
429 429
   #define MESH_MIN_Y 10
430
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
431
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
430
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
431
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
432 432
   #define MESH_NUM_Y_POINTS 3
433 433
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
434 434
 

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

@@ -412,10 +412,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
412 412
 
413 413
 #if ENABLED(MESH_BED_LEVELING)
414 414
   #define MESH_MIN_X 10
415
-  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
415
+    #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X))
416 416
   #define MESH_MIN_Y 10
417
-  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
418
-  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
417
+  #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y))
418
+#define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited.
419 419
   #define MESH_NUM_Y_POINTS 3
420 420
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
421 421
 

+ 2
- 2
Marlin/mesh_bed_leveling.h View File

@@ -2,8 +2,8 @@
2 2
 
3 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 8
   class mesh_bed_leveling {
9 9
   public:

+ 10
- 10
Marlin/planner.cpp View File

@@ -447,7 +447,7 @@ void check_axes_activity() {
447 447
       }
448 448
     #endif //FAN_KICKSTART_TIME
449 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 451
     #else
452 452
       #define CALC_FAN_SPEED tail_fan_speed
453 453
     #endif // FAN_MIN_PWM
@@ -524,7 +524,7 @@ float junction_deviation = 0.1;
524 524
         SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
525 525
       }
526 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 528
           position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
529 529
           de = 0; // no difference
530 530
           SERIAL_ECHO_START;
@@ -634,10 +634,10 @@ float junction_deviation = 0.1;
634 634
           #if ENABLED(DUAL_X_CARRIAGE)
635 635
             if (extruder_duplication_enabled) {
636 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 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 641
           #if EXTRUDERS > 1
642 642
             if (g_uc_extruder_last_move[1] == 0) disable_e1();
643 643
             #if EXTRUDERS > 2
@@ -651,7 +651,7 @@ float junction_deviation = 0.1;
651 651
         #if EXTRUDERS > 1
652 652
           case 1:
653 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 655
             if (g_uc_extruder_last_move[0] == 0) disable_e0();
656 656
             #if EXTRUDERS > 2
657 657
               if (g_uc_extruder_last_move[2] == 0) disable_e2();
@@ -663,7 +663,7 @@ float junction_deviation = 0.1;
663 663
           #if EXTRUDERS > 2
664 664
             case 2:
665 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 667
               if (g_uc_extruder_last_move[0] == 0) disable_e0();
668 668
               if (g_uc_extruder_last_move[1] == 0) disable_e1();
669 669
               #if EXTRUDERS > 3
@@ -673,7 +673,7 @@ float junction_deviation = 0.1;
673 673
             #if EXTRUDERS > 3
674 674
               case 3:
675 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 677
                 if (g_uc_extruder_last_move[0] == 0) disable_e0();
678 678
                 if (g_uc_extruder_last_move[1] == 0) disable_e1();
679 679
                 if (g_uc_extruder_last_move[2] == 0) disable_e2();
@@ -749,9 +749,9 @@ float junction_deviation = 0.1;
749 749
 
750 750
   // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
751 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 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 755
     #endif
756 756
     #if ENABLED(SLOWDOWN)
757 757
       //  segment time im micro seconds
@@ -974,7 +974,7 @@ float junction_deviation = 0.1;
974 974
     }
975 975
     else {
976 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 978
       block->advance = advance;
979 979
       block->advance_rate = acc_dist ? advance / (float)acc_dist : 0;
980 980
     }

+ 1
- 1
Marlin/servo.cpp View File

@@ -281,7 +281,7 @@ void Servo::writeMicroseconds(int value) {
281 281
   byte channel = this->servoIndex;
282 282
   if (channel < MAX_SERVOS) {  // ensure channel is valid
283 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 285
     value = usToTicks(value);  // convert to ticks after compensating for interrupt overhead - 12 Aug 2009
286 286
 
287 287
     CRITICAL_SECTION_START;

+ 13
- 13
Marlin/temperature.cpp View File

@@ -139,8 +139,8 @@ static unsigned char soft_pwm[EXTRUDERS];
139 139
 #if ENABLED(PIDTEMP)
140 140
   #if ENABLED(PID_PARAMS_PER_EXTRUDER)
141 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 144
     #if ENABLED(PID_ADD_EXTRUSION_RATE)
145 145
       float Kc[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_Kc);
146 146
     #endif // PID_ADD_EXTRUSION_RATE
@@ -230,9 +230,9 @@ void PID_autotune(float temp, int extruder, int ncycles) {
230 230
   disable_all_heaters(); // switch off all heaters.
231 231
 
232 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 234
   else
235
-    soft_pwm[extruder] = bias = d = PID_MAX / 2;
235
+    soft_pwm[extruder] = bias = d = (PID_MAX) / 2;
236 236
 
237 237
   // PID Tuning loop
238 238
   for (;;) {
@@ -355,14 +355,14 @@ void PID_autotune(float temp, int extruder, int ncycles) {
355 355
 void updatePID() {
356 356
   #if ENABLED(PIDTEMP)
357 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 359
       #if ENABLED(PID_ADD_EXTRUSION_RATE)
360 360
         last_position[e] = 0;
361 361
       #endif
362 362
     }
363 363
   #endif
364 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 366
   #endif
367 367
 }
368 368
 
@@ -481,7 +481,7 @@ float get_pid_output(int e) {
481 481
         pid_output = BANG_MAX;
482 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 485
         pid_output = 0;
486 486
         pid_reset[e] = true;
487 487
       }
@@ -698,7 +698,7 @@ void manage_heater() {
698 698
       if (current_temperature_bed > BED_MINTEMP && current_temperature_bed < BED_MAXTEMP) {
699 699
         if (current_temperature_bed >= target_temperature_bed + BED_HYSTERESIS)
700 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 702
           soft_pwm_bed = MAX_BED_POWER >> 1;
703 703
       }
704 704
       else {
@@ -759,7 +759,7 @@ static float analog2temp(int raw, uint8_t e) {
759 759
 
760 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 765
 // Derived from RepRap FiveD extruder::getTemperature()
@@ -786,7 +786,7 @@ static float analog2tempBed(int raw) {
786 786
 
787 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 791
   #else
792 792
 
@@ -860,14 +860,14 @@ void tp_init() {
860 860
     maxttemp[e] = maxttemp[0];
861 861
     #if ENABLED(PIDTEMP)
862 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 864
       #if ENABLED(PID_ADD_EXTRUSION_RATE)
865 865
         last_position[e] = 0;
866 866
       #endif
867 867
     #endif //PIDTEMP
868 868
     #if ENABLED(PIDTEMPBED)
869 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 871
     #endif //PIDTEMPBED
872 872
   }
873 873
 
@@ -1042,7 +1042,7 @@ void tp_init() {
1042 1042
   void start_watching_heater(int e) {
1043 1043
     if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) {
1044 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 1047
     else
1048 1048
       watch_heater_next_ms[e] = 0;

+ 15
- 15
Marlin/ultralcd.cpp View File

@@ -28,7 +28,7 @@ int absPreheatFanSpeed;
28 28
 typedef void (*menuFunc_t)();
29 29
 
30 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 33
 #if ENABLED(DOGLCD)
34 34
   #include "dogm_lcd_implementation.h"
@@ -209,8 +209,8 @@ static void lcd_status_screen();
209 209
     #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
210 210
   #endif //!ENCODER_RATE_MULTIPLIER
211 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 214
       } } while(0)
215 215
 
216 216
   /** Used variables to keep track of the menu */
@@ -352,7 +352,7 @@ static void lcd_status_screen() {
352 352
       }
353 353
       if (feedrate_multiplier == 100) {
354 354
         if (int(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) {
355
-          feedrate_multiplier += int(encoderPosition) - ENCODER_FEEDRATE_DEADZONE;
355
+          feedrate_multiplier += int(encoderPosition) - (ENCODER_FEEDRATE_DEADZONE);
356 356
           encoderPosition = 0;
357 357
         }
358 358
         else if (int(encoderPosition) < -ENCODER_FEEDRATE_DEADZONE) {
@@ -841,7 +841,7 @@ static void _lcd_move(const char* name, AxisEnum axis, int min, int max) {
841 841
   }
842 842
 }
843 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 845
   static int delta_clip( float a ) { return sqrt(delta_clip_radius_2 - a*a); }
846 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 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)); }
@@ -1824,14 +1824,14 @@ bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); }
1824 1824
 
1825 1825
 void lcd_setstatus(const char* message, bool persist) {
1826 1826
   if (lcd_status_message_level > 0) return;
1827
-  strncpy(lcd_status_message, message, 3 * LCD_WIDTH);
1827
+  strncpy(lcd_status_message, message, 3 * (LCD_WIDTH));
1828 1828
   set_utf_strlen(lcd_status_message, LCD_WIDTH);
1829 1829
   lcd_finishstatus(persist);
1830 1830
 }
1831 1831
 
1832 1832
 void lcd_setstatuspgm(const char* message, uint8_t level) {
1833 1833
   if (level >= lcd_status_message_level) {
1834
-    strncpy_P(lcd_status_message, message, 3 * LCD_WIDTH);
1834
+    strncpy_P(lcd_status_message, message, 3 * (LCD_WIDTH));
1835 1835
     set_utf_strlen(lcd_status_message, LCD_WIDTH);
1836 1836
     lcd_status_message_level = level;
1837 1837
     lcd_finishstatus(level > 0);
@@ -1887,7 +1887,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
1887 1887
       #if ENABLED(RIGIDBOT_PANEL)
1888 1888
         if (now > next_button_update_ms) {
1889 1889
           if (READ(BTN_UP) == 0) {
1890
-            encoderDiff = -1 * ENCODER_STEPS_PER_MENU_ITEM;
1890
+            encoderDiff = -1 * (ENCODER_STEPS_PER_MENU_ITEM);
1891 1891
             next_button_update_ms = now + 300;
1892 1892
           }
1893 1893
           else if (READ(BTN_DWN) == 0) {
@@ -1895,7 +1895,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
1895 1895
             next_button_update_ms = now + 300;
1896 1896
           }
1897 1897
           else if (READ(BTN_LFT) == 0) {
1898
-            encoderDiff = -1 * ENCODER_PULSES_PER_STEP;
1898
+            encoderDiff = -1 * (ENCODER_PULSES_PER_STEP);
1899 1899
             next_button_update_ms = now + 300;
1900 1900
           }
1901 1901
           else if (READ(BTN_RT) == 0) {
@@ -2245,7 +2245,7 @@ char* ftostr52(const float& x) {
2245 2245
   static void _lcd_level_bed() {
2246 2246
     if (encoderPosition != 0) {
2247 2247
       refresh_cmd_timeout();
2248
-      current_position[Z_AXIS] += float((int)encoderPosition) * MBL_Z_STEP;
2248
+      current_position[Z_AXIS] += float((int)encoderPosition) * (MBL_Z_STEP);
2249 2249
       if (min_software_endstops) NOLESS(current_position[Z_AXIS], Z_MIN_POS);
2250 2250
       if (max_software_endstops) NOMORE(current_position[Z_AXIS], Z_MAX_POS);
2251 2251
       encoderPosition = 0;
@@ -2257,12 +2257,12 @@ char* ftostr52(const float& x) {
2257 2257
     if (LCD_CLICKED) {
2258 2258
       if (!debounce_click) {
2259 2259
         debounce_click = true;
2260
-        int ix = _lcd_level_bed_position % MESH_NUM_X_POINTS,
2261
-            iy = _lcd_level_bed_position / MESH_NUM_X_POINTS;
2260
+        int ix = _lcd_level_bed_position % (MESH_NUM_X_POINTS),
2261
+            iy = _lcd_level_bed_position / (MESH_NUM_X_POINTS);
2262 2262
         if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // Zig zag
2263 2263
         mbl.set_z(ix, iy, current_position[Z_AXIS]);
2264 2264
         _lcd_level_bed_position++;
2265
-        if (_lcd_level_bed_position == MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) {
2265
+        if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
2266 2266
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2267 2267
           line_to_current(Z_AXIS);
2268 2268
           mbl.active = 1;
@@ -2272,8 +2272,8 @@ char* ftostr52(const float& x) {
2272 2272
         else {
2273 2273
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2274 2274
           line_to_current(Z_AXIS);
2275
-          ix = _lcd_level_bed_position % MESH_NUM_X_POINTS;
2276
-          iy = _lcd_level_bed_position / MESH_NUM_X_POINTS;
2275
+          ix = _lcd_level_bed_position % (MESH_NUM_X_POINTS);
2276
+          iy = _lcd_level_bed_position / (MESH_NUM_X_POINTS);
2277 2277
           if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // Zig zag
2278 2278
           current_position[X_AXIS] = mbl.get_x(ix);
2279 2279
           current_position[Y_AXIS] = mbl.get_y(iy);

+ 1
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -731,7 +731,7 @@ static void lcd_implementation_status_screen() {
731 731
       // Draw the progress bar if the message has shown long enough
732 732
       // or if there is no message set.
733 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 735
           cel = tix / 3, rem = tix % 3, i = LCD_WIDTH;
736 736
         char msg[LCD_WIDTH + 1], b = ' ';
737 737
         msg[i] = '\0';

+ 1
- 1
Marlin/ultralcd_st7920_u8glib_rrd.h View File

@@ -63,7 +63,7 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo
63 63
         ST7920_WRITE_BYTE(0x80 | y); //set y
64 64
         ST7920_WRITE_BYTE(0x80);     //set x = 0
65 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 67
           ST7920_WRITE_BYTE(0);
68 68
         ST7920_SET_CMD();
69 69
       }

Loading…
Cancel
Save