From 48e30b3030dcde8f4016d080b0f3f868c4a08d8e Mon Sep 17 00:00:00 2001 From: JohSchneider Date: Thu, 14 May 2020 03:24:47 +0000 Subject: [PATCH] Audio enable corrections (Part 4) (#8974) * audio-configuration: throw a compile error on AUDIO_ENABLE=yes with no output pin configured relevant for avr boards, arm currently implicitly uses A4/A5 * audio-configuration: add Changelog entry * audio-configuration: remove stray newline --- docs/ChangeLog/20200530/PR8974.md | 2 ++ quantum/audio/audio_avr.c | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 docs/ChangeLog/20200530/PR8974.md diff --git a/docs/ChangeLog/20200530/PR8974.md b/docs/ChangeLog/20200530/PR8974.md new file mode 100644 index 000000000000..269636d1b1be --- /dev/null +++ b/docs/ChangeLog/20200530/PR8974.md @@ -0,0 +1,2 @@ +## fixing wrong configuration of AUDIO feature +add a compile-time error to alert the user to a missing pin-configuration (on AVR boards) when AUDIO_ENABLE=yes is set diff --git a/quantum/audio/audio_avr.c b/quantum/audio/audio_avr.c index 781378788c63..5a96bf64393c 100644 --- a/quantum/audio/audio_avr.c +++ b/quantum/audio/audio_avr.c @@ -110,6 +110,11 @@ # define TIMER_1_DUTY_CYCLE OCR1C # define TIMER1_AUDIO_vect TIMER1_COMPC_vect #endif + +#if !defined(BPIN_AUDIO) && !defined(CPIN_AUDIO) +# error "Audio feature enabled, but no suitable pin selected - see docs/feature_audio.md under the AVR settings for available options." +#endif + // ----------------------------------------------------------------------------- int voices = 0;