stanrc85.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include "stanrc85.h"
  2. __attribute__ ((weak))
  3. bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
  4. return true;
  5. }
  6. qk_tap_dance_action_t tap_dance_actions[] = {
  7. [TD_WIN] = ACTION_TAP_DANCE_DOUBLE(KC_CAD, KC_LOCK),
  8. [TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRV)
  9. };
  10. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  11. switch (keycode) {
  12. case KC_MAKE:
  13. if (!record->event.pressed) {
  14. uint8_t mods = get_mods();
  15. clear_mods();
  16. send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10);
  17. if (mods & MOD_MASK_SHIFT) {
  18. //RESET board for flashing if SHIFT held or tapped with KC_MAKE
  19. #if defined(__arm__)
  20. send_string_with_delay_P(PSTR(":dfu-util"), 10);
  21. #elif defined(BOOTLOADER_DFU)
  22. send_string_with_delay_P(PSTR(":dfu"), 10);
  23. #elif defined(BOOTLOADER_HALFKAY)
  24. send_string_with_delay_P(PSTR(":teensy"), 10);
  25. #elif defined(BOOTLOADER_CATERINA)
  26. send_string_with_delay_P(PSTR(":avrdude"), 10);
  27. #endif // bootloader options
  28. send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10);
  29. reset_keyboard();
  30. }
  31. if (mods & MOD_MASK_CTRL) {
  32. send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10);
  33. }
  34. send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10);
  35. set_mods(mods);
  36. }
  37. return false;
  38. break;
  39. }
  40. return process_record_keymap(keycode, record);
  41. }