Skip to content

Commit

Permalink
audio-configuration: fix avr boards with wrong configuration
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Johannes committed May 7, 2020
1 parent 1bbb113 commit f7d6a03
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 14 deletions.
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 (needs a pin configured in config.h, see docs/feature_audio.md)
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 (needs a pin configured in config.h, see docs/feature_audio.md)
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 (needs a pin configured in config.h, see docs/feature_audio.md)
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 (needs a pin configured in config.h, see docs/feature_audio.md)
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 (needs a pin configured in config.h, see docs/feature_audio.md)
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 (needs a pin configured in config.h, see docs/feature_audio.md)
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 (needs a pin configured in config.h, see docs/feature_audio.md)
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 (needs a pin configured in config.h, see docs/feature_audio.md)
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs

0 comments on commit f7d6a03

Please sign in to comment.