Skip to content

Commit 7eee772

Browse files
authored
✨ MAX31865 Bed settings (#27611)
1 parent 63bc413 commit 7eee772

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

Marlin/Configuration.h

+4
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,10 @@
599599
#define MAX31865_SENSOR_OHMS_2 100
600600
#define MAX31865_CALIBRATION_OHMS_2 430
601601
#endif
602+
#if TEMP_SENSOR_IS_MAX_TC(BED)
603+
#define MAX31865_SENSOR_OHMS_BED 100
604+
#define MAX31865_CALIBRATION_OHMS_BED 430
605+
#endif
602606

603607
#if HAS_E_TEMP_SENSOR
604608
#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109

Marlin/Configuration_adv.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,10 @@
174174
* Thermocouple Options — for MAX6675 (-2), MAX31855 (-3), and MAX31865 (-5).
175175
*/
176176
//#define TEMP_SENSOR_FORCE_HW_SPI // Ignore SCK/MOSI/MISO pins; use CS and the default SPI bus.
177-
//#define MAX31865_SENSOR_WIRES_0 2 // (2-4) Number of wires for the probe connected to a MAX31865 board.
178-
//#define MAX31865_SENSOR_WIRES_1 2
179-
//#define MAX31865_SENSOR_WIRES_2 2
177+
//#define MAX31865_SENSOR_WIRES_0 2 // (2-4) Number of wires for the probe connected to a MAX31865 board.
178+
//#define MAX31865_SENSOR_WIRES_1 2
179+
//#define MAX31865_SENSOR_WIRES_2 2
180+
//#define MAX31865_SENSOR_WIRES_BED 2
180181

181182
//#define MAX31865_50HZ_FILTER // Use a 50Hz filter instead of the default 60Hz.
182183
//#define MAX31865_USE_READ_ERROR_DETECTION // Treat value spikes (20°C delta in under 1s) as read errors.
@@ -188,6 +189,7 @@
188189
//#define MAX31865_WIRE_OHMS_0 0.95f // For 2-wire, set the wire resistances for more accurate readings.
189190
//#define MAX31865_WIRE_OHMS_1 0.0f
190191
//#define MAX31865_WIRE_OHMS_2 0.0f
192+
//#define MAX31865_WIRE_OHMS_BED 0.0f
191193

192194
/**
193195
* Hephestos 2 24V heated bed upgrade kit.

Marlin/src/HAL/shared/Delay.h

+3
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ void calibrate_delay_loop();
174174

175175
// Delay in microseconds
176176
#define DELAY_US(x) DELAY_CYCLES((x) * ((F_CPU) / 1000000UL))
177+
178+
#define DELAY_CYCLES_VAR DELAY_CYCLES
179+
177180
#else
178181

179182
#error "Unsupported MCU architecture"

Marlin/src/inc/SanityCheck.h

+7
Original file line numberDiff line numberDiff line change
@@ -2121,6 +2121,13 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
21212121
#error "MAX31865_SENSOR_OHMS_2 and MAX31865_CALIBRATION_OHMS_2 must be set if TEMP_SENSOR_2/TEMP_SENSOR_REDUNDANT is MAX31865."
21222122
#endif
21232123
#endif
2124+
#if TEMP_SENSOR_BED_IS_MAX31865
2125+
#if !defined(MAX31865_SENSOR_WIRES_BED) || !WITHIN(MAX31865_SENSOR_WIRES_BED, 2, 4)
2126+
#error "MAX31865_SENSOR_WIRES_BED must be defined as an integer between 2 and 4."
2127+
#elif !defined(MAX31865_SENSOR_OHMS_BED) || !defined(MAX31865_CALIBRATION_OHMS_BED)
2128+
#error "MAX31865_SENSOR_OHMS_BED and MAX31865_CALIBRATION_OHMS_BED must be set if TEMP_SENSOR_BED is MAX31865."
2129+
#endif
2130+
#endif
21242131

21252132
/**
21262133
* Redundant temperature sensor config

0 commit comments

Comments
 (0)