3 #include "outputselect.h"
7 #define TAPPING_TERM 200
10 static void do_code16 (uint16_t code, void (*f) (uint8_t)) {
12 case QK_MODS ... QK_MODS_MAX:
27 if (code < QK_RMODS_MIN) return;
39 void register_code16 (uint16_t code) {
40 do_code16 (code, register_code);
44 void unregister_code16 (uint16_t code) {
45 unregister_code (code);
46 do_code16 (code, unregister_code);
49 __attribute__ ((weak))
50 bool process_action_kb(keyrecord_t *record) {
54 __attribute__ ((weak))
55 bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
56 return process_record_user(keycode, record);
59 __attribute__ ((weak))
60 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
64 void reset_keyboard(void) {
71 #ifdef CATERINA_BOOTLOADER
72 *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific
77 // Shift / paren setup
86 static bool shift_interrupted[2] = {0, 0};
87 static uint16_t scs_timer = 0;
89 bool process_record_quantum(keyrecord_t *record) {
91 /* This gets the keycode from the key pressed */
92 keypos_t key = record->event.key;
95 #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS)
96 /* TODO: Use store_or_get_action() or a similar function. */
97 if (!disable_action_cache) {
100 if (record->event.pressed) {
101 layer = layer_switch_get_layer(key);
102 update_source_layers_cache(key, layer);
104 layer = read_source_layers_cache(key);
106 keycode = keymap_key_to_keycode(layer, key);
109 keycode = keymap_key_to_keycode(layer_switch_get_layer(key), key);
111 // This is how you use actions here
112 // if (keycode == KC_LEAD) {
114 // action.code = ACTION_DEFAULT_LAYER_SET(0);
115 // process_action(record, action);
120 process_record_kb(keycode, record) &&
122 process_midi(keycode, record) &&
125 process_music(keycode, record) &&
127 #ifdef TAP_DANCE_ENABLE
128 process_tap_dance(keycode, record) &&
130 #ifndef DISABLE_LEADER
131 process_leader(keycode, record) &&
133 #ifndef DISABLE_CHORDING
134 process_chording(keycode, record) &&
136 #ifdef UNICODE_ENABLE
137 process_unicode(keycode, record) &&
140 process_ucis(keycode, record) &&
142 #ifdef PRINTING_ENABLE
143 process_printer(keycode, record) &&
145 #ifdef UNICODEMAP_ENABLE
146 process_unicode_map(keycode, record) &&
152 // Shift / paren setup
156 if (record->event.pressed) {
162 if (record->event.pressed) {
163 print("\nDEBUG: enabled.\n");
168 #ifdef RGBLIGHT_ENABLE
170 if (record->event.pressed) {
176 if (record->event.pressed) {
182 if (record->event.pressed) {
183 rgblight_increase_hue();
188 if (record->event.pressed) {
189 rgblight_decrease_hue();
194 if (record->event.pressed) {
195 rgblight_increase_sat();
200 if (record->event.pressed) {
201 rgblight_decrease_sat();
206 if (record->event.pressed) {
207 rgblight_increase_val();
212 if (record->event.pressed) {
213 rgblight_decrease_val();
220 if (record->event.pressed) {
221 set_output(OUTPUT_AUTO);
226 if (record->event.pressed) {
227 set_output(OUTPUT_USB);
231 #ifdef BLUETOOTH_ENABLE
233 if (record->event.pressed) {
234 set_output(OUTPUT_BLUETOOTH);
239 #ifdef ADAFRUIT_BLE_ENABLE
241 if (record->event.pressed) {
242 set_output(OUTPUT_ADAFRUIT_BLE);
248 case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO:
249 if (record->event.pressed) {
250 // MAGIC actions (BOOTMAGIC without the boot)
251 if (!eeconfig_is_enabled()) {
255 keymap_config.raw = eeconfig_read_keymap();
258 case MAGIC_SWAP_CONTROL_CAPSLOCK:
259 keymap_config.swap_control_capslock = true;
261 case MAGIC_CAPSLOCK_TO_CONTROL:
262 keymap_config.capslock_to_control = true;
264 case MAGIC_SWAP_LALT_LGUI:
265 keymap_config.swap_lalt_lgui = true;
267 case MAGIC_SWAP_RALT_RGUI:
268 keymap_config.swap_ralt_rgui = true;
271 keymap_config.no_gui = true;
273 case MAGIC_SWAP_GRAVE_ESC:
274 keymap_config.swap_grave_esc = true;
276 case MAGIC_SWAP_BACKSLASH_BACKSPACE:
277 keymap_config.swap_backslash_backspace = true;
279 case MAGIC_HOST_NKRO:
280 keymap_config.nkro = true;
282 case MAGIC_SWAP_ALT_GUI:
283 keymap_config.swap_lalt_lgui = true;
284 keymap_config.swap_ralt_rgui = true;
286 case MAGIC_UNSWAP_CONTROL_CAPSLOCK:
287 keymap_config.swap_control_capslock = false;
289 case MAGIC_UNCAPSLOCK_TO_CONTROL:
290 keymap_config.capslock_to_control = false;
292 case MAGIC_UNSWAP_LALT_LGUI:
293 keymap_config.swap_lalt_lgui = false;
295 case MAGIC_UNSWAP_RALT_RGUI:
296 keymap_config.swap_ralt_rgui = false;
299 keymap_config.no_gui = false;
301 case MAGIC_UNSWAP_GRAVE_ESC:
302 keymap_config.swap_grave_esc = false;
304 case MAGIC_UNSWAP_BACKSLASH_BACKSPACE:
305 keymap_config.swap_backslash_backspace = false;
307 case MAGIC_UNHOST_NKRO:
308 keymap_config.nkro = false;
310 case MAGIC_UNSWAP_ALT_GUI:
311 keymap_config.swap_lalt_lgui = false;
312 keymap_config.swap_ralt_rgui = false;
314 case MAGIC_TOGGLE_NKRO:
315 keymap_config.nkro = !keymap_config.nkro;
320 eeconfig_update_keymap(keymap_config.raw);
321 clear_keyboard(); // clear to prevent stuck keys
327 if (record->event.pressed) {
328 shift_interrupted[0] = false;
329 scs_timer = timer_read ();
330 register_mods(MOD_BIT(KC_LSFT));
333 #ifdef DISABLE_SPACE_CADET_ROLLOVER
334 if (get_mods() & MOD_BIT(KC_RSFT)) {
335 shift_interrupted[0] = true;
336 shift_interrupted[1] = true;
339 if (!shift_interrupted[0] && timer_elapsed(scs_timer) < TAPPING_TERM) {
340 register_code(LSPO_KEY);
341 unregister_code(LSPO_KEY);
343 unregister_mods(MOD_BIT(KC_LSFT));
350 if (record->event.pressed) {
351 shift_interrupted[1] = false;
352 scs_timer = timer_read ();
353 register_mods(MOD_BIT(KC_RSFT));
356 #ifdef DISABLE_SPACE_CADET_ROLLOVER
357 if (get_mods() & MOD_BIT(KC_LSFT)) {
358 shift_interrupted[0] = true;
359 shift_interrupted[1] = true;
362 if (!shift_interrupted[1] && timer_elapsed(scs_timer) < TAPPING_TERM) {
363 register_code(RSPC_KEY);
364 unregister_code(RSPC_KEY);
366 unregister_mods(MOD_BIT(KC_RSFT));
372 shift_interrupted[0] = true;
373 shift_interrupted[1] = true;
378 return process_action_kb(record);
381 const bool ascii_to_qwerty_shift_lut[0x80] PROGMEM = {
382 0, 0, 0, 0, 0, 0, 0, 0,
383 0, 0, 0, 0, 0, 0, 0, 0,
384 0, 0, 0, 0, 0, 0, 0, 0,
385 0, 0, 0, 0, 0, 0, 0, 0,
386 0, 1, 1, 1, 1, 1, 1, 0,
387 1, 1, 1, 1, 0, 0, 0, 0,
388 0, 0, 0, 0, 0, 0, 0, 0,
389 0, 0, 1, 0, 1, 0, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 0, 0, 0, 1, 1,
394 0, 0, 0, 0, 0, 0, 0, 0,
395 0, 0, 0, 0, 0, 0, 0, 0,
396 0, 0, 0, 0, 0, 0, 0, 0,
397 0, 0, 0, 1, 1, 1, 1, 0
400 const uint8_t ascii_to_qwerty_keycode_lut[0x80] PROGMEM = {
401 0, 0, 0, 0, 0, 0, 0, 0,
402 KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0,
403 0, 0, 0, 0, 0, 0, 0, 0,
404 0, 0, 0, KC_ESC, 0, 0, 0, 0,
405 KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT,
406 KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH,
407 KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7,
408 KC_8, KC_9, KC_SCLN, KC_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH,
409 KC_2, 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_6, KC_MINS,
413 KC_GRV, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G,
414 KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O,
415 KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W,
416 KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL
419 /* for users whose OSes are set to Colemak */
421 #include "keymap_colemak.h"
423 const bool ascii_to_colemak_shift_lut[0x80] PROGMEM = {
424 0, 0, 0, 0, 0, 0, 0, 0,
425 0, 0, 0, 0, 0, 0, 0, 0,
426 0, 0, 0, 0, 0, 0, 0, 0,
427 0, 0, 0, 0, 0, 0, 0, 0,
428 0, 1, 1, 1, 1, 1, 1, 0,
429 1, 1, 1, 1, 0, 0, 0, 0,
430 0, 0, 0, 0, 0, 0, 0, 0,
431 0, 0, 1, 0, 1, 0, 1, 1,
432 1, 1, 1, 1, 1, 1, 1, 1,
433 1, 1, 1, 1, 1, 1, 1, 1,
434 1, 1, 1, 1, 1, 1, 1, 1,
435 1, 1, 1, 0, 0, 0, 1, 1,
436 0, 0, 0, 0, 0, 0, 0, 0,
437 0, 0, 0, 0, 0, 0, 0, 0,
438 0, 0, 0, 0, 0, 0, 0, 0,
439 0, 0, 0, 1, 1, 1, 1, 0
442 const uint8_t ascii_to_colemak_keycode_lut[0x80] PROGMEM = {
443 0, 0, 0, 0, 0, 0, 0, 0,
444 KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0,
445 0, 0, 0, 0, 0, 0, 0, 0,
446 0, 0, 0, KC_ESC, 0, 0, 0, 0,
447 KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT,
448 KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH,
449 KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7,
450 KC_8, KC_9, CM_SCLN, CM_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH,
451 KC_2, 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_6, KC_MINS,
455 KC_GRV, CM_A, CM_B, CM_C, CM_D, CM_E, CM_F, CM_G,
456 CM_H, CM_I, CM_J, CM_K, CM_L, CM_M, CM_N, CM_O,
457 CM_P, CM_Q, CM_R, CM_S, CM_T, CM_U, CM_V, CM_W,
458 CM_X, CM_Y, CM_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL
463 void send_string(const char *str) {
466 uint8_t ascii_code = pgm_read_byte(str);
467 if (!ascii_code) break;
468 keycode = pgm_read_byte(&ascii_to_qwerty_keycode_lut[ascii_code]);
469 if (pgm_read_byte(&ascii_to_qwerty_shift_lut[ascii_code])) {
470 register_code(KC_LSFT);
471 register_code(keycode);
472 unregister_code(keycode);
473 unregister_code(KC_LSFT);
476 register_code(keycode);
477 unregister_code(keycode);
483 void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
484 if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) {
491 void tap_random_base64(void) {
492 #if defined(__AVR_ATmega32U4__)
493 uint8_t key = (TCNT0 + TCNT1 + TCNT3 + TCNT4) % 64;
495 uint8_t key = rand() % 64;
499 register_code(KC_LSFT);
500 register_code(key + KC_A);
501 unregister_code(key + KC_A);
502 unregister_code(KC_LSFT);
505 register_code(key - 26 + KC_A);
506 unregister_code(key - 26 + KC_A);
510 unregister_code(KC_0);
513 register_code(key - 53 + KC_1);
514 unregister_code(key - 53 + KC_1);
517 register_code(KC_LSFT);
518 register_code(KC_EQL);
519 unregister_code(KC_EQL);
520 unregister_code(KC_LSFT);
523 register_code(KC_SLSH);
524 unregister_code(KC_SLSH);
529 void matrix_init_quantum() {
530 #ifdef BACKLIGHT_ENABLE
531 backlight_init_ports();
536 void matrix_scan_quantum() {
541 #ifdef TAP_DANCE_ENABLE
542 matrix_scan_tap_dance();
547 #if defined(BACKLIGHT_ENABLE) && defined(BACKLIGHT_PIN)
549 static const uint8_t backlight_pin = BACKLIGHT_PIN;
551 #if BACKLIGHT_PIN == B7
552 # define COM1x1 COM1C1
554 #elif BACKLIGHT_PIN == B6
555 # define COM1x1 COM1B1
557 #elif BACKLIGHT_PIN == B5
558 # define COM1x1 COM1A1
561 # error "Backlight pin not supported - use B5, B6, or B7"
564 __attribute__ ((weak))
565 void backlight_init_ports(void)
568 // Setup backlight pin as output and output low.
570 _SFR_IO8((backlight_pin >> 4) + 1) |= _BV(backlight_pin & 0xF);
572 _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF);
574 // Use full 16-bit resolution.
577 // I could write a wall of text here to explain... but TL;DW
578 // Go read the ATmega32u4 datasheet.
579 // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on
581 // Pin PB7 = OCR1C (Timer 1, Channel C)
582 // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0
583 // (i.e. start high, go low when counter matches.)
584 // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0
585 // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1
587 TCCR1A = _BV(COM1x1) | _BV(WGM11); // = 0b00001010;
588 TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001;
591 #ifdef BACKLIGHT_BREATHING
592 breathing_defaults();
596 __attribute__ ((weak))
597 void backlight_set(uint8_t level)
599 // Prevent backlight blink on lowest level
601 _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF);
604 // Turn off PWM control on backlight pin, revert to output low.
605 TCCR1A &= ~(_BV(COM1x1));
607 } else if ( level == BACKLIGHT_LEVELS ) {
608 // Turn on PWM control of backlight pin
609 TCCR1A |= _BV(COM1x1);
610 // Set the brightness
613 // Turn on PWM control of backlight pin
614 TCCR1A |= _BV(COM1x1);
615 // Set the brightness
616 OCR1x = 0xFFFF >> ((BACKLIGHT_LEVELS - level) * ((BACKLIGHT_LEVELS + 1) / 2));
619 #ifdef BACKLIGHT_BREATHING
620 breathing_intensity_default();
625 #ifdef BACKLIGHT_BREATHING
627 #define BREATHING_NO_HALT 0
628 #define BREATHING_HALT_OFF 1
629 #define BREATHING_HALT_ON 2
631 static uint8_t breath_intensity;
632 static uint8_t breath_speed;
633 static uint16_t breathing_index;
634 static uint8_t breathing_halt;
636 void breathing_enable(void)
638 if (get_backlight_level() == 0)
644 // Set breathing_index to be at the midpoint (brightest point)
645 breathing_index = 0x20 << breath_speed;
648 breathing_halt = BREATHING_NO_HALT;
650 // Enable breathing interrupt
651 TIMSK1 |= _BV(OCIE1A);
654 void breathing_pulse(void)
656 if (get_backlight_level() == 0)
662 // Set breathing_index to be at the midpoint + 1 (brightest point)
663 breathing_index = 0x21 << breath_speed;
666 breathing_halt = BREATHING_HALT_ON;
668 // Enable breathing interrupt
669 TIMSK1 |= _BV(OCIE1A);
672 void breathing_disable(void)
674 // Disable breathing interrupt
675 TIMSK1 &= ~_BV(OCIE1A);
676 backlight_set(get_backlight_level());
679 void breathing_self_disable(void)
681 if (get_backlight_level() == 0)
683 breathing_halt = BREATHING_HALT_OFF;
687 breathing_halt = BREATHING_HALT_ON;
690 //backlight_set(get_backlight_level());
693 void breathing_toggle(void)
697 if (get_backlight_level() == 0)
703 // Set breathing_index to be at the midpoint + 1 (brightest point)
704 breathing_index = 0x21 << breath_speed;
707 breathing_halt = BREATHING_NO_HALT;
710 // Toggle breathing interrupt
711 TIMSK1 ^= _BV(OCIE1A);
713 // Restore backlight level
716 backlight_set(get_backlight_level());
720 bool is_breathing(void)
722 return (TIMSK1 && _BV(OCIE1A));
725 void breathing_intensity_default(void)
727 //breath_intensity = (uint8_t)((uint16_t)100 * (uint16_t)get_backlight_level() / (uint16_t)BACKLIGHT_LEVELS);
728 breath_intensity = ((BACKLIGHT_LEVELS - get_backlight_level()) * ((BACKLIGHT_LEVELS + 1) / 2));
731 void breathing_intensity_set(uint8_t value)
733 breath_intensity = value;
736 void breathing_speed_default(void)
741 void breathing_speed_set(uint8_t value)
743 bool is_breathing_now = is_breathing();
744 uint8_t old_breath_speed = breath_speed;
746 if (is_breathing_now)
748 // Disable breathing interrupt
749 TIMSK1 &= ~_BV(OCIE1A);
752 breath_speed = value;
754 if (is_breathing_now)
756 // Adjust index to account for new speed
757 breathing_index = (( (uint8_t)( (breathing_index) >> old_breath_speed ) ) & 0x3F) << breath_speed;
759 // Enable breathing interrupt
760 TIMSK1 |= _BV(OCIE1A);
765 void breathing_speed_inc(uint8_t value)
767 if ((uint16_t)(breath_speed - value) > 10 )
769 breathing_speed_set(0);
773 breathing_speed_set(breath_speed - value);
777 void breathing_speed_dec(uint8_t value)
779 if ((uint16_t)(breath_speed + value) > 10 )
781 breathing_speed_set(10);
785 breathing_speed_set(breath_speed + value);
789 void breathing_defaults(void)
791 breathing_intensity_default();
792 breathing_speed_default();
793 breathing_halt = BREATHING_NO_HALT;
796 /* Breathing Sleep LED brighness(PWM On period) table
797 * (64[steps] * 4[duration]) / 64[PWM periods/s] = 4 second breath cycle
799 * http://www.wolframalpha.com/input/?i=%28sin%28+x%2F64*pi%29**8+*+255%2C+x%3D0+to+63
800 * (0..63).each {|x| p ((sin(x/64.0*PI)**8)*255).to_i }
802 static const uint8_t breathing_table[64] PROGMEM = {
803 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 6, 10,
804 15, 23, 32, 44, 58, 74, 93, 113, 135, 157, 179, 199, 218, 233, 245, 252,
805 255, 252, 245, 233, 218, 199, 179, 157, 135, 113, 93, 74, 58, 44, 32, 23,
806 15, 10, 6, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
809 ISR(TIMER1_COMPA_vect)
811 // OCR1x = (pgm_read_byte(&breathing_table[ ( (uint8_t)( (breathing_index++) >> breath_speed ) ) & 0x3F ] )) * breath_intensity;
814 uint8_t local_index = ( (uint8_t)( (breathing_index++) >> breath_speed ) ) & 0x3F;
816 if (((breathing_halt == BREATHING_HALT_ON) && (local_index == 0x20)) || ((breathing_halt == BREATHING_HALT_OFF) && (local_index == 0x3F)))
818 // Disable breathing interrupt
819 TIMSK1 &= ~_BV(OCIE1A);
822 OCR1x = (uint16_t)(((uint16_t)pgm_read_byte(&breathing_table[local_index]) * 257)) >> breath_intensity;
832 __attribute__ ((weak))
833 void backlight_init_ports(void)
838 __attribute__ ((weak))
839 void backlight_set(uint8_t level)
847 // Functions for spitting out values
850 void send_dword(uint32_t number) { // this might not actually work
851 uint16_t word = (number >> 16);
853 send_word(number & 0xFFFFUL);
856 void send_word(uint16_t number) {
857 uint8_t byte = number >> 8;
859 send_byte(number & 0xFF);
862 void send_byte(uint8_t number) {
863 uint8_t nibble = number >> 4;
865 send_nibble(number & 0xF);
868 void send_nibble(uint8_t number) {
872 unregister_code(KC_0);
875 register_code(KC_1 + (number - 1));
876 unregister_code(KC_1 + (number - 1));
879 register_code(KC_A + (number - 0xA));
880 unregister_code(KC_A + (number - 0xA));
885 void api_send_unicode(uint32_t unicode) {
888 dword_to_bytes(unicode, chunk);
889 MT_SEND_DATA(DT_UNICODE, chunk, 5);
893 __attribute__ ((weak))
894 void led_set_user(uint8_t usb_led) {
898 __attribute__ ((weak))
899 void led_set_kb(uint8_t usb_led) {
900 led_set_user(usb_led);
903 __attribute__ ((weak))
904 void led_init_ports(void)
909 __attribute__ ((weak))
910 void led_set(uint8_t usb_led)
915 // // Using PE6 Caps Lock LED
916 // if (usb_led & (1<<USB_LED_CAPS_LOCK))
933 //------------------------------------------------------------------------------
934 // Override these functions in your keymap file to play different tunes on
935 // different events such as startup and bootloader jump
937 __attribute__ ((weak))
938 void startup_user() {}
940 __attribute__ ((weak))
941 void shutdown_user() {}
943 //------------------------------------------------------------------------------