diff options
author | Jack Humbert <jack.humb@gmail.com> | 2017-02-19 00:04:14 -0500 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2017-02-19 00:04:14 -0500 |
commit | c2239e6b96fdea11d449d220db3d8bca40b38bde (patch) | |
tree | 0c2fe7df345868b56dfb3478ceb1b54a1e8eec29 /keyboards/planck/keymaps/unicode | |
parent | 8d0fdf10086a0e8a1615f0521fccf1f5a2806497 (diff) | |
parent | 49e72632d2200fc3bf71d5ced2aa43058da3b2e0 (diff) | |
download | qmk_firmware-c2239e6b96fdea11d449d220db3d8bca40b38bde.tar.gz qmk_firmware-c2239e6b96fdea11d449d220db3d8bca40b38bde.zip |
merging
Diffstat (limited to 'keyboards/planck/keymaps/unicode')
-rw-r--r-- | keyboards/planck/keymaps/unicode/keymap.c | 45 |
1 files changed, 29 insertions, 16 deletions
diff --git a/keyboards/planck/keymaps/unicode/keymap.c b/keyboards/planck/keymaps/unicode/keymap.c index d73e7e09d4..1b4ca8ed7d 100644 --- a/keyboards/planck/keymaps/unicode/keymap.c +++ b/keyboards/planck/keymaps/unicode/keymap.c @@ -195,24 +195,20 @@ const uint16_t PROGMEM fn_actions[] = { }; #ifdef AUDIO_ENABLE -float tone_startup[][2] = { - {440.0*pow(2.0,(31)/12.0), 12}, - {440.0*pow(2.0,(28)/12.0), 8}, - {440.0*pow(2.0,(19)/12.0), 8}, - {440.0*pow(2.0,(24)/12.0), 8}, - {440.0*pow(2.0,(28)/12.0), 20} -}; +float tone_startup[][2] = SONG(STARTUP_SOUND); float tone_qwerty[][2] = SONG(QWERTY_SOUND); float tone_dvorak[][2] = SONG(DVORAK_SOUND); float tone_colemak[][2] = SONG(COLEMAK_SOUND); float tone_plover[][2] = SONG(PLOVER_SOUND); float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); -float goodbye[][2] = SONG(GOODBYE_SOUND); +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); #endif + void persistant_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); @@ -309,18 +305,35 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; void matrix_init_user(void) { - #ifdef AUDIO_ENABLE - _delay_ms(20); // stops the tick - PLAY_NOTE_ARRAY(tone_startup, false, 0); - #endif + #ifdef AUDIO_ENABLE + startup_user(); + #endif } #ifdef AUDIO_ENABLE -void play_goodbye_tone() + +void startup_user() { - PLAY_NOTE_ARRAY(goodbye, false, 0); - _delay_ms(150); + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); } -#endif +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif |