Browse Source

Sanity check that auto fan pins can do PWM

Scott Lahteine 8 years ago
parent
commit
ad38d91692
1 changed files with 17 additions and 0 deletions
  1. 17
    0
      Marlin/SanityCheck.h

+ 17
- 0
Marlin/SanityCheck.h View File

@@ -871,6 +871,23 @@
871 871
 #endif
872 872
 
873 873
 /**
874
+ * Auto Fan check for PWM pins
875
+ */
876
+#if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255
877
+  #define AF_ERR_SUFF "_AUTO_FAN_PIN is not a PWM pin. Set EXTRUDER_AUTO_FAN_SPEED to 255."
878
+  #if HAS_AUTO_FAN_0
879
+    static_assert(GET_TIMER(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF);
880
+  #elif HAS_AUTO_FAN_1
881
+    static_assert(GET_TIMER(E1_AUTO_FAN_PIN), "E1" AF_ERR_SUFF);
882
+  #elif HAS_AUTO_FAN_2
883
+    static_assert(GET_TIMER(E2_AUTO_FAN_PIN), "E2" AF_ERR_SUFF);
884
+  #elif HAS_AUTO_FAN_3
885
+    static_assert(GET_TIMER(E3_AUTO_FAN_PIN), "E3" AF_ERR_SUFF);
886
+  #endif
887
+#endif
888
+
889
+
890
+/**
874 891
  * Make sure only one display is enabled
875 892
  *
876 893
  * Note: BQ_LCD_SMART_CONTROLLER => REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER

Loading…
Cancel
Save