🩹 Return 0 for bad index in Temperature::getHeaterPower (#27037)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
@@ -1303,8 +1303,10 @@ int16_t Temperature::getHeaterPower(const heater_id_t heater_id) {
|
|||||||
#if HAS_COOLER
|
#if HAS_COOLER
|
||||||
case H_COOLER: return temp_cooler.soft_pwm_amount;
|
case H_COOLER: return temp_cooler.soft_pwm_amount;
|
||||||
#endif
|
#endif
|
||||||
default:
|
#if HAS_HOTEND
|
||||||
return TERN0(HAS_HOTEND, temp_hotend[heater_id].soft_pwm_amount);
|
case 0 ... HOTENDS - 1: return temp_hotend[heater_id].soft_pwm_amount;
|
||||||
|
#endif
|
||||||
|
default: return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user