]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Add the ability to disable Music Mode completely (#2339)
authorDrashna Jaelre <drashna@live.com>
Thu, 8 Feb 2018 20:16:06 +0000 (12:16 -0800)
committerJack Humbert <jack.humb@gmail.com>
Thu, 8 Feb 2018 20:16:06 +0000 (15:16 -0500)
* Skip process_music in NO_MUSIC_MODE is defined

* Skip matrix_scan_music if NO_MUSIC_MODE is defined

* Skip music_all_notes_off if NO_MUSIC_MODE is defined

* Leave matrix_scan_music in, because it reduces firmware size by 150b....

* Add docs for NO_MUSIC_MODE

docs/feature_audio.md
keyboards/orthodox/keymaps/drashna/config.h
quantum/quantum.c

index 6b991a9afd9ff44970e1b7d64604120585f84531..c7133b295d2ec0aa74ba7a120cda66b534bb0461 100644 (file)
@@ -82,6 +82,10 @@ The pitch standard (`PITCH_STANDARD_A`) is 440.0f by default - to change this, a
 
     #define PITCH_STANDARD_A 432.0f
 
+You can completely disable Music Mode as well. This is useful, if you're pressed for space on your controller.  To disable it, add this to your `confid.h`:
+
+    #define NO_MUSIC_MODE
+
 ## MIDI Functionality
 
 This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile.
index c83380bd017bb11019a80868fb1da868c467e032..107f16d58c043d34cd5fcd246bbf724c10903da6 100644 (file)
@@ -69,6 +69,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifdef AUDIO_ENABLE
 #define C6_AUDIO
 #define STARTUP_SONG SONG(IMPERIAL_MARCH)
+#define NO_MUSIC_MODE
 #endif
 
 #undef PRODUCT
index bd95d5ea80881b9b6317a59c0ab054a9f9975546..66feca2f29611332edf45fa7d6195363344197a3 100644 (file)
@@ -147,7 +147,7 @@ void reset_keyboard(void) {
 #if defined(MIDI_ENABLE) && defined(MIDI_BASIC)
   process_midi_all_notes_off();
 #endif
-#if defined(AUDIO_ENABLE)
+#if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE)
   music_all_notes_off();
   uint16_t timer_start = timer_read();
   PLAY_SONG(goodbye_song);
@@ -236,7 +236,7 @@ bool process_record_quantum(keyrecord_t *record) {
   #ifdef STENO_ENABLE
     process_steno(keycode, record) &&
   #endif
-  #if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
+  #if ( defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))) && !defined(NO_MUSIC_MODE) 
     process_music(keycode, record) &&
   #endif
   #ifdef TAP_DANCE_ENABLE
@@ -834,7 +834,7 @@ void matrix_init_quantum() {
 }
 
 void matrix_scan_quantum() {
-  #ifdef AUDIO_ENABLE
+  #if defined(AUDIO_ENABLE)
     matrix_scan_music();
   #endif