Browse Source

Fix pid_output declaration

pull/1/head
Scott Lahteine 5 years ago
parent
commit
3819f79945
  1. 5
      Marlin/src/module/temperature.cpp

5
Marlin/src/module/temperature.cpp

@ -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

Loading…
Cancel
Save