Browse Source

Additional wrapping for #3140

Scott Lahteine 8 years ago
parent
commit
6e1bc03d3b

+ 1
- 1
Marlin/Marlin_main.cpp View File

@@ -6699,7 +6699,7 @@ void plan_arc(
6699 6699
 
6700 6700
   float mm_of_travel = hypot(angular_travel * radius, fabs(linear_travel));
6701 6701
   if (mm_of_travel < 0.001)  return;
6702
-  uint16_t segments = floor(mm_of_travel / MM_PER_ARC_SEGMENT);
6702
+  uint16_t segments = floor(mm_of_travel / (MM_PER_ARC_SEGMENT));
6703 6703
   if (segments == 0) segments = 1;
6704 6704
 
6705 6705
   float theta_per_segment = angular_travel / segments;

+ 2
- 2
Marlin/mesh_bed_leveling.h View File

@@ -14,8 +14,8 @@
14 14
 
15 15
     void reset();
16 16
 
17
-    float get_x(int i) { return MESH_MIN_X + MESH_X_DIST * i; }
18
-    float get_y(int i) { return MESH_MIN_Y + MESH_Y_DIST * i; }
17
+    float get_x(int i) { return MESH_MIN_X + (MESH_X_DIST) * i; }
18
+    float get_y(int i) { return MESH_MIN_Y + (MESH_Y_DIST) * i; }
19 19
     void set_z(int ix, int iy, float z) { z_values[iy][ix] = z; }
20 20
 
21 21
     int select_x_index(float x) {

+ 4
- 4
Marlin/planner.cpp View File

@@ -331,7 +331,7 @@ void planner_recalculate_trapezoids() {
331 331
   // Last/newest block in buffer. Exit speed is set with MINIMUM_PLANNER_SPEED. Always recalculated.
332 332
   if (next) {
333 333
     float nom = next->nominal_speed;
334
-    calculate_trapezoid_for_block(next, next->entry_speed / nom, MINIMUM_PLANNER_SPEED / nom);
334
+    calculate_trapezoid_for_block(next, next->entry_speed / nom, (MINIMUM_PLANNER_SPEED) / nom);
335 335
     next->recalculate_flag = false;
336 336
   }
337 337
 }
@@ -389,8 +389,8 @@ void plan_init() {
389 389
     float t = autotemp_min + high * autotemp_factor;
390 390
     t = constrain(t, autotemp_min, autotemp_max);
391 391
     if (oldt > t) {
392
-      t *= (1 - AUTOTEMP_OLDWEIGHT);
393
-      t += AUTOTEMP_OLDWEIGHT * oldt;
392
+      t *= (1 - (AUTOTEMP_OLDWEIGHT));
393
+      t += (AUTOTEMP_OLDWEIGHT) * oldt;
394 394
     }
395 395
     oldt = t;
396 396
     setTargetHotend0(t);
@@ -839,7 +839,7 @@ float junction_deviation = 0.1;
839 839
          max_y_segment_time = max(ys0, max(ys1, ys2)),
840 840
          min_xy_segment_time = min(max_x_segment_time, max_y_segment_time);
841 841
     if (min_xy_segment_time < MAX_FREQ_TIME) {
842
-      float low_sf = speed_factor * min_xy_segment_time / MAX_FREQ_TIME;
842
+      float low_sf = speed_factor * min_xy_segment_time / (MAX_FREQ_TIME);
843 843
       speed_factor = min(speed_factor, low_sf);
844 844
     }
845 845
   #endif // XY_FREQUENCY_LIMIT

+ 4
- 4
Marlin/servo.cpp View File

@@ -57,7 +57,7 @@
57 57
 
58 58
 #define TRIM_DURATION       2                               // compensation ticks to trim adjust for digitalWrite delays // 12 August 2009
59 59
 
60
-//#define NBR_TIMERS        (MAX_SERVOS / SERVOS_PER_TIMER)
60
+//#define NBR_TIMERS        ((MAX_SERVOS) / (SERVOS_PER_TIMER))
61 61
 
62 62
 static ServoInfo_t servo_info[MAX_SERVOS];                  // static array of servo info structures
63 63
 static volatile int8_t Channel[_Nbr_16timers ];             // counter for the servo being pulsed for each timer (or -1 if refresh interval)
@@ -66,9 +66,9 @@ uint8_t ServoCount = 0;                                     // the total number
66 66
 
67 67
 
68 68
 // convenience macros
69
-#define SERVO_INDEX_TO_TIMER(_servo_nbr) ((timer16_Sequence_t)(_servo_nbr / SERVOS_PER_TIMER)) // returns the timer controlling this servo
70
-#define SERVO_INDEX_TO_CHANNEL(_servo_nbr) (_servo_nbr % SERVOS_PER_TIMER)       // returns the index of the servo on this timer
71
-#define SERVO_INDEX(_timer,_channel)  ((_timer*SERVOS_PER_TIMER) + _channel)     // macro to access servo index by timer and channel
69
+#define SERVO_INDEX_TO_TIMER(_servo_nbr) ((timer16_Sequence_t)(_servo_nbr / (SERVOS_PER_TIMER))) // returns the timer controlling this servo
70
+#define SERVO_INDEX_TO_CHANNEL(_servo_nbr) (_servo_nbr % (SERVOS_PER_TIMER))       // returns the index of the servo on this timer
71
+#define SERVO_INDEX(_timer,_channel)  ((_timer*(SERVOS_PER_TIMER)) + _channel)     // macro to access servo index by timer and channel
72 72
 #define SERVO(_timer,_channel)  (servo_info[SERVO_INDEX(_timer,_channel)])       // macro to access servo class by timer and channel
73 73
 
74 74
 #define SERVO_MIN() (MIN_PULSE_WIDTH - this->min * 4)  // minimum value in uS for this servo

+ 3
- 3
Marlin/stepper.cpp View File

@@ -1220,9 +1220,9 @@ void digipot_current(uint8_t driver, int current) {
1220 1220
     digitalPotWrite(digipot_ch[driver], current);
1221 1221
   #elif defined(MOTOR_CURRENT_PWM_XY_PIN)
1222 1222
     switch (driver) {
1223
-      case 0: analogWrite(MOTOR_CURRENT_PWM_XY_PIN, 255L * current / MOTOR_CURRENT_PWM_RANGE); break;
1224
-      case 1: analogWrite(MOTOR_CURRENT_PWM_Z_PIN, 255L * current / MOTOR_CURRENT_PWM_RANGE); break;
1225
-      case 2: analogWrite(MOTOR_CURRENT_PWM_E_PIN, 255L * current / MOTOR_CURRENT_PWM_RANGE); break;
1223
+      case 0: analogWrite(MOTOR_CURRENT_PWM_XY_PIN, 255L * current / (MOTOR_CURRENT_PWM_RANGE)); break;
1224
+      case 1: analogWrite(MOTOR_CURRENT_PWM_Z_PIN, 255L * current / (MOTOR_CURRENT_PWM_RANGE)); break;
1225
+      case 2: analogWrite(MOTOR_CURRENT_PWM_E_PIN, 255L * current / (MOTOR_CURRENT_PWM_RANGE)); break;
1226 1226
     }
1227 1227
   #else
1228 1228
     UNUSED(driver);

+ 1
- 1
Marlin/ultralcd.cpp View File

@@ -465,7 +465,7 @@ void lcd_set_home_offsets() {
465 465
 
466 466
   static void _lcd_babystep(int axis, const char* msg) {
467 467
     if (encoderPosition != 0) {
468
-      babystepsTodo[axis] += BABYSTEP_MULTIPLICATOR * (int)encoderPosition;
468
+      babystepsTodo[axis] += (BABYSTEP_MULTIPLICATOR) * (int)encoderPosition;
469 469
       encoderPosition = 0;
470 470
       lcdDrawUpdate = 1;
471 471
     }

+ 3
- 3
Marlin/ultralcd_st7920_u8glib_rrd.h View File

@@ -59,7 +59,7 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo
59 59
       ST7920_WRITE_BYTE(0x01);       //clear CGRAM ram
60 60
       u8g_Delay(15);                 //delay for CGRAM clear
61 61
       ST7920_WRITE_BYTE(0x3E);       //extended mode + GDRAM active
62
-      for (y = 0; y < LCD_PIXEL_HEIGHT / 2; y++) { //clear GDRAM
62
+      for (y = 0; y < (LCD_PIXEL_HEIGHT) / 2; y++) { //clear GDRAM
63 63
         ST7920_WRITE_BYTE(0x80 | y); //set y
64 64
         ST7920_WRITE_BYTE(0x80);     //set x = 0
65 65
         ST7920_SET_DAT();
@@ -91,7 +91,7 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo
91 91
           ST7920_WRITE_BYTE(0x80 | 8);       //x=64
92 92
         }
93 93
         ST7920_SET_DAT();
94
-        ST7920_WRITE_BYTES(ptr, LCD_PIXEL_WIDTH / 8); //ptr is incremented inside of macro
94
+        ST7920_WRITE_BYTES(ptr, (LCD_PIXEL_WIDTH) / 8); //ptr is incremented inside of macro
95 95
         y++;
96 96
       }
97 97
       ST7920_NCS();
@@ -107,7 +107,7 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo
107 107
 #endif
108 108
 }
109 109
 
110
-uint8_t   u8g_dev_st7920_128x64_rrd_buf[LCD_PIXEL_WIDTH * (PAGE_HEIGHT / 8)] U8G_NOCOMMON;
110
+uint8_t   u8g_dev_st7920_128x64_rrd_buf[(LCD_PIXEL_WIDTH) * (PAGE_HEIGHT) / 8] U8G_NOCOMMON;
111 111
 u8g_pb_t  u8g_dev_st7920_128x64_rrd_pb = {{PAGE_HEIGHT, LCD_PIXEL_HEIGHT, 0, 0, 0}, LCD_PIXEL_WIDTH, u8g_dev_st7920_128x64_rrd_buf};
112 112
 u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = {u8g_dev_rrd_st7920_128x64_fn, &u8g_dev_st7920_128x64_rrd_pb, &u8g_com_null_fn};
113 113
 

Loading…
Cancel
Save