mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-30 07:17:59 +00:00
Use RTD for MAX31865 reading (#20188)
This commit is contained in:
parent
acdfbbeb86
commit
cb2ec628df
@ -2248,10 +2248,7 @@ void Temperature::disable_all_heaters() {
|
|||||||
|
|
||||||
#if HAS_MAX31865
|
#if HAS_MAX31865
|
||||||
Adafruit_MAX31865 &maxref = MAX6675_SEL(max31865_0, max31865_1);
|
Adafruit_MAX31865 &maxref = MAX6675_SEL(max31865_0, max31865_1);
|
||||||
max6675_temp = int(maxref.temperature(
|
const uint16_t max31865_ohms = (uint32_t(maxref.readRTD()) * MAX6675_SEL(MAX31865_CALIBRATION_OHMS_0, MAX31865_CALIBRATION_OHMS_1)) >> 16;
|
||||||
MAX6675_SEL(MAX31865_SENSOR_OHMS_0, MAX31865_SENSOR_OHMS_1),
|
|
||||||
MAX6675_SEL(MAX31865_CALIBRATION_OHMS_0, MAX31865_CALIBRATION_OHMS_1)
|
|
||||||
));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -2325,6 +2322,9 @@ void Temperature::disable_all_heaters() {
|
|||||||
if (max6675_temp & 0x00002000) max6675_temp |= 0xFFFFC000; // Support negative temperature
|
if (max6675_temp & 0x00002000) max6675_temp |= 0xFFFFC000; // Support negative temperature
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Return the RTD resistance for MAX31865 for display in SHOW_TEMP_ADC_VALUES
|
||||||
|
TERN_(HAS_MAX31865, max6675_temp = max31865_ohms);
|
||||||
|
|
||||||
MAX6675_TEMP(hindex) = max6675_temp;
|
MAX6675_TEMP(hindex) = max6675_temp;
|
||||||
|
|
||||||
return int(max6675_temp);
|
return int(max6675_temp);
|
||||||
|
Loading…
Reference in New Issue
Block a user