pvinis.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #include "pvinis.h"
  2. #include "version.h"
  3. #ifdef AUDIO_ENABLE
  4. #include "audio.h"
  5. #endif // AUDIO_ENABLE
  6. #ifdef AUDIO_ENABLE
  7. // float tone_katamari_rolling_star[][2] = SONG(KATAMARI_ROLLING_STAR);
  8. #endif // AUDIO_ENABLE
  9. // SYMBOL + SYSCTL = KBCTL
  10. uint32_t layer_state_set_user(uint32_t state) {
  11. uint32_t intermediate_state = update_tri_layer_state(state, LR_SYMBOL, LR_SYSCTL, LR_KBCTL);
  12. intermediate_state = layer_state_set_user_local(intermediate_state);
  13. return intermediate_state;
  14. }
  15. // functions for the individual keymaps to implement if they need something extra
  16. __attribute__ ((weak))
  17. bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
  18. return true;
  19. }
  20. // handle my own keycodes
  21. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  22. switch (keycode) {
  23. case PV_VRSN:
  24. if (record->event.pressed) {
  25. SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
  26. }
  27. return false;
  28. case PV_MAKE:
  29. if (!record->event.pressed) {
  30. SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP
  31. #if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
  32. ":dfu"
  33. #elif defined(BOOTLOADER_HALFKAY)
  34. ":teensy"
  35. #elif defined(BOOTLOADER_CATERINA)
  36. ":avrdude"
  37. #endif
  38. SS_TAP(X_ENTER)
  39. );
  40. }
  41. return false;
  42. case PV_FLSH:
  43. reset_keyboard();
  44. return false;
  45. case PV_KTMR:
  46. if (record->event.pressed) {
  47. #ifdef AUDIO_ENABLE
  48. // PLAY_SONG(tone_katamari_rolling_star);
  49. #endif
  50. }
  51. return false;
  52. }
  53. return process_record_keymap(keycode, record);
  54. }
  55. #ifdef TAP_DANCE_ENABLE
  56. qk_tap_dance_action_t tap_dance_actions[] = {
  57. };
  58. #endif // TAP_DANCE_ENABLE
  59. // init stuff
  60. void keyboard_post_init_user(void) {
  61. keyboard_post_init_user_local();
  62. }
  63. // default functions
  64. __attribute__ ((weak))
  65. void keyboard_post_init_user_local(void) {}
  66. __attribute__ ((weak))
  67. uint32_t layer_state_set_user_local(uint32_t state) {
  68. return state;
  69. }