Переглянути джерело

🐛 Fix PTC/BTC whole number tests (#22255)

Katelyn Schiesser 4 роки тому
джерело
коміт
c15d9e5b42
Аккаунт користувача з таким Email не знайдено
1 змінених файлів з 15 додано та 10 видалено
  1. 15
    10
      Marlin/src/inc/SanityCheck.h

+ 15
- 10
Marlin/src/inc/SanityCheck.h Переглянути файл

@@ -593,24 +593,29 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
593 593
   #endif
594 594
 
595 595
   #ifdef PTC_SAMPLE_START
596
-    constexpr int _ptc_sample_start = PTC_SAMPLE_START;
597
-    static_assert(_test_ptc_sample_start != PTC_SAMPLE_START, "PTC_SAMPLE_START must be a whole number.");
596
+    constexpr auto _ptc_sample_start = PTC_SAMPLE_START;
597
+    constexpr decltype(_ptc_sample_start) _test_ptc_sample_start = 12.3f;
598
+    static_assert(_test_ptc_sample_start != 12.3f, "PTC_SAMPLE_START must be a whole number.");
598 599
   #endif
599 600
   #ifdef PTC_SAMPLE_RES
600
-    constexpr int _ptc_sample_res = PTC_SAMPLE_END;
601
-    static_assert(_test_ptc_sample_res != PTC_SAMPLE_END, "PTC_SAMPLE_RES must be a whole number.");
601
+    constexpr auto _ptc_sample_res = PTC_SAMPLE_RES;
602
+    constexpr decltype(_ptc_sample_res) _test_ptc_sample_res = 12.3f;
603
+    static_assert(_test_ptc_sample_res != 12.3f, "PTC_SAMPLE_RES must be a whole number.");
602 604
   #endif
603 605
   #ifdef BTC_SAMPLE_START
604
-    constexpr int _btc_sample_start = BTC_SAMPLE_START;
605
-    static_assert(_test_btc_sample_start != BTC_SAMPLE_START, "BTC_SAMPLE_START must be a whole number.");
606
+    constexpr auto _btc_sample_start = BTC_SAMPLE_START;
607
+    constexpr decltype(_btc_sample_start) _test_btc_sample_start = 12.3f;
608
+    static_assert(_test_btc_sample_start != 12.3f, "BTC_SAMPLE_START must be a whole number.");
606 609
   #endif
607 610
   #ifdef BTC_SAMPLE_RES
608
-    constexpr int _btc_sample_res = BTC_SAMPLE_END;
609
-    static_assert(_test_btc_sample_res != BTC_SAMPLE_END, "BTC_SAMPLE_RES must be a whole number.");
611
+    constexpr _btc_sample_res = BTC_SAMPLE_RES;
612
+    constexpr decltype(_btc_sample_res) _test_btc_sample_res = 12.3f;
613
+    static_assert(_test_btc_sample_res != 12.3f, "BTC_SAMPLE_RES must be a whole number.");
610 614
   #endif
611 615
   #ifdef BTC_PROBE_TEMP
612
-    constexpr int _btc_probe_temp = BTC_PROBE_TEMP;
613
-    static_assert(_test_btc_probe_temp != BTC_PROBE_TEMP, "BTC_PROBE_TEMP must be a whole number.");
616
+    constexpr auto _btc_probe_temp = BTC_PROBE_TEMP;
617
+    constexpr decltype(_btc_probe_temp) _test_btc_probe_temp = 12.3f;
618
+    static_assert(_test_btc_probe_temp != 12.3f, "BTC_PROBE_TEMP must be a whole number.");
614 619
   #endif
615 620
 #endif
616 621
 

Завантаження…
Відмінити
Зберегти