diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 79298e0c2..16296d8bb 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6699,7 +6699,7 @@ void plan_arc( float mm_of_travel = hypot(angular_travel * radius, fabs(linear_travel)); if (mm_of_travel < 0.001) return; - uint16_t segments = floor(mm_of_travel / MM_PER_ARC_SEGMENT); + uint16_t segments = floor(mm_of_travel / (MM_PER_ARC_SEGMENT)); if (segments == 0) segments = 1; float theta_per_segment = angular_travel / segments; diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 8e9459081..9b2c4007a 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -405,10 +405,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 - #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) + #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) #define MESH_MIN_Y 10 #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y)) -#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index c0c3cc7b2..6a6eccc27 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -402,10 +402,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 - #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) + #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) #define MESH_MIN_Y 10 #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y)) -#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index fc61c6279..2f2a653cb 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -415,10 +415,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 - #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) + #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) #define MESH_MIN_Y 10 #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y)) -#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index e35123826..25cf538da 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -418,10 +418,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 - #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) + #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) #define MESH_MIN_Y 10 #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y)) -#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 1d67d1e70..94752253f 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -438,10 +438,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 - #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) + #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) #define MESH_MIN_Y 10 #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y)) -#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 6756843b4..9c00bcf20 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -423,10 +423,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 - #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) + #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) #define MESH_MIN_Y 10 #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y)) -#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 1e94dd9d3..288cb52fc 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -417,10 +417,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 - #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) + #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) #define MESH_MIN_Y 10 #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y)) -#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 7fe6a45c9..c81f5b1d7 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -431,10 +431,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 - #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) + #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) #define MESH_MIN_Y 10 #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y)) -#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index a1b3bb282..45c4ab705 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -443,10 +443,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 - #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) + #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) #define MESH_MIN_Y 10 #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y)) -#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 502be68ce..4cb81a65b 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -415,10 +415,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 - #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) + #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) #define MESH_MIN_Y 10 #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y)) -#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index fc11b8103..2b99d46be 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -445,10 +445,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 - #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) + #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) #define MESH_MIN_Y 10 #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y)) -#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 339956ca3..fabc8e07d 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -451,10 +451,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 - #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) + #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) #define MESH_MIN_Y 10 #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y)) -#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 70241e7d1..0689d6384 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -426,10 +426,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 - #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) + #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) #define MESH_MIN_Y 10 #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y)) -#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 2c9c97b5e..6e6855c97 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -413,10 +413,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 - #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) + #define MESH_MAX_X (X_MAX_POS - (MESH_MIN_X)) #define MESH_MIN_Y 10 #define MESH_MAX_Y (Y_MAX_POS - (MESH_MIN_Y)) -#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. diff --git a/Marlin/mesh_bed_leveling.h b/Marlin/mesh_bed_leveling.h index 7717995ef..b18d346db 100644 --- a/Marlin/mesh_bed_leveling.h +++ b/Marlin/mesh_bed_leveling.h @@ -14,8 +14,8 @@ void reset(); - float get_x(int i) { return MESH_MIN_X + MESH_X_DIST * i; } - float get_y(int i) { return MESH_MIN_Y + MESH_Y_DIST * i; } + float get_x(int i) { return MESH_MIN_X + (MESH_X_DIST) * i; } + float get_y(int i) { return MESH_MIN_Y + (MESH_Y_DIST) * i; } void set_z(int ix, int iy, float z) { z_values[iy][ix] = z; } int select_x_index(float x) { diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index fcc830e39..ce1122c0e 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -331,7 +331,7 @@ void planner_recalculate_trapezoids() { // Last/newest block in buffer. Exit speed is set with MINIMUM_PLANNER_SPEED. Always recalculated. if (next) { float nom = next->nominal_speed; - calculate_trapezoid_for_block(next, next->entry_speed / nom, MINIMUM_PLANNER_SPEED / nom); + calculate_trapezoid_for_block(next, next->entry_speed / nom, (MINIMUM_PLANNER_SPEED) / nom); next->recalculate_flag = false; } } @@ -389,8 +389,8 @@ void plan_init() { float t = autotemp_min + high * autotemp_factor; t = constrain(t, autotemp_min, autotemp_max); if (oldt > t) { - t *= (1 - AUTOTEMP_OLDWEIGHT); - t += AUTOTEMP_OLDWEIGHT * oldt; + t *= (1 - (AUTOTEMP_OLDWEIGHT)); + t += (AUTOTEMP_OLDWEIGHT) * oldt; } oldt = t; setTargetHotend0(t); @@ -839,7 +839,7 @@ float junction_deviation = 0.1; max_y_segment_time = max(ys0, max(ys1, ys2)), min_xy_segment_time = min(max_x_segment_time, max_y_segment_time); if (min_xy_segment_time < MAX_FREQ_TIME) { - float low_sf = speed_factor * min_xy_segment_time / MAX_FREQ_TIME; + float low_sf = speed_factor * min_xy_segment_time / (MAX_FREQ_TIME); speed_factor = min(speed_factor, low_sf); } #endif // XY_FREQUENCY_LIMIT diff --git a/Marlin/servo.cpp b/Marlin/servo.cpp index ecd4bdae8..67e7acf09 100644 --- a/Marlin/servo.cpp +++ b/Marlin/servo.cpp @@ -57,7 +57,7 @@ #define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays // 12 August 2009 -//#define NBR_TIMERS (MAX_SERVOS / SERVOS_PER_TIMER) +//#define NBR_TIMERS ((MAX_SERVOS) / (SERVOS_PER_TIMER)) static ServoInfo_t servo_info[MAX_SERVOS]; // static array of servo info structures 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 // convenience macros -#define SERVO_INDEX_TO_TIMER(_servo_nbr) ((timer16_Sequence_t)(_servo_nbr / SERVOS_PER_TIMER)) // returns the timer controlling this servo -#define SERVO_INDEX_TO_CHANNEL(_servo_nbr) (_servo_nbr % SERVOS_PER_TIMER) // returns the index of the servo on this timer -#define SERVO_INDEX(_timer,_channel) ((_timer*SERVOS_PER_TIMER) + _channel) // macro to access servo index by timer and channel +#define SERVO_INDEX_TO_TIMER(_servo_nbr) ((timer16_Sequence_t)(_servo_nbr / (SERVOS_PER_TIMER))) // returns the timer controlling this servo +#define SERVO_INDEX_TO_CHANNEL(_servo_nbr) (_servo_nbr % (SERVOS_PER_TIMER)) // returns the index of the servo on this timer +#define SERVO_INDEX(_timer,_channel) ((_timer*(SERVOS_PER_TIMER)) + _channel) // macro to access servo index by timer and channel #define SERVO(_timer,_channel) (servo_info[SERVO_INDEX(_timer,_channel)]) // macro to access servo class by timer and channel #define SERVO_MIN() (MIN_PULSE_WIDTH - this->min * 4) // minimum value in uS for this servo diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 6cb36fd06..76300ac92 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -1220,9 +1220,9 @@ void digipot_current(uint8_t driver, int current) { digitalPotWrite(digipot_ch[driver], current); #elif defined(MOTOR_CURRENT_PWM_XY_PIN) switch (driver) { - case 0: analogWrite(MOTOR_CURRENT_PWM_XY_PIN, 255L * current / MOTOR_CURRENT_PWM_RANGE); break; - case 1: analogWrite(MOTOR_CURRENT_PWM_Z_PIN, 255L * current / MOTOR_CURRENT_PWM_RANGE); break; - case 2: analogWrite(MOTOR_CURRENT_PWM_E_PIN, 255L * current / MOTOR_CURRENT_PWM_RANGE); break; + case 0: analogWrite(MOTOR_CURRENT_PWM_XY_PIN, 255L * current / (MOTOR_CURRENT_PWM_RANGE)); break; + case 1: analogWrite(MOTOR_CURRENT_PWM_Z_PIN, 255L * current / (MOTOR_CURRENT_PWM_RANGE)); break; + case 2: analogWrite(MOTOR_CURRENT_PWM_E_PIN, 255L * current / (MOTOR_CURRENT_PWM_RANGE)); break; } #else UNUSED(driver); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 8718645ea..be54bcdf9 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -465,7 +465,7 @@ void lcd_set_home_offsets() { static void _lcd_babystep(int axis, const char* msg) { if (encoderPosition != 0) { - babystepsTodo[axis] += BABYSTEP_MULTIPLICATOR * (int)encoderPosition; + babystepsTodo[axis] += (BABYSTEP_MULTIPLICATOR) * (int)encoderPosition; encoderPosition = 0; lcdDrawUpdate = 1; } diff --git a/Marlin/ultralcd_st7920_u8glib_rrd.h b/Marlin/ultralcd_st7920_u8glib_rrd.h index d22c0db29..8b00fcd3d 100644 --- a/Marlin/ultralcd_st7920_u8glib_rrd.h +++ b/Marlin/ultralcd_st7920_u8glib_rrd.h @@ -59,7 +59,7 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo ST7920_WRITE_BYTE(0x01); //clear CGRAM ram u8g_Delay(15); //delay for CGRAM clear ST7920_WRITE_BYTE(0x3E); //extended mode + GDRAM active - for (y = 0; y < LCD_PIXEL_HEIGHT / 2; y++) { //clear GDRAM + for (y = 0; y < (LCD_PIXEL_HEIGHT) / 2; y++) { //clear GDRAM ST7920_WRITE_BYTE(0x80 | y); //set y ST7920_WRITE_BYTE(0x80); //set x = 0 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 ST7920_WRITE_BYTE(0x80 | 8); //x=64 } ST7920_SET_DAT(); - ST7920_WRITE_BYTES(ptr, LCD_PIXEL_WIDTH / 8); //ptr is incremented inside of macro + ST7920_WRITE_BYTES(ptr, (LCD_PIXEL_WIDTH) / 8); //ptr is incremented inside of macro y++; } 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 #endif } -uint8_t u8g_dev_st7920_128x64_rrd_buf[LCD_PIXEL_WIDTH * (PAGE_HEIGHT / 8)] U8G_NOCOMMON; +uint8_t u8g_dev_st7920_128x64_rrd_buf[(LCD_PIXEL_WIDTH) * (PAGE_HEIGHT) / 8] U8G_NOCOMMON; 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}; 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};