summaryrefslogtreecommitdiff
path: root/quantum/audio
diff options
context:
space:
mode:
authorErovia <Erovia@users.noreply.github.com>2021-05-26 20:49:30 +0200
committerGitHub <noreply@github.com>2021-05-26 20:49:30 +0200
commit8ba537fa23aa1520949981f1afe1a71338bf8a7a (patch)
tree5f91dde22e11e39cbe99062267a3d96ab1df027a /quantum/audio
parent0211e3003280a52e5f0ce262cfe347aeb68be722 (diff)
downloadqmk_firmware-8ba537fa23aa1520949981f1afe1a71338bf8a7a.tar.gz
qmk_firmware-8ba537fa23aa1520949981f1afe1a71338bf8a7a.zip
Keyboard: Planck THK (#12597)
Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Jack Humbert <jack.humb@gmail.com> Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'quantum/audio')
-rw-r--r--quantum/audio/driver_avr_pwm_hardware.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/quantum/audio/driver_avr_pwm_hardware.c b/quantum/audio/driver_avr_pwm_hardware.c
index 492b9bfb04..df03a4558c 100644
--- a/quantum/audio/driver_avr_pwm_hardware.c
+++ b/quantum/audio/driver_avr_pwm_hardware.c
@@ -40,7 +40,7 @@ extern uint8_t note_timbre;
alternatively, the PWM pins on PORTB can be used as only/primary speaker
*/
-#if defined(AUDIO_PIN) && (AUDIO_PIN != C4) && (AUDIO_PIN != C5) && (AUDIO_PIN != C6) && (AUDIO_PIN != B5) && (AUDIO_PIN != B6) && (AUDIO_PIN != B7)
+#if defined(AUDIO_PIN) && (AUDIO_PIN != C4) && (AUDIO_PIN != C5) && (AUDIO_PIN != C6) && (AUDIO_PIN != B5) && (AUDIO_PIN != B6) && (AUDIO_PIN != B7) && (AUDIO_PIN != D5)
# error "Audio feature enabled, but no suitable pin selected as AUDIO_PIN - see docs/feature_audio under the AVR settings for available options."
#endif
@@ -94,7 +94,7 @@ extern uint8_t note_timbre;
# error "Audio feature: the pin selected as AUDIO_PIN_ALT is not supported."
#endif
-#if (AUDIO_PIN == B5) || (AUDIO_PIN == B6) || (AUDIO_PIN == B7) || (AUDIO_PIN_ALT == B5) || (AUDIO_PIN_ALT == B6) || (AUDIO_PIN_ALT == B7)
+#if (AUDIO_PIN == B5) || (AUDIO_PIN == B6) || (AUDIO_PIN == B7) || (AUDIO_PIN_ALT == B5) || (AUDIO_PIN_ALT == B6) || (AUDIO_PIN_ALT == B7) || (AUDIO_PIN == D5)
# define AUDIO2_PIN_SET
# define AUDIO2_TIMSKx TIMSK1
# define AUDIO2_TCCRxA TCCR1A
@@ -129,6 +129,16 @@ extern uint8_t note_timbre;
# define AUDIO2_OCRxy OCR1C
# define AUDIO2_PIN B7
# define AUDIO2_TIMERx_COMPy_vect TIMER1_COMPC_vect
+# elif (AUDIO_PIN == D5) && defined(__AVR_ATmega32A__)
+# pragma message "Audio support for ATmega32A is experimental and can cause crashes."
+# undef AUDIO2_TIMSKx
+# define AUDIO2_TIMSKx TIMSK
+# define AUDIO2_COMxy0 COM1A0
+# define AUDIO2_COMxy1 COM1A1
+# define AUDIO2_OCIExy OCIE1A
+# define AUDIO2_OCRxy OCR1A
+# define AUDIO2_PIN D5
+# define AUDIO2_TIMERx_COMPy_vect TIMER1_COMPA_vect
# endif
#endif