Fix pid_output declaration

This commit is contained in:
Scott Lahteine 2019-09-24 22:30:13 -05:00
parent df1e51258a
commit 3819f79945

View File

@ -821,7 +821,6 @@ void Temperature::min_temp_error(const heater_ind_t heater) {
#endif #endif
E_UNUSED(); E_UNUSED();
const uint8_t ee = HOTEND_INDEX; const uint8_t ee = HOTEND_INDEX;
float pid_output;
#if ENABLED(PIDTEMP) #if ENABLED(PIDTEMP)
#if DISABLED(PID_OPENLOOP) #if DISABLED(PID_OPENLOOP)
static hotend_pid_t work_pid[HOTENDS]; static hotend_pid_t work_pid[HOTENDS];
@ -830,6 +829,8 @@ void Temperature::min_temp_error(const heater_ind_t heater) {
static bool pid_reset[HOTENDS] = { false }; static bool pid_reset[HOTENDS] = { false };
const float pid_error = temp_hotend[ee].target - temp_hotend[ee].celsius; const float pid_error = temp_hotend[ee].target - temp_hotend[ee].celsius;
float pid_output;
if (temp_hotend[ee].target == 0 if (temp_hotend[ee].target == 0
|| pid_error < -(PID_FUNCTIONAL_RANGE) || pid_error < -(PID_FUNCTIONAL_RANGE)
#if HEATER_IDLE_HANDLER #if HEATER_IDLE_HANDLER
@ -914,7 +915,7 @@ void Temperature::min_temp_error(const heater_ind_t heater) {
#else #else
#define _TIMED_OUT_TEST false #define _TIMED_OUT_TEST false
#endif #endif
pid_output = (!_TIMED_OUT_TEST && temp_hotend[ee].celsius < temp_hotend[ee].target) ? BANG_MAX : 0; const float pid_output = (!_TIMED_OUT_TEST && temp_hotend[ee].celsius < temp_hotend[ee].target) ? BANG_MAX : 0;
#undef _TIMED_OUT_TEST #undef _TIMED_OUT_TEST
#endif #endif