config.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. #ifdef POINTING_DEVICE_ENABLE
  23. # include "pointing/pointing_config.h"
  24. #endif // POINTING_DEVICE_ENABLE
  25. #ifdef AUDIO_ENABLE
  26. # include "audio_config.h"
  27. #endif // AUDIO_ENABLE
  28. #if defined(WPM_ENABLE)
  29. // # define WPM_LAUNCH_CONTROL
  30. // # define WPM_UNFILTERED
  31. # define WPM_ALLOW_COUNT_REGRESSION
  32. # define WPM_SAMPLE_SECONDS 10
  33. # define WPM_SAMPLE_PERIODS 50
  34. # define WPM_ESTIMATED_WORD_SIZE 5
  35. #endif
  36. #define UNICODE_SELECTED_MODES UNICODE_MODE_WINCOMPOSE, UNICODE_MODE_MACOS
  37. #ifndef ONESHOT_TAP_TOGGLE
  38. # define ONESHOT_TAP_TOGGLE 2
  39. #endif // !ONESHOT_TAP_TOGGLE
  40. #ifndef ONESHOT_TIMEOUT
  41. # define ONESHOT_TIMEOUT 3000
  42. #endif // !ONESHOT_TIMEOUT
  43. #if defined(PER_KEY_TAPPING)
  44. # define PERMISSIVE_HOLD_PER_KEY
  45. # define QUICK_TAP_TERM_PER_KEY
  46. # define HOLD_ON_OTHER_KEY
  47. # define RETRO_TAPPING_PER_KEY
  48. # define HOLD_ON_OTHER_KEY_PRESS_PER_KEY
  49. # define TAPPING_TERM_PER_KEY
  50. #else
  51. # define IGNORE_MOD_TAP_INTERRUPT
  52. # undef PERMISSIVE_HOLD
  53. #endif
  54. #ifndef TAPPING_TOGGLE
  55. # define TAPPING_TOGGLE 1
  56. #endif
  57. #define TAP_CODE_DELAY 5
  58. /* Disable unused and unneeded features to reduce on firmware size */
  59. #ifdef LOCKING_SUPPORT_ENABLE
  60. # undef LOCKING_SUPPORT_ENABLE
  61. #endif
  62. #ifdef LOCKING_RESYNC_ENABLE
  63. # undef LOCKING_RESYNC_ENABLE
  64. #endif
  65. #ifdef CONVERT_TO_PROTON_C
  66. // pins that are available but not present on Pro Micro
  67. # define A3 PAL_LINE(GPIOA, 3)
  68. # define A4 PAL_LINE(GPIOA, 4)
  69. # define A5 PAL_LINE(GPIOA, 5)
  70. # define A6 PAL_LINE(GPIOA, 6)
  71. # define A7 PAL_LINE(GPIOA, 7)
  72. # define A8 PAL_LINE(GPIOA, 8)
  73. # define A13 PAL_LINE(GPIOA, 13)
  74. # define A14 PAL_LINE(GPIOA, 14)
  75. # define A15 PAL_LINE(GPIOA, 15)
  76. # define B10 PAL_LINE(GPIOB, 10)
  77. # define B11 PAL_LINE(GPIOB, 11)
  78. # define B12 PAL_LINE(GPIOB, 12)
  79. # define C13 PAL_LINE(GPIOC, 13)
  80. # define C14 PAL_LINE(GPIOC, 14)
  81. # define C15 PAL_LINE(GPIOC, 15)
  82. #endif
  83. #define ENABLE_COMPILE_KEYCODE
  84. #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD