diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 2a7f06c7334a..b65bc3e026c3 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1963,19 +1963,19 @@ // Probe temperature calibration generates a table of values starting at PTC_SAMPLE_START // (e.g. 30), in steps of PTC_SAMPLE_RES (e.g. 5) with PTC_SAMPLE_COUNT (e.g. 10) samples. - //#define PTC_SAMPLE_START 30.0f - //#define PTC_SAMPLE_RES 5.0f - //#define PTC_SAMPLE_COUNT 10U + //#define PTC_SAMPLE_START 30 + //#define PTC_SAMPLE_RES 5 + //#define PTC_SAMPLE_COUNT 10 // Bed temperature calibration builds a similar table. - //#define BTC_SAMPLE_START 60.0f - //#define BTC_SAMPLE_RES 5.0f - //#define BTC_SAMPLE_COUNT 10U + //#define BTC_SAMPLE_START 60 + //#define BTC_SAMPLE_RES 5 + //#define BTC_SAMPLE_COUNT 10 // The temperature the probe should be at while taking measurements during bed temperature // calibration. - //#define BTC_PROBE_TEMP 30.0f + //#define BTC_PROBE_TEMP 30 // Height above Z=0.0f to raise the nozzle. Lowering this can help the probe to heat faster. // Note: the Z=0.0f offset is determined by the probe offset which can be set using M851. @@ -1984,7 +1984,7 @@ // Height to raise the Z-probe between heating and taking the next measurement. Some probes // may fail to untrigger if they have been triggered for a long time, which can be solved by // increasing the height the probe is raised to. - //#define PTC_PROBE_RAISE 15U + //#define PTC_PROBE_RAISE 15 // If the probe is outside of the defined range, use linear extrapolation using the closest // point and the PTC_LINEAR_EXTRAPOLATION'th next point. E.g. if set to 4 it will use data[0] diff --git a/Marlin/src/feature/probe_temp_comp.h b/Marlin/src/feature/probe_temp_comp.h index 2e5ae85a43a2..f5f922410c17 100644 --- a/Marlin/src/feature/probe_temp_comp.h +++ b/Marlin/src/feature/probe_temp_comp.h @@ -47,7 +47,7 @@ typedef struct { // Probe temperature calibration constants #ifndef PTC_SAMPLE_COUNT - #define PTC_SAMPLE_COUNT 10U + #define PTC_SAMPLE_COUNT 10 #endif #ifndef PTC_SAMPLE_RES #define PTC_SAMPLE_RES 5 @@ -55,14 +55,14 @@ typedef struct { #ifndef PTC_SAMPLE_START #define PTC_SAMPLE_START 30 #endif -#define PTC_SAMPLE_END ((PTC_SAMPLE_START) + (PTC_SAMPLE_COUNT) * (PTC_SAMPLE_RES)) +#define PTC_SAMPLE_END (PTC_SAMPLE_START + (PTC_SAMPLE_COUNT) * PTC_SAMPLE_RES) // Bed temperature calibration constants #ifndef BTC_PROBE_TEMP #define BTC_PROBE_TEMP 30 #endif #ifndef BTC_SAMPLE_COUNT - #define BTC_SAMPLE_COUNT 10U + #define BTC_SAMPLE_COUNT 10 #endif #ifndef BTC_SAMPLE_RES #define BTC_SAMPLE_RES 5 @@ -70,7 +70,7 @@ typedef struct { #ifndef BTC_SAMPLE_START #define BTC_SAMPLE_START 60 #endif -#define BTC_SAMPLE_END ((BTC_SAMPLE_START) + (BTC_SAMPLE_COUNT) * (BTC_SAMPLE_RES)) +#define BTC_SAMPLE_END (BTC_SAMPLE_START + (BTC_SAMPLE_COUNT) * BTC_SAMPLE_RES) #ifndef PTC_PROBE_HEATING_OFFSET #define PTC_PROBE_HEATING_OFFSET 0.5f diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 41d123326c36..8568e4cba12f 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -577,6 +577,36 @@ constexpr float arm[] = AXIS_RELATIVE_MODES; static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements."); +#ifdef PTC_SAMPLE_START + auto _ptc_sample_start = PTC_SAMPLE_START; + constexpr decltype(_ptc_sample_start) _test_ptc_sample_start = 12.3f; + static_assert( _test_ptc_sample_start != 12.3f , "PTC_SAMPLE_START should not be a float; use whole numbers only."); +#endif + +#ifdef PTC_SAMPLE_RES + auto _ptc_sample_res = PTC_SAMPLE_END; + constexpr decltype(_ptc_sample_res) _test_ptc_sample_res = 12.3f; + static_assert( _test_ptc_sample_res != 12.3f , "PTC_SAMPLE_RES should not be a float; use whole numbers only."); +#endif + +#ifdef BTC_SAMPLE_START + auto _btc_sample_start = BTC_SAMPLE_START; + constexpr decltype(_btc_sample_start) _test_btc_sample_start = 12.3f; + static_assert( _test_btc_sample_start != 12.3f , "BTC_SAMPLE_START should not be a float; use whole numbers only."); +#endif + +#ifdef BTC_SAMPLE_RES + auto _btc_sample_res = BTC_SAMPLE_END; + constexpr decltype(_btc_sample_res) _test_btc_sample_res = 12.3f; + static_assert( _test_btc_sample_res != 12.3f , "BTC_SAMPLE_RES should not be a float; use whole numbers only."); +#endif + +#ifdef BTC_PROBE_TEMP + auto _btc_probe_temp = BTC_PROBE_TEMP; + constexpr decltype(_btc_probe_temp) _test_btc_probe_temp = 12.3f; + static_assert( _test_btc_probe_temp != 12.3f , "BTC_SAMPLE_RES should not be a float; use whole numbers only."); +#endif + /** * Probe temp compensation requirements */