Skip to content

Commit

Permalink
Audio enable corrections (2/3) (#8903)
Browse files Browse the repository at this point in the history
* 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 #8901

* audio-configuration: changelow wording

* audio-configuration: remove rules.mk

since it now would change nothing compared to the keyboards base rule.mk
  • Loading branch information
JohSchneider authored May 10, 2020
1 parent 30dd34e commit f9e2dbd
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 17 deletions.
5 changes: 5 additions & 0 deletions docs/ChangeLog/20200530/PR8903.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## fixing wrong configuration of AUDIO feature

`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.

These changes fix this by disabling Audio on keyboards that have the feature misconfigured, and therefore non-functional.
6 changes: 3 additions & 3 deletions keyboards/ckeys/handwire_101/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define MAGIC_KEY_SLEEP_LED Z

// Audio Click
#define AUDIO_CLICKY
//#define AUDIO_CLICKY

// Music Mode Polyphony
// NOTE: Must change polyphony_rate to a number higher than 0 in voices.c
#define AUDIO_VOICES
#define PITCH_STANDARD_A 880.0f
//#define AUDIO_VOICES
//#define PITCH_STANDARD_A 880.0f

// Mouse keys
#define MOUSEKEY_DELAY 0
Expand Down
2 changes: 1 addition & 1 deletion keyboards/ckeys/handwire_101/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by d
#MIDI_ENABLE = yes # MIDI controls
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = yes # Audio output on port C6
AUDIO_ENABLE = no # Audio output
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
3 changes: 2 additions & 1 deletion keyboards/clueboard/card/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ void matrix_scan_user(void) {

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
#ifdef AUDIO_ENABLE
case SONG_SU:
if (record->event.pressed) {
PLAY_SONG(tone_startup);
Expand All @@ -58,7 +59,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}

return false;

#endif
default:
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion keyboards/clueboard/card/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = yes # Audio output on port C6
AUDIO_ENABLE = no # Audio output
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
Expand Down
2 changes: 1 addition & 1 deletion keyboards/eco/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
MIDI_ENABLE = yes # MIDI controls
AUDIO_ENABLE = yes # Audio output on port C6
AUDIO_ENABLE = no # Audio output
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
Expand Down
2 changes: 1 addition & 1 deletion keyboards/navi10/rev3/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = yes # Audio output on port C6
AUDIO_ENABLE = no # Audio output
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
1 change: 1 addition & 0 deletions keyboards/planck/rev6/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@

#define MUSIC_MAP
#undef AUDIO_VOICES
// Note: following undef isn't really necessary on STM32, C6_AUDIO is AVR related
#undef C6_AUDIO

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
Expand Down
2 changes: 1 addition & 1 deletion keyboards/planck/rev6/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = yes # Audio output on port C6
AUDIO_ENABLE = yes # Audio output
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
Expand Down
2 changes: 1 addition & 1 deletion keyboards/preonic/rev1/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = yes # Audio output on port C6
AUDIO_ENABLE = yes # Audio output
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
Expand Down
2 changes: 1 addition & 1 deletion keyboards/preonic/rev2/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = yes # Audio output on port C6
AUDIO_ENABLE = yes # Audio output
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
Expand Down
1 change: 1 addition & 0 deletions keyboards/preonic/rev3/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

#define MUSIC_MAP
#undef AUDIO_VOICES
// Note: following undef isn't really necessary on STM32, C6_AUDIO is AVR related
#undef C6_AUDIO

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
Expand Down
2 changes: 1 addition & 1 deletion keyboards/preonic/rev3/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = yes # Audio output on port C6
AUDIO_ENABLE = yes # Audio output
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
Expand Down
2 changes: 1 addition & 1 deletion keyboards/scarletbandana/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ NKRO_ENABLE = no # USB Nkey Rollover
MIDI_ENABLE = no # MIDI support
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = yes # Audio output on port C6
AUDIO_ENABLE = yes # Audio output
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality, also set ISSI_ENABLE below for Miera
Expand Down
2 changes: 1 addition & 1 deletion keyboards/sck/neiso/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = yes # Audio output on port C6
AUDIO_ENABLE = no # Audio output
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
2 changes: 1 addition & 1 deletion keyboards/subatomic/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
MIDI_ENABLE = yes # MIDI controls
AUDIO_ENABLE = yes # Audio output on port C6
AUDIO_ENABLE = no # Audio output
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
Expand Down
1 change: 0 additions & 1 deletion keyboards/vision_division/keymaps/default/rules.mk

This file was deleted.

2 changes: 1 addition & 1 deletion keyboards/vision_division/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by d
MIDI_ENABLE = no # MIDI controls
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
AUDIO_ENABLE = no # Audio output

0 comments on commit f9e2dbd

Please sign in to comment.