Skip to content

Commit 5634b22

Browse files
thisiskeithbLCh-77
authored andcommitted
🔧 Assert Probe Temp Comp requirements (MarlinFirmware#24468)
1 parent b7163f3 commit 5634b22

File tree

2 files changed

+37
-35
lines changed

2 files changed

+37
-35
lines changed

Marlin/src/inc/Conditionals_adv.h

-10
Original file line numberDiff line numberDiff line change
@@ -560,16 +560,6 @@
560560
#endif
561561
#endif
562562

563-
// Probe Temperature Compensation
564-
#if !TEMP_SENSOR_PROBE
565-
#undef PTC_PROBE
566-
#endif
567-
#if !TEMP_SENSOR_BED
568-
#undef PTC_BED
569-
#endif
570-
#if !HAS_EXTRUDERS
571-
#undef PTC_HOTEND
572-
#endif
573563
#if ANY(PTC_PROBE, PTC_BED, PTC_HOTEND)
574564
#define HAS_PTC 1
575565
#endif

Marlin/src/inc/SanityCheck.h

+37-25
Original file line numberDiff line numberDiff line change
@@ -666,34 +666,46 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
666666
#endif
667667
#endif
668668

669-
#ifdef PTC_PROBE_START
670-
constexpr auto _ptc_sample_start = PTC_PROBE_START;
671-
constexpr decltype(_ptc_sample_start) _test_ptc_sample_start = 12.3f;
672-
static_assert(_test_ptc_sample_start != 12.3f, "PTC_PROBE_START must be a whole number.");
673-
#endif
674-
#ifdef PTC_PROBE_RES
675-
constexpr auto _ptc_sample_res = PTC_PROBE_RES;
676-
constexpr decltype(_ptc_sample_res) _test_ptc_sample_res = 12.3f;
677-
static_assert(_test_ptc_sample_res != 12.3f, "PTC_PROBE_RES must be a whole number.");
678-
#endif
679-
#ifdef PTC_BED_START
680-
constexpr auto _btc_sample_start = PTC_BED_START;
681-
constexpr decltype(_btc_sample_start) _test_btc_sample_start = 12.3f;
682-
static_assert(_test_btc_sample_start != 12.3f, "PTC_BED_START must be a whole number.");
683-
#endif
684-
#ifdef PTC_BED_RES
685-
constexpr auto _btc_sample_res = PTC_BED_RES;
686-
constexpr decltype(_btc_sample_res) _test_btc_sample_res = 12.3f;
687-
static_assert(_test_btc_sample_res != 12.3f, "PTC_BED_RES must be a whole number.");
688-
#endif
689-
#ifdef PTC_PROBE_TEMP
690-
constexpr auto _btc_probe_temp = PTC_PROBE_TEMP;
691-
constexpr decltype(_btc_probe_temp) _test_btc_probe_temp = 12.3f;
692-
static_assert(_test_btc_probe_temp != 12.3f, "PTC_PROBE_TEMP must be a whole number.");
669+
#if ENABLED(PTC_PROBE)
670+
#if !TEMP_SENSOR_PROBE
671+
#error "PTC_PROBE requires a probe with a thermistor."
672+
#endif
673+
#ifdef PTC_PROBE_START
674+
constexpr auto _ptc_sample_start = PTC_PROBE_START;
675+
constexpr decltype(_ptc_sample_start) _test_ptc_sample_start = 12.3f;
676+
static_assert(_test_ptc_sample_start != 12.3f, "PTC_PROBE_START must be a whole number.");
677+
#endif
678+
#ifdef PTC_PROBE_RES
679+
constexpr auto _ptc_sample_res = PTC_PROBE_RES;
680+
constexpr decltype(_ptc_sample_res) _test_ptc_sample_res = 12.3f;
681+
static_assert(_test_ptc_sample_res != 12.3f, "PTC_PROBE_RES must be a whole number.");
682+
#endif
683+
#if ENABLED(PTC_BED) && defined(PTC_PROBE_TEMP)
684+
constexpr auto _btc_probe_temp = PTC_PROBE_TEMP;
685+
constexpr decltype(_btc_probe_temp) _test_btc_probe_temp = 12.3f;
686+
static_assert(_test_btc_probe_temp != 12.3f, "PTC_PROBE_TEMP must be a whole number.");
687+
#endif
688+
#endif
689+
690+
#if ENABLED(PTC_BED)
691+
#if !TEMP_SENSOR_BED
692+
#error "PTC_BED requires a bed with a thermistor."
693+
#endif
694+
#ifdef PTC_BED_START
695+
constexpr auto _btc_sample_start = PTC_BED_START;
696+
constexpr decltype(_btc_sample_start) _test_btc_sample_start = 12.3f;
697+
static_assert(_test_btc_sample_start != 12.3f, "PTC_BED_START must be a whole number.");
698+
#endif
699+
#ifdef PTC_BED_RES
700+
constexpr auto _btc_sample_res = PTC_BED_RES;
701+
constexpr decltype(_btc_sample_res) _test_btc_sample_res = 12.3f;
702+
static_assert(_test_btc_sample_res != 12.3f, "PTC_BED_RES must be a whole number.");
703+
#endif
693704
#endif
705+
694706
#if ENABLED(PTC_HOTEND)
695707
#if EXTRUDERS != 1
696-
#error "PTC_HOTEND only works with a single extruder."
708+
#error "PTC_HOTEND requires a single extruder."
697709
#endif
698710
#ifdef PTC_HOTEND_START
699711
constexpr auto _etc_sample_start = PTC_HOTEND_START;

0 commit comments

Comments
 (0)