Skip to content

Commit 9308443

Browse files
committed
misc. cleanup
1 parent a0799ab commit 9308443

10 files changed

+327
-333
lines changed

Marlin/Configuration_adv.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,7 @@
276276
#define THERMAL_PROTECTION_BOARD // Halt the printer if the board sensor leaves the temp range below.
277277
#define BOARD_MINTEMP 8 // (°C)
278278
#define BOARD_MAXTEMP 70 // (°C)
279-
#if !defined(TEMP_BOARD_PIN) && TEMP_SENSOR_BOARD != -100
280-
//#define TEMP_BOARD_PIN -1 // Board temp sensor pin, if not set in pins file.
281-
#endif
279+
//#define TEMP_BOARD_PIN -1 // Board temp sensor pin override.
282280
#endif
283281

284282
/**

Marlin/src/HAL/STM32/inc/SanityCheck.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
#error "TFT_COLOR_UI, TFT_LVGL_UI and TFT_CLASSIC_UI are currently only supported on STM32H7, STM32F4 and STM32F1 hardware."
5252
#endif
5353

54-
#if TEMP_SENSOR_BOARD_IS_INTERNAL && TEMP_BOARD_PIN != ATEMP
55-
#error "TEMP_SENSOR_BOARD=-100 requires 'TEMP_BOARD_PIN ATEMP' on STM32."
54+
#if TEMP_SENSOR_BOARD_IS_INTERNAL && defined(ATEMP) && TEMP_BOARD_PIN != ATEMP
55+
#error "TEMP_SENSOR_BOARD -100 requires 'TEMP_BOARD_PIN ATEMP' on STM32."
5656
#endif
5757

5858
/**

Marlin/src/HAL/STM32/internal_temp.h

+280-278
Large diffs are not rendered by default.

Marlin/src/inc/Conditionals_adv.h

+12-38
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,9 @@
280280
#define _SENSOR_IS(I,N) || (TEMP_SENSOR(N) == I)
281281
#define _E_SENSOR_IS(I,N) _SENSOR_IS(N,I)
282282
#define ANY_E_SENSOR_IS(N) (0 REPEAT2(HOTENDS, _E_SENSOR_IS, N))
283-
#define ANY_THERMISTOR_IS(N) ( ANY_E_SENSOR_IS(N) \
284-
_SENSOR_IS(N,BED) _SENSOR_IS(N,PROBE) _SENSOR_IS(N,CHAMBER) \
285-
_SENSOR_IS(N,COOLER) _SENSOR_IS(N,BOARD) _SENSOR_IS(N,REDUNDANT) )
283+
#define ANY_EXT_THERMISTOR_IS(N) ( ANY_E_SENSOR_IS(N) _SENSOR_IS(N,REDUNDANT) \
284+
_SENSOR_IS(N,BED) _SENSOR_IS(N,PROBE) _SENSOR_IS(N,CHAMBER) _SENSOR_IS(N,COOLER) )
285+
#define ANY_THERMISTOR_IS(N) ( ANY_EXT_THERMISTOR_IS(N) _SENSOR_IS(N,BOARD) )
286286

287287
#if ANY_THERMISTOR_IS(1000)
288288
#define HAS_USER_THERMISTORS 1
@@ -320,8 +320,6 @@
320320
#define TEMP_SENSOR_0_IS_AD8495 1
321321
#elif TEMP_SENSOR_0 == -1
322322
#define TEMP_SENSOR_0_IS_AD595 1
323-
#elif TEMP_SENSOR_0 == -100
324-
#error "Board Internal Temperature Sensor (-100) not supported for TEMP_SENSOR_0."
325323
#elif TEMP_SENSOR_0 == 1000
326324
#define TEMP_SENSOR_0_IS_CUSTOM 1
327325
#elif TEMP_SENSOR_0 == 998 || TEMP_SENSOR_0 == 999
@@ -367,8 +365,6 @@
367365
#define TEMP_SENSOR_1_IS_AD8495 1
368366
#elif TEMP_SENSOR_1 == -1
369367
#define TEMP_SENSOR_1_IS_AD595 1
370-
#elif TEMP_SENSOR_1 == -100
371-
#error "Board Internal Temperature Sensor (-100) not supported for TEMP_SENSOR_1."
372368
#elif TEMP_SENSOR_1 == 1000
373369
#define TEMP_SENSOR_1_IS_CUSTOM 1
374370
#elif TEMP_SENSOR_1 == 998 || TEMP_SENSOR_1 == 999
@@ -414,8 +410,6 @@
414410
#define TEMP_SENSOR_2_IS_AD8495 1
415411
#elif TEMP_SENSOR_2 == -1
416412
#define TEMP_SENSOR_2_IS_AD595 1
417-
#elif TEMP_SENSOR_2 == -100
418-
#error "Board Internal Temperature Sensor (-100) not supported for TEMP_SENSOR_2."
419413
#elif TEMP_SENSOR_2 == 1000
420414
#define TEMP_SENSOR_2_IS_CUSTOM 1
421415
#elif TEMP_SENSOR_2 == 998 || TEMP_SENSOR_2 == 999
@@ -543,8 +537,6 @@
543537
#define TEMP_SENSOR_REDUNDANT_IS_AD8495 1
544538
#elif TEMP_SENSOR_REDUNDANT == -1
545539
#define TEMP_SENSOR_REDUNDANT_IS_AD595 1
546-
#elif TEMP_SENSOR_REDUNDANT == -100
547-
#error "Board Internal Temperature Sensor (-100) not supported for TEMP_SENSOR_REDUNDANT."
548540
#elif TEMP_SENSOR_REDUNDANT > 0
549541
#define TEMP_SENSOR_REDUNDANT_IS_THERMISTOR 1
550542
#if TEMP_SENSOR_REDUNDANT == 1000
@@ -567,9 +559,7 @@
567559
#define HAS_MAX31865 1
568560
#endif
569561

570-
#if TEMP_SENSOR_3 == -100
571-
#error "Board Internal Temperature Sensor (-100) not supported for TEMP_SENSOR_3."
572-
#elif TEMP_SENSOR_3 == -4
562+
#if TEMP_SENSOR_3 == -4
573563
#define TEMP_SENSOR_3_IS_AD8495 1
574564
#elif TEMP_SENSOR_3 == -3
575565
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_3."
@@ -589,9 +579,7 @@
589579
#undef HEATER_3_MAXTEMP
590580
#endif
591581

592-
#if TEMP_SENSOR_4 == -100
593-
#error "Board Internal Temperature Sensor (-100) not supported for TEMP_SENSOR_4."
594-
#elif TEMP_SENSOR_4 == -4
582+
#if TEMP_SENSOR_4 == -4
595583
#define TEMP_SENSOR_4_IS_AD8495 1
596584
#elif TEMP_SENSOR_4 == -3
597585
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_4."
@@ -611,9 +599,7 @@
611599
#undef HEATER_4_MAXTEMP
612600
#endif
613601

614-
#if TEMP_SENSOR_5 == -100
615-
#error "Board Internal Temperature Sensor (-100) not supported for TEMP_SENSOR_5."
616-
#elif TEMP_SENSOR_5 == -4
602+
#if TEMP_SENSOR_5 == -4
617603
#define TEMP_SENSOR_5_IS_AD8495 1
618604
#elif TEMP_SENSOR_5 == -3
619605
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_5."
@@ -633,9 +619,7 @@
633619
#undef HEATER_5_MAXTEMP
634620
#endif
635621

636-
#if TEMP_SENSOR_6 == -100
637-
#error "Board Internal Temperature Sensor (-100) not supported for TEMP_SENSOR_6."
638-
#elif TEMP_SENSOR_6 == -4
622+
#if TEMP_SENSOR_6 == -4
639623
#define TEMP_SENSOR_6_IS_AD8495 1
640624
#elif TEMP_SENSOR_6 == -3
641625
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_6."
@@ -655,9 +639,7 @@
655639
#undef HEATER_6_MAXTEMP
656640
#endif
657641

658-
#if TEMP_SENSOR_7 == -100
659-
#error "Board Internal Temperature Sensor (-100) not supported for TEMP_SENSOR_7."
660-
#elif TEMP_SENSOR_7 == -4
642+
#if TEMP_SENSOR_7 == -4
661643
#define TEMP_SENSOR_7_IS_AD8495 1
662644
#elif TEMP_SENSOR_7 == -3
663645
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_7."
@@ -677,9 +659,7 @@
677659
#undef HEATER_7_MAXTEMP
678660
#endif
679661

680-
#if TEMP_SENSOR_BED == -100
681-
#error "Board Internal Temperature Sensor (-100) not supported for TEMP_SENSOR_BED."
682-
#elif TEMP_SENSOR_BED == -4
662+
#if TEMP_SENSOR_BED == -4
683663
#define TEMP_SENSOR_BED_IS_AD8495 1
684664
#elif TEMP_SENSOR_BED == -3
685665
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_BED."
@@ -701,9 +681,7 @@
701681
#undef BED_MAXTEMP
702682
#endif
703683

704-
#if TEMP_SENSOR_CHAMBER == -100
705-
#error "Board Internal Temperature Sensor (-100) not supported for TEMP_SENSOR_CHAMBER."
706-
#elif TEMP_SENSOR_CHAMBER == -4
684+
#if TEMP_SENSOR_CHAMBER == -4
707685
#define TEMP_SENSOR_CHAMBER_IS_AD8495 1
708686
#elif TEMP_SENSOR_CHAMBER == -3
709687
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_CHAMBER."
@@ -724,9 +702,7 @@
724702
#undef CHAMBER_MAXTEMP
725703
#endif
726704

727-
#if TEMP_SENSOR_COOLER == -100
728-
#error "Board Internal Temperature Sensor (-100) not supported for TEMP_SENSOR_COOLER."
729-
#elif TEMP_SENSOR_COOLER == -4
705+
#if TEMP_SENSOR_COOLER == -4
730706
#define TEMP_SENSOR_COOLER_IS_AD8495 1
731707
#elif TEMP_SENSOR_COOLER == -3
732708
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_COOLER."
@@ -747,9 +723,7 @@
747723
#undef COOLER_MAXTEMP
748724
#endif
749725

750-
#if TEMP_SENSOR_PROBE == -100
751-
#error "Board Internal Temperature Sensor (-100) not supported for TEMP_SENSOR_PROBE."
752-
#elif TEMP_SENSOR_PROBE == -4
726+
#if TEMP_SENSOR_PROBE == -4
753727
#define TEMP_SENSOR_PROBE_IS_AD8495 1
754728
#elif TEMP_SENSOR_PROBE == -3
755729
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_PROBE."

Marlin/src/inc/SanityCheck.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,11 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
736736
#undef _ISMAX_1
737737
#undef _ISSNS_1
738738

739+
// Internal Temperature Sensor
740+
#if ANY_EXT_THERMISTOR_IS(-100)
741+
#error "Board Internal Temperature Sensor (-100) is only supported for TEMP_SENSOR_BOARD."
742+
#endif
743+
739744
/**
740745
* Hephestos 2 Heated Bed Kit requirements
741746
*/
@@ -2728,7 +2733,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
27282733
#elif ENABLED(THERMAL_PROTECTION_BOARD) && (!defined(BOARD_MINTEMP) || !defined(BOARD_MAXTEMP))
27292734
#error "THERMAL_PROTECTION_BOARD requires BOARD_MINTEMP and BOARD_MAXTEMP."
27302735
#elif TEMP_SENSOR_BOARD_IS_INTERNAL && !defined(TEMP_INTERNAL_SENSOR)
2731-
#error "TEMP_SENSOR_BOARD=-100 requires TEMP_INTERNAL_SENSOR(RAW) to be defined. It may not be implemented for your specific board."
2736+
#error "TEMP_SENSOR_BOARD -100 requires TEMP_INTERNAL_SENSOR(RAW) to be defined. It may not be implemented for your specific board."
27322737
#endif
27332738
#elif CONTROLLER_FAN_MIN_BOARD_TEMP
27342739
#error "CONTROLLER_FAN_MIN_BOARD_TEMP requires TEMP_SENSOR_BOARD."

Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@
171171
#define TEMP_0_PIN P0_24
172172
#define TEMP_1_PIN P0_23
173173
#define TEMP_BED_PIN P0_25
174-
#define TEMP_BOARD_PIN P1_30 // Onboard thermistor, NTC100K
174+
#ifndef TEMP_BOARD_PIN
175+
#define TEMP_BOARD_PIN P1_30 // Onboard thermistor, NTC100K
176+
#endif
175177

176178
//
177179
// Heaters / Fans

Marlin/src/pins/rambo/pins_EINSY_RAMBO.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,13 @@
118118
//
119119
#define TEMP_0_PIN 0 // Analog Input, Header J2
120120
#define TEMP_1_PIN 1 // Analog Input, Header J3
121-
#define TEMP_BOARD_PIN 91 // Onboard thermistor, 100k TDK NTCG104LH104JT1
122121
#define TEMP_BED_PIN 2 // Analog Input, Header J6
123122
#define TEMP_PROBE_PIN 3 // Analog Input, Header J15
124123

124+
#ifndef TEMP_BOARD_PIN
125+
#define TEMP_BOARD_PIN 91 // Onboard thermistor, 100k TDK NTCG104LH104JT1
126+
#endif
127+
125128
//
126129
// Heaters / Fans
127130
//

Marlin/src/pins/sam/pins_DUE3DOM_MINI.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@
6969
#define TEMP_0_PIN 0 // Analog Input (HOTEND0 thermistor)
7070
#define TEMP_1_PIN 2 // Analog Input (unused)
7171
#define TEMP_BED_PIN 1 // Analog Input (BED thermistor)
72-
#define TEMP_BOARD_PIN 5 // Analog Input (OnBoard thermistor beta 3950)
72+
73+
#ifndef TEMP_BOARD_PIN
74+
#define TEMP_BOARD_PIN 5 // Analog Input (OnBoard thermistor beta 3950)
75+
#endif
7376

7477
// SPI for MAX Thermocouple
7578
#if DISABLED(SDSUPPORT)

Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h

+11-7
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,22 @@
148148
#define E0_SLAVE_ADDRESS 0
149149
#endif
150150
#endif
151+
151152
//
152153
// Temperature Sensors
153154
//
154-
#define TEMP_BED_PIN PC2 //TB
155-
#define TEMP_0_PIN PC1 //TH1
156-
//#define TEMP_1_PIN PC3 //TH2
157-
#define TEMP_BOARD_PIN PC3
158-
#ifndef TEMP_SENSOR_BOARD
159-
#define TEMP_SENSOR_BOARD 13
160-
#endif
155+
#define TEMP_BED_PIN PC2 // TB
156+
#define TEMP_0_PIN PC1 // TH1
157+
//#define TEMP_1_PIN PC3 // TH2
161158
#define FIL_RUNOUT_PIN PA10 // MT_DET
162159

160+
#ifndef TEMP_BOARD_PIN
161+
#define TEMP_BOARD_PIN PC3
162+
#endif
163+
#if defined(TEMP_SENSOR_BOARD) && TEMP_SENSOR_BOARD != 13
164+
#warning "The built-in TEMP_SENSOR_BOARD is 13 for ERYONE Ery32 mini."
165+
#endif
166+
163167
//
164168
// LCD Pins
165169
//

Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,13 @@
160160
//
161161
#define TEMP_0_PIN PA2 // T0 <-> E0
162162
#define TEMP_1_PIN PA0 // T1 <-> E1
163-
#define TEMP_BOARD_PIN PC2 // Onboard thermistor, NTC100K
164163
#define TEMP_BED_PIN PA1 // T2 <-> Bed
165164
#define TEMP_PROBE_PIN PC3 // Shares J4 connector with PD1
166165

166+
#ifndef TEMP_BOARD_PIN
167+
#define TEMP_BOARD_PIN PC2 // Onboard thermistor, NTC100K
168+
#endif
169+
167170
//
168171
// Heaters / Fans
169172
//

0 commit comments

Comments
 (0)