# HG changeset patch # User Michiel Broek # Date 1557415009 -7200 # Node ID 1904badedf8f1510ae6fba777d31eb4106e2c489 # Parent 55b849fc2d2089239674d524d61ce15cb14600cf Code cleanup and removed a debug message diff -r 55b849fc2d20 -r 1904badedf8f thermferm/server.c --- a/thermferm/server.c Thu May 09 17:10:54 2019 +0200 +++ b/thermferm/server.c Thu May 09 17:16:49 2019 +0200 @@ -2088,8 +2088,6 @@ } if (unit->mqtt_flag) { - if (debug) - fprintf(stdout, "flag value %d\n", unit->mqtt_flag); if (unit->mqtt_flag & MQTT_FLAG_BIRTH) { publishDBirth(unit); } else { diff -r 55b849fc2d20 -r 1904badedf8f thermferm/thermferm.c --- a/thermferm/thermferm.c Thu May 09 17:10:54 2019 +0200 +++ b/thermferm/thermferm.c Thu May 09 17:16:49 2019 +0200 @@ -1513,10 +1513,6 @@ * This is our current step */ valid_step = TRUE; - // if (debug) - // fprintf(stdout, "step=%d step_pos=%d step=%d/%d target=%.1f..%.1f ", - // current_step, run_hours - time_until_now, - // step->steptime, step->resttime, step->target_lo, step->target_hi); if ((run_hours - time_until_now) < step->steptime) { unit->prof_target_lo = previous_target_lo + (((run_minutes - (time_until_now * 60.0)) / (step->steptime * 60.0)) * (step->target_lo - previous_target_lo)); unit->prof_target_hi = previous_target_hi + (((run_minutes - (time_until_now * 60.0)) / (step->steptime * 60.0)) * (step->target_hi - previous_target_hi)); @@ -1530,18 +1526,10 @@ if (debug) fprintf(stdout, "prof_fridge_mode=%d run_minutes=%d steptime=%d time_until_now=%d\n", unit->prof_fridge_mode, run_minutes, step->steptime, time_until_now); - // if (debug) - // fprintf(stdout, "tempshift=%.1f..%.1f minutes=%d duration=%d temp_move=%.3f..%.3f ", - // step->target_lo - previous_target_lo, - // step->target_hi - previous_target_hi, - // run_minutes - (time_until_now * 60), - // step->steptime * 60, unit->prof_target_lo, unit->prof_target_hi); } else { unit->prof_target_lo = step->target_lo; unit->prof_target_hi = step->target_hi; unit->prof_fridge_mode = step->fridge_mode; - // if (debug) - // fprintf(stdout, "resting target=%.1f..%.1f ", step->target_lo, step->target_hi); } break; } @@ -1550,8 +1538,6 @@ previous_target_hi = step->target_hi; previous_fridge_mode = step->fridge_mode; } - // if (debug) - // fprintf(stdout, " %s %02d:%02d\n", valid_step ? "TRUE":"FALSE", minutes, seconds); if (valid_step == TRUE) { unit->prof_percent = (100 * run_minutes) / tot_minutes; @@ -1677,9 +1663,6 @@ */ usetemp = ((unit->prof_fridge_mode * (unit->air_temperature / 1000.0)) + ((100 - unit->prof_fridge_mode) * (unit->beer_temperature / 1000.0))) / 100.0; - if (debug) - fprintf(stdout, " fridge_mode=%d measured=%.3f %.3f => %.3f\n", unit->prof_fridge_mode, - unit->air_temperature / 1000.0, unit->beer_temperature / 1000.0, usetemp); unit->PID_cool->Input = unit->PID_heat->Input = usetemp; unit->PID_cool->Mode = unit->PID_heat->Mode = PID_MODE_AUTO; }