]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/planck/keymaps/sdothum/common/init.h
Adds support for Planck Rev 6 (#2666)
[qmk_firmware.git] / keyboards / planck / keymaps / sdothum / common / init.h
1
2 // ....................................................................... Audio
3
4 void matrix_init_user(void)
5 {
6 #ifdef STENO_ENABLE
7   steno_set_mode(STENO_MODE_BOLT);          // or STENO_MODE_GEMINI
8 #endif
9 #ifdef AUDIO_ENABLE
10   startup_user();
11 #endif
12 }
13
14 #ifdef AUDIO_ENABLE
15 #ifdef BACKLIGHT_ENABLE
16 void led_set_user(uint8_t usb_led)
17 {
18   static uint8_t old_usb_led = 0;
19   _delay_ms(10);                            // gets rid of tick
20   if (!is_playing_notes()) {
21     if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
22       // if capslock LED is turning on
23       PLAY_SONG(song_caps_on);
24     }
25     else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
26       // if capslock LED is turning off
27       PLAY_SONG(song_caps_off);
28     }
29   }
30   old_usb_led = usb_led;
31 }
32 #endif
33
34 void startup_user(void)
35 {
36   _delay_ms(20);                            // gets rid of tick
37   PLAY_SONG(song_startup);
38 }
39
40 void shutdown_user(void)
41 {
42   PLAY_SONG(song_goodbye);
43   _delay_ms(150);
44   stop_all_notes();
45 }
46
47 void music_on_user(void)
48 {
49   music_scale_user();
50 }
51
52 void music_scale_user(void)
53 {
54   PLAY_SONG(music_scale);
55 }
56 #endif