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.

85 lines
2.4 KiB

  1. /*
  2. Copyright 2021 monksoffunk
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #pragma once
  15. // RGB LED support
  16. // see ./rules.mk: LED_ANIMATIONS = yes or no
  17. // see ./rules.mk: LED_BACK_ENABLE or LED_UNDERGLOW_ENABLE set yes
  18. #ifdef RGBLIGHT_ENABLE
  19. #define RGBLIGHT_SPLIT
  20. #ifdef RGBLED_BACK
  21. #ifdef RGBLED_CONT
  22. #define RGBLIGHT_LED_COUNT 48
  23. #define RGBLED_SPLIT { 24, 24 }
  24. #else
  25. #define RGBLIGHT_LED_COUNT 24
  26. #endif
  27. #else
  28. #ifdef RGBLED_BOTH
  29. #ifdef RGBLED_CONT
  30. #define RGBLIGHT_LED_COUNT 60
  31. #define RGBLED_SPLIT { 30, 30 }
  32. #else
  33. #define RGBLIGHT_LED_COUNT 30
  34. #endif
  35. #else
  36. #ifdef RGBLED_CONT
  37. #define RGBLIGHT_LED_COUNT 12
  38. #define RGBLED_SPLIT { 6, 6 }
  39. #else
  40. #define RGBLIGHT_LED_COUNT 6
  41. #endif
  42. #endif
  43. #endif
  44. #endif
  45. #ifndef IOS_DEVICE_ENABLE
  46. #if (RGBLIGHT_LED_COUNT <= 6) || (defined(RGBLED_CONT) && (RGBLIGHT_LED_COUNT <= 12))
  47. #define RGBLIGHT_LIMIT_VAL 255
  48. #else
  49. #if (RGBLIGHT_LED_COUNT <= 16) || (defined(RGBLED_CONT) && (RGBLIGHT_LED_COUNT <= 32))
  50. #define RGBLIGHT_LIMIT_VAL 130
  51. #else
  52. #define RGBLIGHT_LIMIT_VAL 120
  53. #endif
  54. #endif
  55. #define RGBLIGHT_VAL_STEP 17
  56. #else
  57. #if (RGBLIGHT_LED_COUNT <= 6) || (defined(RGBLED_CONT) && (RGBLIGHT_LED_COUNT <= 12))
  58. #define RGBLIGHT_LIMIT_VAL 90
  59. #else
  60. #if (RGBLIGHT_LED_COUNT <= 16) || (defined(RGBLED_CONT) && (RGBLIGHT_LED_COUNT <= 32))
  61. #define RGBLIGHT_LIMIT_VAL 45
  62. #else
  63. #define RGBLIGHT_LIMIT_VAL 35
  64. #endif
  65. #endif
  66. #define RGBLIGHT_VAL_STEP 4
  67. #endif
  68. #if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
  69. // USB_MAX_POWER_CONSUMPTION value
  70. // 120 RGBoff
  71. // 330 RGB 6
  72. // 300 RGB 32
  73. #define USB_MAX_POWER_CONSUMPTION 400
  74. #else
  75. // fix iPhone and iPad power adapter issue
  76. // iOS device need lessthan 100
  77. #define USB_MAX_POWER_CONSUMPTION 100
  78. #endif