You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.9 KiB

  1. /*
  2. Copyright 2012 Jun Wako <wakojun@gmail.com>
  3. Copyright 2015 Jack Humbert
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #pragma once
  16. #define PHYSICAL_LEDS_ENABLE
  17. #define RGBLIGHT_TIMER
  18. #ifndef IOS_DEVICE_ENABLE
  19. #if RGBLIGHT_LED_COUNT <= 6
  20. #define RGBLIGHT_LIMIT_VAL 255
  21. #else
  22. #define RGBLIGHT_LIMIT_VAL 130
  23. #endif
  24. #define RGBLIGHT_VAL_STEP 8
  25. #else
  26. #if RGBLIGHT_LED_COUNT <= 6
  27. #define RGBLIGHT_LIMIT_VAL 90
  28. #else
  29. #define RGBLIGHT_LIMIT_VAL 45
  30. #endif
  31. #define RGBLIGHT_VAL_STEP 4
  32. #endif
  33. #if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
  34. #define USB_MAX_POWER_CONSUMPTION 400
  35. #else
  36. // iOS device need lessthan 100
  37. #define USB_MAX_POWER_CONSUMPTION 100
  38. #endif
  39. #define NUM_LOCK_LED_PIN B6
  40. #define CAPS_LOCK_LED_PIN B5
  41. // #define SCROLL_LOCK_LED_PIN B6
  42. // #define NUM_NMOSFET //uncomment this if you using n-mosfet
  43. // #define CAPS_NMOSFET //uncomment this if you using n-mosfet
  44. // #define SCROLL_NMOSFET //uncomment this if you using n-mosfet
  45. // #define NUM_INVERT // uncomment this if you want to reverse logic of numlock
  46. // This will make it light up only when lock is off
  47. // (Doesn't work on mac. There is no num lock, so it will be always off and lit)
  48. #ifdef NUM_NMOSFET
  49. #define RESET_NUM_LOCK_LED() writePinLow(NUM_LOCK_LED_PIN)
  50. #ifdef NUM_INVERT
  51. #define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock)
  52. #else
  53. #define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock)
  54. #endif // NUM_INVERT
  55. #else
  56. #define RESET_NUM_LOCK_LED() writePinHigh(NUM_LOCK_LED_PIN)
  57. #ifdef NUM_INVERT
  58. #define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock)
  59. #else
  60. #define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock)
  61. #endif // NUM_INVERT
  62. #endif // NUM_NMOSFET
  63. #ifdef CAPS_NMOSFET
  64. #define RESET_CAPS_LOCK_LED() writePinLow(CAPS_LOCK_LED_PIN)
  65. #define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, led_state.caps_lock)
  66. #else
  67. #define RESET_CAPS_LOCK_LED() writePinHigh(CAPS_LOCK_LED_PIN)
  68. #define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, !led_state.caps_lock)
  69. #endif // CAPS_NMOSFET
  70. #ifdef SCROLL_NMOSFET
  71. #define RESET_SCROLL_LOCK_LED() writePinLow(SCROLL_LOCK_LED_PIN)
  72. #define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock)
  73. #else
  74. #define RESET_SCROLL_LOCK_LED() writePinHigh(SCROLL_LOCK_LED_PIN)
  75. #define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock)
  76. #endif // SCROLL_NMOSFET