From 41e208a21f18adefc010ff5eb31e14be0971b239 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Sat, 9 May 2015 15:11:21 +0200 Subject: [PATCH] heater.c: remove some unneccessary #ifdef DEBUG. These are redundant, the wrapped if() will be optimized away for non-debug builds. The same strategy is used in many other places. --- heater.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/heater.c b/heater.c index c1c19a0..9f34db6 100644 --- a/heater.c +++ b/heater.c @@ -343,10 +343,8 @@ void heater_tick(heater_t h, temp_type_t type, uint16_t current_temp, uint16_t t else pid_output = pid_output_intermed & 0xFF; - #ifdef DEBUG if (DEBUG_PID && (debug_flags & DEBUG_PID)) sersendf_P(PSTR("T{E:%d, P:%d * %ld = %ld / I:%d * %ld = %ld / D:%d * %ld = %ld # O: %ld = %u}\n"), t_error, heater_p, heaters_pid[h].p_factor, (int32_t) heater_p * heaters_pid[h].p_factor / PID_SCALE, heaters_runtime[h].heater_i, heaters_pid[h].i_factor, (int32_t) heaters_runtime[h].heater_i * heaters_pid[h].i_factor / PID_SCALE, heater_d, heaters_pid[h].d_factor, (int32_t) heater_d * heaters_pid[h].d_factor / PID_SCALE, pid_output_intermed, pid_output); - #endif #else if (current_temp >= target_temp + (TEMP_HYSTERESIS)) pid_output = BANG_BANG_OFF; @@ -428,10 +426,9 @@ void heater_set(heater_t index, uint8_t value) { if (heaters[index].heater_pwm) { *(heaters[index].heater_pwm) = value; - #ifdef DEBUG + if (DEBUG_PID && (debug_flags & DEBUG_PID)) sersendf_P(PSTR("PWM{%u = %u}\n"), index, *heaters[index].heater_pwm); - #endif } else { if (value >= HEATER_THRESHOLD)