Skip to content

Commit 62844c0

Browse files
JohSchneidernoroadsleft
authored andcommitted
Audio enable corrections (2/3) (qmk#8903)
* audio-configuration: fix avr boards with wrong configuration the audiopin with avr boards does not default to anything, if it is not set as a define in config.h, audio output won't work - even worse the compiler will include parts of the audio-system in the firmware, wasting space and possibly failing builds because of the firmware exceeding the maximum size * audio-configuration: add Changelog entry * audio-configuration: fix avr boards with wrong configuration the audiopin with avr boards does not default to anything, if it is not set as a define in config.h, audio output won't work - even worse the compiler will include parts of the audio-system in the firmware, wasting space and possibly failing builds because of the firmware exceeding the maximum size * audio-configuration: align comment changes with qmk#8901 * audio-configuration: changelow wording * audio-configuration: remove rules.mk since it now would change nothing compared to the keyboards base rule.mk
1 parent 009a55b commit 62844c0

File tree

18 files changed

+24
-17
lines changed

18 files changed

+24
-17
lines changed

docs/ChangeLog/20200530/PR8903.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## fixing wrong configuration of AUDIO feature
2+
3+
`audio_avr.c` does not default to any pin; there has to be a #define XX_AUDIO in config.h at some level for Audio to actually work. Otherwise, the Audio code ends up cluttering the firmware, possibly breaking builds because the maximum allowed firmware size is exceeded.
4+
5+
These changes fix this by disabling Audio on keyboards that have the feature misconfigured, and therefore non-functional.

keyboards/ckeys/handwire_101/config.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
158158
//#define MAGIC_KEY_SLEEP_LED Z
159159

160160
// Audio Click
161-
#define AUDIO_CLICKY
161+
//#define AUDIO_CLICKY
162162

163163
// Music Mode Polyphony
164164
// NOTE: Must change polyphony_rate to a number higher than 0 in voices.c
165-
#define AUDIO_VOICES
166-
#define PITCH_STANDARD_A 880.0f
165+
//#define AUDIO_VOICES
166+
//#define PITCH_STANDARD_A 880.0f
167167

168168
// Mouse keys
169169
#define MOUSEKEY_DELAY 0

keyboards/ckeys/handwire_101/rules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by d
2828
#MIDI_ENABLE = yes # MIDI controls
2929
UNICODE_ENABLE = no # Unicode
3030
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
31-
AUDIO_ENABLE = yes # Audio output on port C6
31+
AUDIO_ENABLE = no # Audio output
3232
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches

keyboards/clueboard/card/keymaps/default/keymap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ void matrix_scan_user(void) {
3838

3939
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
4040
switch (keycode) {
41+
#ifdef AUDIO_ENABLE
4142
case SONG_SU:
4243
if (record->event.pressed) {
4344
PLAY_SONG(tone_startup);
@@ -58,7 +59,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
5859
}
5960

6061
return false;
61-
62+
#endif
6263
default:
6364
return true;
6465
}

keyboards/clueboard/card/keymaps/default/rules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
1010
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
1111
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
1212
MIDI_ENABLE = no # MIDI controls
13-
AUDIO_ENABLE = yes # Audio output on port C6
13+
AUDIO_ENABLE = no # Audio output
1414
UNICODE_ENABLE = no # Unicode
1515
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
1616
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.

keyboards/eco/rules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
2323
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
2424
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
2525
MIDI_ENABLE = yes # MIDI controls
26-
AUDIO_ENABLE = yes # Audio output on port C6
26+
AUDIO_ENABLE = no # Audio output
2727
UNICODE_ENABLE = no # Unicode
2828
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
2929
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.

keyboards/navi10/rev3/rules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
2828
MIDI_ENABLE = no # MIDI support
2929
UNICODE_ENABLE = no # Unicode
3030
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
31-
AUDIO_ENABLE = yes # Audio output on port C6
31+
AUDIO_ENABLE = no # Audio output
3232
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
3333
HD44780_ENABLE = no # Enable support for HD44780 based LCDs

keyboards/planck/rev6/config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353

5454
#define MUSIC_MAP
5555
#undef AUDIO_VOICES
56+
// Note: following undef isn't really necessary on STM32, C6_AUDIO is AVR related
5657
#undef C6_AUDIO
5758

5859
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */

keyboards/planck/rev6/rules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
1414
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
1515
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
1616
MIDI_ENABLE = no # MIDI controls
17-
AUDIO_ENABLE = yes # Audio output on port C6
17+
AUDIO_ENABLE = yes # Audio output
1818
UNICODE_ENABLE = no # Unicode
1919
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
2020
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.

keyboards/preonic/rev1/rules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration
2323
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
2424
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
2525
MIDI_ENABLE = no # MIDI controls
26-
AUDIO_ENABLE = yes # Audio output on port C6
26+
AUDIO_ENABLE = yes # Audio output
2727
UNICODE_ENABLE = no # Unicode
2828
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
2929
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.

keyboards/preonic/rev2/rules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration
2323
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
2424
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
2525
MIDI_ENABLE = no # MIDI controls
26-
AUDIO_ENABLE = yes # Audio output on port C6
26+
AUDIO_ENABLE = yes # Audio output
2727
UNICODE_ENABLE = no # Unicode
2828
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
2929
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.

keyboards/preonic/rev3/config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
#define MUSIC_MAP
4242
#undef AUDIO_VOICES
43+
// Note: following undef isn't really necessary on STM32, C6_AUDIO is AVR related
4344
#undef C6_AUDIO
4445

4546
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */

keyboards/preonic/rev3/rules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
1414
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
1515
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
1616
MIDI_ENABLE = no # MIDI controls
17-
AUDIO_ENABLE = yes # Audio output on port C6
17+
AUDIO_ENABLE = yes # Audio output
1818
UNICODE_ENABLE = no # Unicode
1919
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
2020
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.

keyboards/scarletbandana/rules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ NKRO_ENABLE = no # USB Nkey Rollover
2626
MIDI_ENABLE = no # MIDI support
2727
UNICODE_ENABLE = no # Unicode
2828
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
29-
AUDIO_ENABLE = yes # Audio output on port C6
29+
AUDIO_ENABLE = yes # Audio output
3030
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
3131
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
3232
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality, also set ISSI_ENABLE below for Miera

keyboards/sck/neiso/rules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
2828
MIDI_ENABLE = no # MIDI support
2929
UNICODE_ENABLE = no # Unicode
3030
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
31-
AUDIO_ENABLE = yes # Audio output on port C6
31+
AUDIO_ENABLE = no # Audio output
3232
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
3333
HD44780_ENABLE = no # Enable support for HD44780 based LCDs

keyboards/subatomic/rules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration
2323
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
2424
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
2525
MIDI_ENABLE = yes # MIDI controls
26-
AUDIO_ENABLE = yes # Audio output on port C6
26+
AUDIO_ENABLE = no # Audio output
2727
UNICODE_ENABLE = no # Unicode
2828
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
2929
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.

keyboards/vision_division/keymaps/default/rules.mk

Lines changed: 0 additions & 1 deletion
This file was deleted.

keyboards/vision_division/rules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by d
2727
MIDI_ENABLE = no # MIDI controls
2828
UNICODE_ENABLE = no # Unicode
2929
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
30-
AUDIO_ENABLE = no # Audio output on port C6
30+
AUDIO_ENABLE = no # Audio output

0 commit comments

Comments
 (0)