Skip to content

Commit

Permalink
🔧 Thermistor 100 : SoC sensor (MarlinFirmware#25745)
Browse files Browse the repository at this point in the history
  • Loading branch information
GMagician authored and EvilGremlin committed May 8, 2023
1 parent ef951f0 commit 2caf052
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 12 deletions.
5 changes: 5 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,11 @@
* -1 : AD595 with Thermocouple
*
* ================================================================
* SoC internal sensor
* ================================================================
* 100 : SoC internal sensor
*
* ================================================================
* Custom/Dummy/Other Thermal Sensors
* ================================================================
* 0 : not used
Expand Down
56 changes: 44 additions & 12 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -2029,6 +2029,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
#error "HEATER_0_PIN not defined for this board."
#elif TEMP_SENSOR_IS_MAX_TC(0) && !PIN_EXISTS(TEMP_0_CS)
#error "TEMP_SENSOR_0 MAX thermocouple requires TEMP_0_CS_PIN."
#elif TEMP_SENSOR_0 == 100
#error "TEMP_SENSOR_0 can't use Soc temperature sensor."
#elif TEMP_SENSOR_0 == 0
#error "TEMP_SENSOR_0 is required with 1 or more HOTENDS."
#elif !ANY_PIN(TEMP_0, TEMP_0_CS) && !TEMP_SENSOR_0_IS_DUMMY
Expand All @@ -2040,53 +2042,67 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
#if HAS_MULTI_HOTEND
#if TEMP_SENSOR_IS_MAX_TC(1) && !PIN_EXISTS(TEMP_1_CS)
#error "TEMP_SENSOR_1 MAX thermocouple requires TEMP_1_CS_PIN."
#elif TEMP_SENSOR_1 == 100
#error "TEMP_SENSOR_1 can't use Soc temperature sensor."
#elif TEMP_SENSOR_1 == 0
#error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
#elif !ANY_PIN(TEMP_1, TEMP_1_CS) && !TEMP_SENSOR_1_IS_DUMMY
#error "TEMP_1_PIN or TEMP_1_CS_PIN not defined for this board."
#endif
#if HOTENDS > 2
#if TEMP_SENSOR_2 == 0
#if TEMP_SENSOR_2 == 100
#error "TEMP_SENSOR_2 can't use Soc temperature sensor."
#elif TEMP_SENSOR_2 == 0
#error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
#elif !HAS_HEATER_2
#error "HEATER_2_PIN not defined for this board."
#elif !ANY_PIN(TEMP_2, TEMP_2_CS) && !TEMP_SENSOR_2_IS_DUMMY
#error "TEMP_2_PIN or TEMP_2_CS_PIN not defined for this board."
#endif
#if HOTENDS > 3
#if TEMP_SENSOR_3 == 0
#if TEMP_SENSOR_3 == 100
#error "TEMP_SENSOR_3 can't use Soc temperature sensor."
#elif TEMP_SENSOR_3 == 0
#error "TEMP_SENSOR_3 is required with 4 or more HOTENDS."
#elif !HAS_HEATER_3
#error "HEATER_3_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_3) && !TEMP_SENSOR_3_IS_DUMMY
#error "TEMP_3_PIN not defined for this board."
#endif
#if HOTENDS > 4
#if TEMP_SENSOR_4 == 0
#if TEMP_SENSOR_4 == 100
#error "TEMP_SENSOR_4 can't use Soc temperature sensor."
#elif TEMP_SENSOR_4 == 0
#error "TEMP_SENSOR_4 is required with 5 or more HOTENDS."
#elif !HAS_HEATER_4
#error "HEATER_4_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_4) && !TEMP_SENSOR_4_IS_DUMMY
#error "TEMP_4_PIN not defined for this board."
#endif
#if HOTENDS > 5
#if TEMP_SENSOR_5 == 0
#if TEMP_SENSOR_5 == 100
#error "TEMP_SENSOR_5 can't use Soc temperature sensor."
#elif TEMP_SENSOR_5 == 0
#error "TEMP_SENSOR_5 is required with 6 HOTENDS."
#elif !HAS_HEATER_5
#error "HEATER_5_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_5) && !TEMP_SENSOR_5_IS_DUMMY
#error "TEMP_5_PIN not defined for this board."
#endif
#if HOTENDS > 6
#if TEMP_SENSOR_6 == 0
#if TEMP_SENSOR_6 == 100
#error "TEMP_SENSOR_6 can't use Soc temperature sensor."
#elif TEMP_SENSOR_6 == 0
#error "TEMP_SENSOR_6 is required with 6 HOTENDS."
#elif !HAS_HEATER_6
#error "HEATER_6_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_6) && !TEMP_SENSOR_6_IS_DUMMY
#error "TEMP_6_PIN not defined for this board."
#endif
#if HOTENDS > 7
#if TEMP_SENSOR_7 == 0
#if TEMP_SENSOR_7 == 100
#error "TEMP_SENSOR_7 can't use Soc temperature sensor."
#elif TEMP_SENSOR_7 == 0
#error "TEMP_SENSOR_7 is required with 7 HOTENDS."
#elif !HAS_HEATER_7
#error "HEATER_7_PIN not defined for this board."
Expand All @@ -2109,28 +2125,42 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
/**
* Pins must be set for temp sensors, with some other feature requirements.
*/
#if TEMP_SENSOR_CHAMBER && !PIN_EXISTS(TEMP_CHAMBER)
#error "TEMP_SENSOR_CHAMBER requires TEMP_CHAMBER_PIN."
#if TEMP_SENSOR_BED == 100
#error "TEMP_SENSOR_BED can't use Soc temperature sensor."
#endif

#if TEMP_SENSOR_CHAMBER
#if TEMP_SENSOR_CHAMBER == 100
#error "TEMP_SENSOR_CHAMBER can't use Soc temperature sensor."
#elif !PIN_EXISTS(TEMP_CHAMBER)
#error "TEMP_SENSOR_CHAMBER requires TEMP_CHAMBER_PIN."
#endif
#endif

#if TEMP_SENSOR_COOLER
#if !PIN_EXISTS(TEMP_COOLER)
#if TEMP_SENSOR_COOLER == 100
#error "TEMP_SENSOR_COOLER can't use Soc temperature sensor."
#elif !PIN_EXISTS(TEMP_COOLER)
#error "TEMP_SENSOR_COOLER requires TEMP_COOLER_PIN."
#elif DISABLED(LASER_FEATURE)
#error "TEMP_SENSOR_COOLER requires LASER_FEATURE."
#endif
#endif

#if TEMP_SENSOR_PROBE
#if !PIN_EXISTS(TEMP_PROBE)
#if TEMP_SENSOR_PROBE == 100
#error "TEMP_SENSOR_PROBE can't use Soc temperature sensor."
#elif !PIN_EXISTS(TEMP_PROBE)
#error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN."
#elif DISABLED(FIX_MOUNTED_PROBE)
#error "TEMP_SENSOR_PROBE shouldn't be set without FIX_MOUNTED_PROBE."
#endif
#endif

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

#if TEMP_SENSOR_SOC
#if !PIN_EXISTS(TEMP_SOC)
#if TEMP_SENSOR_SOC != 100
#error "TEMP_SENSOR_SOC requires TEMP_SENSOR_SOC 100."
#elif !PIN_EXISTS(TEMP_SOC)
#error "TEMP_SENSOR_SOC requires TEMP_SOC_PIN."
#elif ENABLED(THERMAL_PROTECTION_SOC) && !defined(SOC_MAXTEMP)
#error "THERMAL_PROTECTION_SOC requires SOC_MAXTEMP."
Expand Down

0 comments on commit 2caf052

Please sign in to comment.