# HG changeset patch # User Michiel Broek # Date 1408995237 -7200 # Node ID a84792cab21c6764190734d2cb6df43e1a9db515 # Parent 07819a7ad3c15beb2bd37d472b3f4c0e9f201ec0 Don't log debug pid messages if there is no error difference diff -r 07819a7ad3c1 -r a84792cab21c thermferm/thermferm.c --- a/thermferm/thermferm.c Mon Aug 25 20:47:30 2014 +0200 +++ b/thermferm/thermferm.c Mon Aug 25 21:33:57 2014 +0200 @@ -1277,11 +1277,13 @@ */ Out = (10.0*P_err) + (0.1*unit->PID_I_err) + (5*D_err); // Kp 0.1 Ki 0.3 Kd 0.02 - if (debug) - fprintf(stdout, "sp=%.2f pv=%.2f err_old=%.2f err=%.2f P_err=%.2f I_err=%.2f D_err=%.2f Out=%.2f\n", - sp, pv, unit->PID_err_old, err, P_err, unit->PID_I_err, D_err, Out); - syslog(LOG_NOTICE, "sp=%.2f pv=%.2f err_old=%.2f err=%.2f P_err=%.2f I_err=%.2f D_err=%.2f Out=%.2f", + if (err != 0.0) { + if (debug) + fprintf(stdout, "sp=%.2f pv=%.2f err_old=%.2f err=%.2f P_err=%.2f I_err=%.2f D_err=%.2f Out=%.2f\n", sp, pv, unit->PID_err_old, err, P_err, unit->PID_I_err, D_err, Out); + syslog(LOG_NOTICE, "sp=%.2f pv=%.2f err_old=%.2f err=%.2f P_err=%.2f I_err=%.2f D_err=%.2f Out=%.2f", + sp, pv, unit->PID_err_old, err, P_err, unit->PID_I_err, D_err, Out); + } if (unit->heater_address) { if (Out >= 2) { if (! unit->heater_state)