Wrap macros to prevent bad expansions

This commit is contained in:
Scott Lahteine
2016-03-12 22:38:55 -08:00
parent 7bb7ac8353
commit f9ded2a7c4
32 changed files with 158 additions and 158 deletions

View File

@@ -447,7 +447,7 @@ void check_axes_activity() {
}
#endif //FAN_KICKSTART_TIME
#if defined(FAN_MIN_PWM)
#define CALC_FAN_SPEED (tail_fan_speed ? ( FAN_MIN_PWM + (tail_fan_speed * (255 - FAN_MIN_PWM)) / 255 ) : 0)
#define CALC_FAN_SPEED (tail_fan_speed ? ( FAN_MIN_PWM + (tail_fan_speed * (255 - (FAN_MIN_PWM))) / 255 ) : 0)
#else
#define CALC_FAN_SPEED tail_fan_speed
#endif // FAN_MIN_PWM
@@ -524,7 +524,7 @@ float junction_deviation = 0.1;
SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
}
#if ENABLED(PREVENT_LENGTHY_EXTRUDE)
if (labs(de) > axis_steps_per_unit[E_AXIS] * EXTRUDE_MAXLENGTH) {
if (labs(de) > axis_steps_per_unit[E_AXIS] * (EXTRUDE_MAXLENGTH)) {
position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
de = 0; // no difference
SERIAL_ECHO_START;
@@ -634,10 +634,10 @@ float junction_deviation = 0.1;
#if ENABLED(DUAL_X_CARRIAGE)
if (extruder_duplication_enabled) {
enable_e1();
g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE * 2;
g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
}
#endif
g_uc_extruder_last_move[0] = BLOCK_BUFFER_SIZE * 2;
g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2;
#if EXTRUDERS > 1
if (g_uc_extruder_last_move[1] == 0) disable_e1();
#if EXTRUDERS > 2
@@ -651,7 +651,7 @@ float junction_deviation = 0.1;
#if EXTRUDERS > 1
case 1:
enable_e1();
g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE * 2;
g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
if (g_uc_extruder_last_move[0] == 0) disable_e0();
#if EXTRUDERS > 2
if (g_uc_extruder_last_move[2] == 0) disable_e2();
@@ -663,7 +663,7 @@ float junction_deviation = 0.1;
#if EXTRUDERS > 2
case 2:
enable_e2();
g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE * 2;
g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2;
if (g_uc_extruder_last_move[0] == 0) disable_e0();
if (g_uc_extruder_last_move[1] == 0) disable_e1();
#if EXTRUDERS > 3
@@ -673,7 +673,7 @@ float junction_deviation = 0.1;
#if EXTRUDERS > 3
case 3:
enable_e3();
g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE * 2;
g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2;
if (g_uc_extruder_last_move[0] == 0) disable_e0();
if (g_uc_extruder_last_move[1] == 0) disable_e1();
if (g_uc_extruder_last_move[2] == 0) disable_e2();
@@ -749,9 +749,9 @@ float junction_deviation = 0.1;
// Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
#if ENABLED(OLD_SLOWDOWN) || ENABLED(SLOWDOWN)
bool mq = moves_queued > 1 && moves_queued < BLOCK_BUFFER_SIZE / 2;
bool mq = moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE) / 2;
#if ENABLED(OLD_SLOWDOWN)
if (mq) feed_rate *= 2.0 * moves_queued / BLOCK_BUFFER_SIZE;
if (mq) feed_rate *= 2.0 * moves_queued / (BLOCK_BUFFER_SIZE);
#endif
#if ENABLED(SLOWDOWN)
// segment time im micro seconds
@@ -974,7 +974,7 @@ float junction_deviation = 0.1;
}
else {
long acc_dist = estimate_acceleration_distance(0, block->nominal_rate, block->acceleration_st);
float advance = (STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K) * (cse * cse * EXTRUSION_AREA * EXTRUSION_AREA) * 256;
float advance = ((STEPS_PER_CUBIC_MM_E) * (EXTRUDER_ADVANCE_K)) * (cse * cse * (EXTRUSION_AREA) * (EXTRUSION_AREA)) * 256;
block->advance = advance;
block->advance_rate = acc_dist ? advance / (float)acc_dist : 0;
}