2 #include "outputselect.h"
5 #define TAPPING_TERM 200
8 static void do_code16 (uint16_t code, void (*f) (uint8_t)) {
10 case QK_MODS ... QK_MODS_MAX:
25 if (code < QK_RMODS_MIN) return;
37 void register_code16 (uint16_t code) {
38 do_code16 (code, register_code);
42 void unregister_code16 (uint16_t code) {
43 unregister_code (code);
44 do_code16 (code, unregister_code);
47 __attribute__ ((weak))
48 bool process_action_kb(keyrecord_t *record) {
52 __attribute__ ((weak))
53 bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
54 return process_record_user(keycode, record);
57 __attribute__ ((weak))
58 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
62 void reset_keyboard(void) {
69 #ifdef CATERINA_BOOTLOADER
70 *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific
75 // Shift / paren setup
84 static bool shift_interrupted[2] = {0, 0};
85 static uint16_t scs_timer = 0;
87 bool process_record_quantum(keyrecord_t *record) {
89 /* This gets the keycode from the key pressed */
90 keypos_t key = record->event.key;
93 #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS)
94 /* TODO: Use store_or_get_action() or a similar function. */
95 if (!disable_action_cache) {
98 if (record->event.pressed) {
99 layer = layer_switch_get_layer(key);
100 update_source_layers_cache(key, layer);
102 layer = read_source_layers_cache(key);
104 keycode = keymap_key_to_keycode(layer, key);
107 keycode = keymap_key_to_keycode(layer_switch_get_layer(key), key);
109 // This is how you use actions here
110 // if (keycode == KC_LEAD) {
112 // action.code = ACTION_DEFAULT_LAYER_SET(0);
113 // process_action(record, action);
118 process_record_kb(keycode, record) &&
120 process_midi(keycode, record) &&
123 process_music(keycode, record) &&
125 #ifdef TAP_DANCE_ENABLE
126 process_tap_dance(keycode, record) &&
128 #ifndef DISABLE_LEADER
129 process_leader(keycode, record) &&
131 #ifndef DISABLE_CHORDING
132 process_chording(keycode, record) &&
134 #ifdef UNICODE_ENABLE
135 process_unicode(keycode, record) &&
138 process_ucis(keycode, record) &&
140 #ifdef PRINTING_ENABLE
141 process_printer(keycode, record) &&
143 #ifdef UNICODEMAP_ENABLE
144 process_unicode_map(keycode, record) &&
150 // Shift / paren setup
154 if (record->event.pressed) {
160 if (record->event.pressed) {
161 print("\nDEBUG: enabled.\n");
166 #ifdef RGBLIGHT_ENABLE
168 if (record->event.pressed) {
174 if (record->event.pressed) {
180 if (record->event.pressed) {
181 rgblight_increase_hue();
186 if (record->event.pressed) {
187 rgblight_decrease_hue();
192 if (record->event.pressed) {
193 rgblight_increase_sat();
198 if (record->event.pressed) {
199 rgblight_decrease_sat();
204 if (record->event.pressed) {
205 rgblight_increase_val();
210 if (record->event.pressed) {
211 rgblight_decrease_val();
217 if (record->event.pressed) {
218 set_output(OUTPUT_AUTO);
223 if (record->event.pressed) {
224 set_output(OUTPUT_USB);
228 #ifdef BLUETOOTH_ENABLE
230 if (record->event.pressed) {
231 set_output(OUTPUT_BLUETOOTH);
236 #ifdef ADAFRUIT_BLE_ENABLE
238 if (record->event.pressed) {
239 set_output(OUTPUT_ADAFRUIT_BLE);
244 case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO:
245 if (record->event.pressed) {
246 // MAGIC actions (BOOTMAGIC without the boot)
247 if (!eeconfig_is_enabled()) {
251 keymap_config.raw = eeconfig_read_keymap();
254 case MAGIC_SWAP_CONTROL_CAPSLOCK:
255 keymap_config.swap_control_capslock = true;
257 case MAGIC_CAPSLOCK_TO_CONTROL:
258 keymap_config.capslock_to_control = true;
260 case MAGIC_SWAP_LALT_LGUI:
261 keymap_config.swap_lalt_lgui = true;
263 case MAGIC_SWAP_RALT_RGUI:
264 keymap_config.swap_ralt_rgui = true;
267 keymap_config.no_gui = true;
269 case MAGIC_SWAP_GRAVE_ESC:
270 keymap_config.swap_grave_esc = true;
272 case MAGIC_SWAP_BACKSLASH_BACKSPACE:
273 keymap_config.swap_backslash_backspace = true;
275 case MAGIC_HOST_NKRO:
276 keymap_config.nkro = true;
278 case MAGIC_SWAP_ALT_GUI:
279 keymap_config.swap_lalt_lgui = true;
280 keymap_config.swap_ralt_rgui = true;
282 case MAGIC_UNSWAP_CONTROL_CAPSLOCK:
283 keymap_config.swap_control_capslock = false;
285 case MAGIC_UNCAPSLOCK_TO_CONTROL:
286 keymap_config.capslock_to_control = false;
288 case MAGIC_UNSWAP_LALT_LGUI:
289 keymap_config.swap_lalt_lgui = false;
291 case MAGIC_UNSWAP_RALT_RGUI:
292 keymap_config.swap_ralt_rgui = false;
295 keymap_config.no_gui = false;
297 case MAGIC_UNSWAP_GRAVE_ESC:
298 keymap_config.swap_grave_esc = false;
300 case MAGIC_UNSWAP_BACKSLASH_BACKSPACE:
301 keymap_config.swap_backslash_backspace = false;
303 case MAGIC_UNHOST_NKRO:
304 keymap_config.nkro = false;
306 case MAGIC_UNSWAP_ALT_GUI:
307 keymap_config.swap_lalt_lgui = false;
308 keymap_config.swap_ralt_rgui = false;
310 case MAGIC_TOGGLE_NKRO:
311 keymap_config.nkro = !keymap_config.nkro;
316 eeconfig_update_keymap(keymap_config.raw);
317 clear_keyboard(); // clear to prevent stuck keys
323 if (record->event.pressed) {
324 shift_interrupted[0] = false;
325 scs_timer = timer_read ();
326 register_mods(MOD_BIT(KC_LSFT));
329 #ifdef DISABLE_SPACE_CADET_ROLLOVER
330 if (get_mods() & MOD_BIT(KC_RSFT)) {
331 shift_interrupted[0] = true;
332 shift_interrupted[1] = true;
335 if (!shift_interrupted[0] && timer_elapsed(scs_timer) < TAPPING_TERM) {
336 register_code(LSPO_KEY);
337 unregister_code(LSPO_KEY);
339 unregister_mods(MOD_BIT(KC_LSFT));
346 if (record->event.pressed) {
347 shift_interrupted[1] = false;
348 scs_timer = timer_read ();
349 register_mods(MOD_BIT(KC_RSFT));
352 #ifdef DISABLE_SPACE_CADET_ROLLOVER
353 if (get_mods() & MOD_BIT(KC_LSFT)) {
354 shift_interrupted[0] = true;
355 shift_interrupted[1] = true;
358 if (!shift_interrupted[1] && timer_elapsed(scs_timer) < TAPPING_TERM) {
359 register_code(RSPC_KEY);
360 unregister_code(RSPC_KEY);
362 unregister_mods(MOD_BIT(KC_RSFT));
368 shift_interrupted[0] = true;
369 shift_interrupted[1] = true;
374 return process_action_kb(record);
377 const bool ascii_to_qwerty_shift_lut[0x80] PROGMEM = {
378 0, 0, 0, 0, 0, 0, 0, 0,
379 0, 0, 0, 0, 0, 0, 0, 0,
380 0, 0, 0, 0, 0, 0, 0, 0,
381 0, 0, 0, 0, 0, 0, 0, 0,
382 0, 1, 1, 1, 1, 1, 1, 0,
383 1, 1, 1, 1, 0, 0, 0, 0,
384 0, 0, 0, 0, 0, 0, 0, 0,
385 0, 0, 1, 0, 1, 0, 1, 1,
386 1, 1, 1, 1, 1, 1, 1, 1,
387 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 1, 0, 0, 0, 1, 1,
390 0, 0, 0, 0, 0, 0, 0, 0,
391 0, 0, 0, 0, 0, 0, 0, 0,
392 0, 0, 0, 0, 0, 0, 0, 0,
393 0, 0, 0, 1, 1, 1, 1, 0
396 const uint8_t ascii_to_qwerty_keycode_lut[0x80] PROGMEM = {
397 0, 0, 0, 0, 0, 0, 0, 0,
398 KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0,
399 0, 0, 0, 0, 0, 0, 0, 0,
400 0, 0, 0, KC_ESC, 0, 0, 0, 0,
401 KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT,
402 KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH,
403 KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7,
404 KC_8, KC_9, KC_SCLN, KC_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH,
405 KC_2, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G,
406 KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O,
407 KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W,
408 KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, KC_MINS,
409 KC_GRV, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G,
410 KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O,
411 KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W,
412 KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL
415 /* for users whose OSes are set to Colemak */
417 #include "keymap_colemak.h"
419 const bool ascii_to_colemak_shift_lut[0x80] PROGMEM = {
420 0, 0, 0, 0, 0, 0, 0, 0,
421 0, 0, 0, 0, 0, 0, 0, 0,
422 0, 0, 0, 0, 0, 0, 0, 0,
423 0, 0, 0, 0, 0, 0, 0, 0,
424 0, 1, 1, 1, 1, 1, 1, 0,
425 1, 1, 1, 1, 0, 0, 0, 0,
426 0, 0, 0, 0, 0, 0, 0, 0,
427 0, 0, 1, 0, 1, 0, 1, 1,
428 1, 1, 1, 1, 1, 1, 1, 1,
429 1, 1, 1, 1, 1, 1, 1, 1,
430 1, 1, 1, 1, 1, 1, 1, 1,
431 1, 1, 1, 0, 0, 0, 1, 1,
432 0, 0, 0, 0, 0, 0, 0, 0,
433 0, 0, 0, 0, 0, 0, 0, 0,
434 0, 0, 0, 0, 0, 0, 0, 0,
435 0, 0, 0, 1, 1, 1, 1, 0
438 const uint8_t ascii_to_colemak_keycode_lut[0x80] PROGMEM = {
439 0, 0, 0, 0, 0, 0, 0, 0,
440 KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0,
441 0, 0, 0, 0, 0, 0, 0, 0,
442 0, 0, 0, KC_ESC, 0, 0, 0, 0,
443 KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT,
444 KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH,
445 KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7,
446 KC_8, KC_9, CM_SCLN, CM_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH,
447 KC_2, CM_A, CM_B, CM_C, CM_D, CM_E, CM_F, CM_G,
448 CM_H, CM_I, CM_J, CM_K, CM_L, CM_M, CM_N, CM_O,
449 CM_P, CM_Q, CM_R, CM_S, CM_T, CM_U, CM_V, CM_W,
450 CM_X, CM_Y, CM_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, KC_MINS,
451 KC_GRV, CM_A, CM_B, CM_C, CM_D, CM_E, CM_F, CM_G,
452 CM_H, CM_I, CM_J, CM_K, CM_L, CM_M, CM_N, CM_O,
453 CM_P, CM_Q, CM_R, CM_S, CM_T, CM_U, CM_V, CM_W,
454 CM_X, CM_Y, CM_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL
459 void send_string(const char *str) {
462 uint8_t ascii_code = pgm_read_byte(str);
463 if (!ascii_code) break;
464 keycode = pgm_read_byte(&ascii_to_qwerty_keycode_lut[ascii_code]);
465 if (pgm_read_byte(&ascii_to_qwerty_shift_lut[ascii_code])) {
466 register_code(KC_LSFT);
467 register_code(keycode);
468 unregister_code(keycode);
469 unregister_code(KC_LSFT);
472 register_code(keycode);
473 unregister_code(keycode);
479 void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
480 if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) {
487 void tap_random_base64(void) {
488 #if defined(__AVR_ATmega32U4__)
489 uint8_t key = (TCNT0 + TCNT1 + TCNT3 + TCNT4) % 64;
491 uint8_t key = rand() % 64;
495 register_code(KC_LSFT);
496 register_code(key + KC_A);
497 unregister_code(key + KC_A);
498 unregister_code(KC_LSFT);
501 register_code(key - 26 + KC_A);
502 unregister_code(key - 26 + KC_A);
506 unregister_code(KC_0);
509 register_code(key - 53 + KC_1);
510 unregister_code(key - 53 + KC_1);
513 register_code(KC_LSFT);
514 register_code(KC_EQL);
515 unregister_code(KC_EQL);
516 unregister_code(KC_LSFT);
519 register_code(KC_SLSH);
520 unregister_code(KC_SLSH);
525 void matrix_init_quantum() {
526 #ifdef BACKLIGHT_ENABLE
527 backlight_init_ports();
532 void matrix_scan_quantum() {
537 #ifdef TAP_DANCE_ENABLE
538 matrix_scan_tap_dance();
543 #if defined(BACKLIGHT_ENABLE) && defined(BACKLIGHT_PIN)
545 static const uint8_t backlight_pin = BACKLIGHT_PIN;
547 #if BACKLIGHT_PIN == B7
548 # define COM1x1 COM1C1
550 #elif BACKLIGHT_PIN == B6
551 # define COM1x1 COM1B1
553 #elif BACKLIGHT_PIN == B5
554 # define COM1x1 COM1A1
557 # error "Backlight pin not supported - use B5, B6, or B7"
560 __attribute__ ((weak))
561 void backlight_init_ports(void)
564 // Setup backlight pin as output and output low.
566 _SFR_IO8((backlight_pin >> 4) + 1) |= _BV(backlight_pin & 0xF);
568 _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF);
570 // Use full 16-bit resolution.
573 // I could write a wall of text here to explain... but TL;DW
574 // Go read the ATmega32u4 datasheet.
575 // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on
577 // Pin PB7 = OCR1C (Timer 1, Channel C)
578 // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0
579 // (i.e. start high, go low when counter matches.)
580 // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0
581 // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1
583 TCCR1A = _BV(COM1x1) | _BV(WGM11); // = 0b00001010;
584 TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001;
587 #ifdef BACKLIGHT_BREATHING
588 breathing_defaults();
592 __attribute__ ((weak))
593 void backlight_set(uint8_t level)
595 // Prevent backlight blink on lowest level
597 _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF);
600 // Turn off PWM control on backlight pin, revert to output low.
601 TCCR1A &= ~(_BV(COM1x1));
603 } else if ( level == BACKLIGHT_LEVELS ) {
604 // Turn on PWM control of backlight pin
605 TCCR1A |= _BV(COM1x1);
606 // Set the brightness
609 // Turn on PWM control of backlight pin
610 TCCR1A |= _BV(COM1x1);
611 // Set the brightness
612 OCR1x = 0xFFFF >> ((BACKLIGHT_LEVELS - level) * ((BACKLIGHT_LEVELS + 1) / 2));
615 #ifdef BACKLIGHT_BREATHING
616 breathing_intensity_default();
621 #ifdef BACKLIGHT_BREATHING
623 #define BREATHING_NO_HALT 0
624 #define BREATHING_HALT_OFF 1
625 #define BREATHING_HALT_ON 2
627 static uint8_t breath_intensity;
628 static uint8_t breath_speed;
629 static uint16_t breathing_index;
630 static uint8_t breathing_halt;
632 void breathing_enable(void)
634 if (get_backlight_level() == 0)
640 // Set breathing_index to be at the midpoint (brightest point)
641 breathing_index = 0x20 << breath_speed;
644 breathing_halt = BREATHING_NO_HALT;
646 // Enable breathing interrupt
647 TIMSK1 |= _BV(OCIE1A);
650 void breathing_pulse(void)
652 if (get_backlight_level() == 0)
658 // Set breathing_index to be at the midpoint + 1 (brightest point)
659 breathing_index = 0x21 << breath_speed;
662 breathing_halt = BREATHING_HALT_ON;
664 // Enable breathing interrupt
665 TIMSK1 |= _BV(OCIE1A);
668 void breathing_disable(void)
670 // Disable breathing interrupt
671 TIMSK1 &= ~_BV(OCIE1A);
672 backlight_set(get_backlight_level());
675 void breathing_self_disable(void)
677 if (get_backlight_level() == 0)
679 breathing_halt = BREATHING_HALT_OFF;
683 breathing_halt = BREATHING_HALT_ON;
686 //backlight_set(get_backlight_level());
689 void breathing_toggle(void)
693 if (get_backlight_level() == 0)
699 // Set breathing_index to be at the midpoint + 1 (brightest point)
700 breathing_index = 0x21 << breath_speed;
703 breathing_halt = BREATHING_NO_HALT;
706 // Toggle breathing interrupt
707 TIMSK1 ^= _BV(OCIE1A);
709 // Restore backlight level
712 backlight_set(get_backlight_level());
716 bool is_breathing(void)
718 return (TIMSK1 && _BV(OCIE1A));
721 void breathing_intensity_default(void)
723 //breath_intensity = (uint8_t)((uint16_t)100 * (uint16_t)get_backlight_level() / (uint16_t)BACKLIGHT_LEVELS);
724 breath_intensity = ((BACKLIGHT_LEVELS - get_backlight_level()) * ((BACKLIGHT_LEVELS + 1) / 2));
727 void breathing_intensity_set(uint8_t value)
729 breath_intensity = value;
732 void breathing_speed_default(void)
737 void breathing_speed_set(uint8_t value)
739 bool is_breathing_now = is_breathing();
740 uint8_t old_breath_speed = breath_speed;
742 if (is_breathing_now)
744 // Disable breathing interrupt
745 TIMSK1 &= ~_BV(OCIE1A);
748 breath_speed = value;
750 if (is_breathing_now)
752 // Adjust index to account for new speed
753 breathing_index = (( (uint8_t)( (breathing_index) >> old_breath_speed ) ) & 0x3F) << breath_speed;
755 // Enable breathing interrupt
756 TIMSK1 |= _BV(OCIE1A);
761 void breathing_speed_inc(uint8_t value)
763 if ((uint16_t)(breath_speed - value) > 10 )
765 breathing_speed_set(0);
769 breathing_speed_set(breath_speed - value);
773 void breathing_speed_dec(uint8_t value)
775 if ((uint16_t)(breath_speed + value) > 10 )
777 breathing_speed_set(10);
781 breathing_speed_set(breath_speed + value);
785 void breathing_defaults(void)
787 breathing_intensity_default();
788 breathing_speed_default();
789 breathing_halt = BREATHING_NO_HALT;
792 /* Breathing Sleep LED brighness(PWM On period) table
793 * (64[steps] * 4[duration]) / 64[PWM periods/s] = 4 second breath cycle
795 * http://www.wolframalpha.com/input/?i=%28sin%28+x%2F64*pi%29**8+*+255%2C+x%3D0+to+63
796 * (0..63).each {|x| p ((sin(x/64.0*PI)**8)*255).to_i }
798 static const uint8_t breathing_table[64] PROGMEM = {
799 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 6, 10,
800 15, 23, 32, 44, 58, 74, 93, 113, 135, 157, 179, 199, 218, 233, 245, 252,
801 255, 252, 245, 233, 218, 199, 179, 157, 135, 113, 93, 74, 58, 44, 32, 23,
802 15, 10, 6, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
805 ISR(TIMER1_COMPA_vect)
807 // OCR1x = (pgm_read_byte(&breathing_table[ ( (uint8_t)( (breathing_index++) >> breath_speed ) ) & 0x3F ] )) * breath_intensity;
810 uint8_t local_index = ( (uint8_t)( (breathing_index++) >> breath_speed ) ) & 0x3F;
812 if (((breathing_halt == BREATHING_HALT_ON) && (local_index == 0x20)) || ((breathing_halt == BREATHING_HALT_OFF) && (local_index == 0x3F)))
814 // Disable breathing interrupt
815 TIMSK1 &= ~_BV(OCIE1A);
818 OCR1x = (uint16_t)(((uint16_t)pgm_read_byte(&breathing_table[local_index]) * 257)) >> breath_intensity;
828 __attribute__ ((weak))
829 void backlight_init_ports(void)
834 __attribute__ ((weak))
835 void backlight_set(uint8_t level)
843 // Functions for spitting out values
846 void send_dword(uint32_t number) { // this might not actually work
847 uint16_t word = (number >> 16);
849 send_word(number & 0xFFFFUL);
852 void send_word(uint16_t number) {
853 uint8_t byte = number >> 8;
855 send_byte(number & 0xFF);
858 void send_byte(uint8_t number) {
859 uint8_t nibble = number >> 4;
861 send_nibble(number & 0xF);
864 void send_nibble(uint8_t number) {
868 unregister_code(KC_0);
871 register_code(KC_1 + (number - 1));
872 unregister_code(KC_1 + (number - 1));
875 register_code(KC_A + (number - 0xA));
876 unregister_code(KC_A + (number - 0xA));
881 void api_send_unicode(uint32_t unicode) {
884 dword_to_bytes(unicode, chunk);
885 MT_SEND_DATA(DT_UNICODE, chunk, 5);
889 __attribute__ ((weak))
890 void led_set_user(uint8_t usb_led) {
894 __attribute__ ((weak))
895 void led_set_kb(uint8_t usb_led) {
896 led_set_user(usb_led);
899 __attribute__ ((weak))
900 void led_init_ports(void)
905 __attribute__ ((weak))
906 void led_set(uint8_t usb_led)
911 // // Using PE6 Caps Lock LED
912 // if (usb_led & (1<<USB_LED_CAPS_LOCK))
929 //------------------------------------------------------------------------------
930 // Override these functions in your keymap file to play different tunes on
931 // different events such as startup and bootloader jump
933 __attribute__ ((weak))
934 void startup_user() {}
936 __attribute__ ((weak))
937 void shutdown_user() {}
939 //------------------------------------------------------------------------------