Skip to content

Commit 79b4555

Browse files
authored
🔧 Thermistor 100 : SoC sensor (MarlinFirmware#25745)
Followup to MarlinFirmware#25642
1 parent d364bab commit 79b4555

File tree

2 files changed

+49
-12
lines changed

2 files changed

+49
-12
lines changed

Marlin/Configuration.h

+5
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,11 @@
524524
* -1 : AD595 with Thermocouple
525525
*
526526
* ================================================================
527+
* SoC internal sensor
528+
* ================================================================
529+
* 100 : SoC internal sensor
530+
*
531+
* ================================================================
527532
* Custom/Dummy/Other Thermal Sensors
528533
* ================================================================
529534
* 0 : not used

Marlin/src/inc/SanityCheck.h

+44-12
Original file line numberDiff line numberDiff line change
@@ -2029,6 +2029,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
20292029
#error "HEATER_0_PIN not defined for this board."
20302030
#elif TEMP_SENSOR_IS_MAX_TC(0) && !PIN_EXISTS(TEMP_0_CS)
20312031
#error "TEMP_SENSOR_0 MAX thermocouple requires TEMP_0_CS_PIN."
2032+
#elif TEMP_SENSOR_0 == 100
2033+
#error "TEMP_SENSOR_0 can't use Soc temperature sensor."
20322034
#elif TEMP_SENSOR_0 == 0
20332035
#error "TEMP_SENSOR_0 is required with 1 or more HOTENDS."
20342036
#elif !ANY_PIN(TEMP_0, TEMP_0_CS) && !TEMP_SENSOR_0_IS_DUMMY
@@ -2040,53 +2042,67 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
20402042
#if HAS_MULTI_HOTEND
20412043
#if TEMP_SENSOR_IS_MAX_TC(1) && !PIN_EXISTS(TEMP_1_CS)
20422044
#error "TEMP_SENSOR_1 MAX thermocouple requires TEMP_1_CS_PIN."
2045+
#elif TEMP_SENSOR_1 == 100
2046+
#error "TEMP_SENSOR_1 can't use Soc temperature sensor."
20432047
#elif TEMP_SENSOR_1 == 0
20442048
#error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
20452049
#elif !ANY_PIN(TEMP_1, TEMP_1_CS) && !TEMP_SENSOR_1_IS_DUMMY
20462050
#error "TEMP_1_PIN or TEMP_1_CS_PIN not defined for this board."
20472051
#endif
20482052
#if HOTENDS > 2
2049-
#if TEMP_SENSOR_2 == 0
2053+
#if TEMP_SENSOR_2 == 100
2054+
#error "TEMP_SENSOR_2 can't use Soc temperature sensor."
2055+
#elif TEMP_SENSOR_2 == 0
20502056
#error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
20512057
#elif !HAS_HEATER_2
20522058
#error "HEATER_2_PIN not defined for this board."
20532059
#elif !ANY_PIN(TEMP_2, TEMP_2_CS) && !TEMP_SENSOR_2_IS_DUMMY
20542060
#error "TEMP_2_PIN or TEMP_2_CS_PIN not defined for this board."
20552061
#endif
20562062
#if HOTENDS > 3
2057-
#if TEMP_SENSOR_3 == 0
2063+
#if TEMP_SENSOR_3 == 100
2064+
#error "TEMP_SENSOR_3 can't use Soc temperature sensor."
2065+
#elif TEMP_SENSOR_3 == 0
20582066
#error "TEMP_SENSOR_3 is required with 4 or more HOTENDS."
20592067
#elif !HAS_HEATER_3
20602068
#error "HEATER_3_PIN not defined for this board."
20612069
#elif !PIN_EXISTS(TEMP_3) && !TEMP_SENSOR_3_IS_DUMMY
20622070
#error "TEMP_3_PIN not defined for this board."
20632071
#endif
20642072
#if HOTENDS > 4
2065-
#if TEMP_SENSOR_4 == 0
2073+
#if TEMP_SENSOR_4 == 100
2074+
#error "TEMP_SENSOR_4 can't use Soc temperature sensor."
2075+
#elif TEMP_SENSOR_4 == 0
20662076
#error "TEMP_SENSOR_4 is required with 5 or more HOTENDS."
20672077
#elif !HAS_HEATER_4
20682078
#error "HEATER_4_PIN not defined for this board."
20692079
#elif !PIN_EXISTS(TEMP_4) && !TEMP_SENSOR_4_IS_DUMMY
20702080
#error "TEMP_4_PIN not defined for this board."
20712081
#endif
20722082
#if HOTENDS > 5
2073-
#if TEMP_SENSOR_5 == 0
2083+
#if TEMP_SENSOR_5 == 100
2084+
#error "TEMP_SENSOR_5 can't use Soc temperature sensor."
2085+
#elif TEMP_SENSOR_5 == 0
20742086
#error "TEMP_SENSOR_5 is required with 6 HOTENDS."
20752087
#elif !HAS_HEATER_5
20762088
#error "HEATER_5_PIN not defined for this board."
20772089
#elif !PIN_EXISTS(TEMP_5) && !TEMP_SENSOR_5_IS_DUMMY
20782090
#error "TEMP_5_PIN not defined for this board."
20792091
#endif
20802092
#if HOTENDS > 6
2081-
#if TEMP_SENSOR_6 == 0
2093+
#if TEMP_SENSOR_6 == 100
2094+
#error "TEMP_SENSOR_6 can't use Soc temperature sensor."
2095+
#elif TEMP_SENSOR_6 == 0
20822096
#error "TEMP_SENSOR_6 is required with 6 HOTENDS."
20832097
#elif !HAS_HEATER_6
20842098
#error "HEATER_6_PIN not defined for this board."
20852099
#elif !PIN_EXISTS(TEMP_6) && !TEMP_SENSOR_6_IS_DUMMY
20862100
#error "TEMP_6_PIN not defined for this board."
20872101
#endif
20882102
#if HOTENDS > 7
2089-
#if TEMP_SENSOR_7 == 0
2103+
#if TEMP_SENSOR_7 == 100
2104+
#error "TEMP_SENSOR_7 can't use Soc temperature sensor."
2105+
#elif TEMP_SENSOR_7 == 0
20902106
#error "TEMP_SENSOR_7 is required with 7 HOTENDS."
20912107
#elif !HAS_HEATER_7
20922108
#error "HEATER_7_PIN not defined for this board."
@@ -2109,28 +2125,42 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
21092125
/**
21102126
* Pins must be set for temp sensors, with some other feature requirements.
21112127
*/
2112-
#if TEMP_SENSOR_CHAMBER && !PIN_EXISTS(TEMP_CHAMBER)
2113-
#error "TEMP_SENSOR_CHAMBER requires TEMP_CHAMBER_PIN."
2128+
#if TEMP_SENSOR_BED == 100
2129+
#error "TEMP_SENSOR_BED can't use Soc temperature sensor."
2130+
#endif
2131+
2132+
#if TEMP_SENSOR_CHAMBER
2133+
#if TEMP_SENSOR_CHAMBER == 100
2134+
#error "TEMP_SENSOR_CHAMBER can't use Soc temperature sensor."
2135+
#elif !PIN_EXISTS(TEMP_CHAMBER)
2136+
#error "TEMP_SENSOR_CHAMBER requires TEMP_CHAMBER_PIN."
2137+
#endif
21142138
#endif
21152139

21162140
#if TEMP_SENSOR_COOLER
2117-
#if !PIN_EXISTS(TEMP_COOLER)
2141+
#if TEMP_SENSOR_COOLER == 100
2142+
#error "TEMP_SENSOR_COOLER can't use Soc temperature sensor."
2143+
#elif !PIN_EXISTS(TEMP_COOLER)
21182144
#error "TEMP_SENSOR_COOLER requires TEMP_COOLER_PIN."
21192145
#elif DISABLED(LASER_FEATURE)
21202146
#error "TEMP_SENSOR_COOLER requires LASER_FEATURE."
21212147
#endif
21222148
#endif
21232149

21242150
#if TEMP_SENSOR_PROBE
2125-
#if !PIN_EXISTS(TEMP_PROBE)
2151+
#if TEMP_SENSOR_PROBE == 100
2152+
#error "TEMP_SENSOR_PROBE can't use Soc temperature sensor."
2153+
#elif !PIN_EXISTS(TEMP_PROBE)
21262154
#error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN."
21272155
#elif DISABLED(FIX_MOUNTED_PROBE)
21282156
#error "TEMP_SENSOR_PROBE shouldn't be set without FIX_MOUNTED_PROBE."
21292157
#endif
21302158
#endif
21312159

21322160
#if TEMP_SENSOR_BOARD
2133-
#if !PIN_EXISTS(TEMP_BOARD)
2161+
#if TEMP_SENSOR_BOARD == 100
2162+
#error "TEMP_SENSOR_BOARD can't use Soc temperature sensor."
2163+
#elif !PIN_EXISTS(TEMP_BOARD)
21342164
#error "TEMP_SENSOR_BOARD requires TEMP_BOARD_PIN."
21352165
#elif ENABLED(THERMAL_PROTECTION_BOARD) && (!defined(BOARD_MINTEMP) || !defined(BOARD_MAXTEMP))
21362166
#error "THERMAL_PROTECTION_BOARD requires BOARD_MINTEMP and BOARD_MAXTEMP."
@@ -2140,7 +2170,9 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
21402170
#endif
21412171

21422172
#if TEMP_SENSOR_SOC
2143-
#if !PIN_EXISTS(TEMP_SOC)
2173+
#if TEMP_SENSOR_SOC != 100
2174+
#error "TEMP_SENSOR_SOC requires TEMP_SENSOR_SOC 100."
2175+
#elif !PIN_EXISTS(TEMP_SOC)
21442176
#error "TEMP_SENSOR_SOC requires TEMP_SOC_PIN."
21452177
#elif ENABLED(THERMAL_PROTECTION_SOC) && !defined(SOC_MAXTEMP)
21462178
#error "THERMAL_PROTECTION_SOC requires SOC_MAXTEMP."

0 commit comments

Comments
 (0)