config.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. // Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. // Use custom magic number so that when switching branches, EEPROM always gets reset
  5. #define EECONFIG_MAGIC_NUMBER (uint16_t)0x1339
  6. #ifdef IS_COMMAND
  7. # undef IS_COMMAND
  8. #endif
  9. #define IS_COMMAND() (((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) == MOD_MASK_SHIFT)
  10. #if defined(SPLIT_KEYBOARD)
  11. # include "split/split_config.h"
  12. #endif
  13. #ifdef RGBLIGHT_ENABLE
  14. # include "rgb/rgblight_config.h"
  15. #endif // RGBLIGHT_ENABLE
  16. #ifdef RGB_MATRIX_ENABLE
  17. # include "rgb/rgb_matrix_config.h"
  18. #endif // RGB_MATRIX_ENABLE
  19. #ifdef OLED_ENABLE
  20. # include "oled/oled_config.h"
  21. #endif
  22. #if defined(WPM_ENABLE)
  23. // # define WPM_LAUNCH_CONTROL
  24. // # define WPM_ALLOW_COUNT_REGRESSOIN
  25. // # define WPM_UNFILTERED
  26. # define WPM_SAMPLE_SECONDS 10
  27. # define WPM_SAMPLE_PERIODS 50
  28. # define WPM_ESTIMATED_WORD_SIZE 5
  29. #endif
  30. #ifdef AUDIO_ENABLE
  31. # define AUDIO_CLICKY
  32. # define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f
  33. # ifdef USER_SONG_LIST
  34. # define STARTUP_SONG SONG(RICK_ROLL)
  35. # define GOODBYE_SONG SONG(SONIC_RING)
  36. # define DEFAULT_LAYER_SONGS \
  37. { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND), SONG(OVERWATCH_THEME) }
  38. # define UNICODE_SONG_MAC SONG(MARIO_THEME)
  39. # define UNICODE_SONG_LNX SONG(MARIO_POWERUP)
  40. # define UNICODE_SONG_WIN SONG(MARIO_ONEUP)
  41. # define UNICODE_SONG_BSD SONG(RICK_ROLL)
  42. # define UNICODE_SONG_WINC SONG(RICK_ROLL)
  43. # else
  44. # define STARTUP_SONG SONG(STARTUP_SOUND)
  45. # define GOODBYE_SONG SONG(GOODBYE_SOUND)
  46. # define DEFAULT_LAYER_SONGS \
  47. { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND), SONG(WORKMAN_SOUND) }
  48. # define UNICODE_SONG_MAC SONG(QWERTY_SOUND)
  49. # define UNICODE_SONG_LNX SONG(COLEMAK_SOUND)
  50. # define UNICODE_SONG_WIN SONG(DVORAK_SOUND)
  51. # define UNICODE_SONG_BSD SONG(WORKMAN_SOUND)
  52. # define UNICODE_SONG_WINC SONG(PLOVER_GOODBYE_SOUND)
  53. # endif
  54. #endif // !AUDIO_ENABLE
  55. #define UNICODE_SELECTED_MODES UNICODE_MODE_WINCOMPOSE, UNICODE_MODE_MACOS
  56. // #define WPM_ESTIMATED_WORD_SIZE 5
  57. #define WPM_ALLOW_COUNT_REGRESSION
  58. // #define WPM_UNFILTERED
  59. // #define WPM_SAMPLE_SECONDS 5
  60. // #define WPM_SAMPLE_PERIODS 50
  61. // #define WPM_LAUNCH_CONTROL
  62. #ifndef ONESHOT_TAP_TOGGLE
  63. # define ONESHOT_TAP_TOGGLE 2
  64. #endif // !ONESHOT_TAP_TOGGLE
  65. #ifndef ONESHOT_TIMEOUT
  66. # define ONESHOT_TIMEOUT 3000
  67. #endif // !ONESHOT_TIMEOUT
  68. #if defined(PER_KEY_TAPPING)
  69. # define IGNORE_MOD_TAP_INTERRUPT_PER_KEY
  70. # define PERMISSIVE_HOLD_PER_KEY
  71. # define TAPPING_FORCE_HOLD_PER_KEY
  72. # define HOLD_ON_OTHER_KEY
  73. # define RETRO_TAPPING_PER_KEY
  74. # define HOLD_ON_OTHER_KEY_PRESS_PER_KEY
  75. # define TAPPING_TERM_PER_KEY
  76. #else
  77. # define IGNORE_MOD_TAP_INTERRUPT
  78. # undef PERMISSIVE_HOLD
  79. #endif
  80. #ifndef TAPPING_TOGGLE
  81. # define TAPPING_TOGGLE 1
  82. #endif
  83. #define TAP_CODE_DELAY 5
  84. /* Disable unused and unneeded features to reduce on firmware size */
  85. #ifdef LOCKING_SUPPORT_ENABLE
  86. # undef LOCKING_SUPPORT_ENABLE
  87. #endif
  88. #ifdef LOCKING_RESYNC_ENABLE
  89. # undef LOCKING_RESYNC_ENABLE
  90. #endif
  91. #ifdef CONVERT_TO_PROTON_C
  92. // pins that are available but not present on Pro Micro
  93. # define A3 PAL_LINE(GPIOA, 3)
  94. # define A4 PAL_LINE(GPIOA, 4)
  95. # define A5 PAL_LINE(GPIOA, 5)
  96. # define A6 PAL_LINE(GPIOA, 6)
  97. # define A7 PAL_LINE(GPIOA, 7)
  98. # define A8 PAL_LINE(GPIOA, 8)
  99. # define A13 PAL_LINE(GPIOA, 13)
  100. # define A14 PAL_LINE(GPIOA, 14)
  101. # define A15 PAL_LINE(GPIOA, 15)
  102. # define B10 PAL_LINE(GPIOB, 10)
  103. # define B11 PAL_LINE(GPIOB, 11)
  104. # define B12 PAL_LINE(GPIOB, 12)
  105. # define C13 PAL_LINE(GPIOC, 13)
  106. # define C14 PAL_LINE(GPIOC, 14)
  107. # define C15 PAL_LINE(GPIOC, 15)
  108. #endif
  109. #define ENABLE_COMPILE_KEYCODE
  110. #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD