Fix Celsius precision, current temp accessors (#21678)

This commit is contained in:
Victor Oliveira
2021-04-23 22:29:15 -03:00
committed by GitHub
parent c4620bb528
commit 46f272b669
2 changed files with 19 additions and 19 deletions

View File

@@ -500,7 +500,7 @@ volatile bool Temperature::raw_temps_ready = false;
* temperature to succeed.
*/
void Temperature::PID_autotune(const celsius_t target, const heater_id_t heater_id, const int8_t ncycles, const bool set_result/*=false*/) {
float current_temp = 0.0;
celsius_float_t current_temp = 0.0;
int cycles = 0;
bool heating = true;
@@ -1668,7 +1668,7 @@ void Temperature::manage_heater() {
SERIAL_EOL();
}
celsius_t Temperature::user_thermistor_to_deg_c(const uint8_t t_index, const int raw) {
celsius_float_t Temperature::user_thermistor_to_deg_c(const uint8_t t_index, const int raw) {
//#if (MOTHERBOARD == BOARD_RAMPS_14_EFB)
// static uint32_t clocks_total = 0;
// static uint32_t calls = 0;
@@ -1717,7 +1717,7 @@ void Temperature::manage_heater() {
#if HAS_HOTEND
// Derived from RepRap FiveD extruder::getTemperature()
// For hot end temperature measurement.
celsius_t Temperature::analog_to_celsius_hotend(const int raw, const uint8_t e) {
celsius_float_t Temperature::analog_to_celsius_hotend(const int raw, const uint8_t e) {
if (e > HOTENDS - DISABLED(TEMP_SENSOR_1_AS_REDUNDANT)) {
SERIAL_ERROR_START();
SERIAL_ECHO(e);
@@ -1826,7 +1826,7 @@ void Temperature::manage_heater() {
#if HAS_HEATED_BED
// For bed temperature measurement.
celsius_t Temperature::analog_to_celsius_bed(const int raw) {
celsius_float_t Temperature::analog_to_celsius_bed(const int raw) {
#if TEMP_SENSOR_BED_IS_CUSTOM
return user_thermistor_to_deg_c(CTI_BED, raw);
#elif TEMP_SENSOR_BED_IS_THERMISTOR
@@ -1844,7 +1844,7 @@ void Temperature::manage_heater() {
#if HAS_TEMP_CHAMBER
// For chamber temperature measurement.
celsius_t Temperature::analog_to_celsius_chamber(const int raw) {
celsius_float_t Temperature::analog_to_celsius_chamber(const int raw) {
#if TEMP_SENSOR_CHAMBER_IS_CUSTOM
return user_thermistor_to_deg_c(CTI_CHAMBER, raw);
#elif TEMP_SENSOR_CHAMBER_IS_THERMISTOR
@@ -1862,7 +1862,7 @@ void Temperature::manage_heater() {
#if HAS_TEMP_COOLER
// For cooler temperature measurement.
celsius_t Temperature::analog_to_celsius_cooler(const int raw) {
celsius_float_t Temperature::analog_to_celsius_cooler(const int raw) {
#if TEMP_SENSOR_COOLER_IS_CUSTOM
return user_thermistor_to_deg_c(CTI_COOLER, raw);
#elif TEMP_SENSOR_COOLER_IS_THERMISTOR
@@ -1880,7 +1880,7 @@ void Temperature::manage_heater() {
#if HAS_TEMP_PROBE
// For probe temperature measurement.
celsius_t Temperature::analog_to_celsius_probe(const int raw) {
celsius_float_t Temperature::analog_to_celsius_probe(const int raw) {
#if TEMP_SENSOR_PROBE_IS_CUSTOM
return user_thermistor_to_deg_c(CTI_PROBE, raw);
#elif TEMP_SENSOR_PROBE_IS_THERMISTOR