Skip to content

Commit

Permalink
🐛 Fix PTC/BTC whole number tests (MarlinFirmware#22255)
Browse files Browse the repository at this point in the history
  • Loading branch information
slowbro authored and thinkyhead committed Jun 29, 2021
1 parent 3109a29 commit b1c5dd9
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -593,24 +593,29 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
#endif

#ifdef PTC_SAMPLE_START
constexpr int _ptc_sample_start = PTC_SAMPLE_START;
static_assert(_test_ptc_sample_start != PTC_SAMPLE_START, "PTC_SAMPLE_START must be a whole number.");
constexpr 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 must be a whole number.");
#endif
#ifdef PTC_SAMPLE_RES
constexpr int _ptc_sample_res = PTC_SAMPLE_END;
static_assert(_test_ptc_sample_res != PTC_SAMPLE_END, "PTC_SAMPLE_RES must be a whole number.");
constexpr auto _ptc_sample_res = PTC_SAMPLE_RES;
constexpr decltype(_ptc_sample_res) _test_ptc_sample_res = 12.3f;
static_assert(_test_ptc_sample_res != 12.3f, "PTC_SAMPLE_RES must be a whole number.");
#endif
#ifdef BTC_SAMPLE_START
constexpr int _btc_sample_start = BTC_SAMPLE_START;
static_assert(_test_btc_sample_start != BTC_SAMPLE_START, "BTC_SAMPLE_START must be a whole number.");
constexpr 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 must be a whole number.");
#endif
#ifdef BTC_SAMPLE_RES
constexpr int _btc_sample_res = BTC_SAMPLE_END;
static_assert(_test_btc_sample_res != BTC_SAMPLE_END, "BTC_SAMPLE_RES must be a whole number.");
constexpr _btc_sample_res = BTC_SAMPLE_RES;
constexpr decltype(_btc_sample_res) _test_btc_sample_res = 12.3f;
static_assert(_test_btc_sample_res != 12.3f, "BTC_SAMPLE_RES must be a whole number.");
#endif
#ifdef BTC_PROBE_TEMP
constexpr int _btc_probe_temp = BTC_PROBE_TEMP;
static_assert(_test_btc_probe_temp != BTC_PROBE_TEMP, "BTC_PROBE_TEMP must be a whole number.");
constexpr 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_PROBE_TEMP must be a whole number.");
#endif
#endif

Expand Down

0 comments on commit b1c5dd9

Please sign in to comment.