Browse Source

🔧 Sanity-check AVR D9 Fan PWM / SPEAKER Timer2 (#23672)

Mike La Spina 2 years ago
parent
commit
8e8409ed67
No account linked to committer's email address
2 changed files with 10 additions and 2 deletions
  1. 9
    1
      Marlin/src/HAL/AVR/inc/SanityCheck.h
  2. 1
    1
      Marlin/src/inc/SanityCheck.h

+ 9
- 1
Marlin/src/HAL/AVR/inc/SanityCheck.h View File

@@ -29,7 +29,15 @@
29 29
  * Checks for FAST PWM
30 30
  */
31 31
 #if ALL(FAST_PWM_FAN, USE_OCR2A_AS_TOP, HAS_TCCR2)
32
-  #error "USE_OCR2A_AS_TOP does not apply to devices with a single output TIMER2"
32
+  #error "USE_OCR2A_AS_TOP does not apply to devices with a single output TIMER2."
33
+#endif
34
+
35
+/**
36
+ * Checks for SOFT PWM
37
+ */
38
+#if HAS_FAN0 && FAN_PIN == 9 && DISABLED(FAN_SOFT_PWM) && ENABLED(SPEAKER)
39
+  #error "FAN_PIN 9 Hardware PWM uses Timer 2 which conflicts with Arduino AVR Tone Timer (for SPEAKER)."
40
+  #error "Disable SPEAKER or enable FAN_SOFT_PWM."
33 41
 #endif
34 42
 
35 43
 /**

+ 1
- 1
Marlin/src/inc/SanityCheck.h View File

@@ -2018,7 +2018,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
2018 2018
   #if CONTROLLER_FAN_PIN == FAN_PIN
2019 2019
     #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN."
2020 2020
   #elif ENABLED(FAN_SOFT_PWM_REQUIRED) && DISABLED(FAN_SOFT_PWM)
2021
-    #error "FAN_SOFT_PWM is required. Enable it to continue."
2021
+    #error "FAN_SOFT_PWM is required for your board. Enable it to continue."
2022 2022
   #endif
2023 2023
 #endif
2024 2024
 

Loading…
Cancel
Save