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.

63 lines
2.5 KiB

  1. /* Copyright 2019 ash0x0 2021 peepeetee, deadolus
  2. *
  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. *
  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. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include QMK_KEYBOARD_H
  17. #include "print.h"
  18. #include <string.h>
  19. // HID has not yet been implemented for this keyboard
  20. // #include "raw_hid.h"
  21. #define MILLISECONDS_IN_SECOND 1000
  22. // These are just to make it neater to use builtin HSV values in the keymap
  23. #define RED {HSV_RED}
  24. #define CORAL {HSV_CORAL}
  25. #define ORANGE {HSV_ORANGE}
  26. #define GOLDEN {HSV_GOLDENROD}
  27. #define GOLD {HSV_GOLD}
  28. #define YELLOW {HSV_YELLOW}
  29. #define CHART {HSV_CHARTREUSE}
  30. #define GREEN {HSV_GREEN}
  31. #define SPRING {HSV_SPRINGGREEN}
  32. #define TURQ {HSV_TURQUOISE}
  33. #define TEAL {HSV_TEAL}
  34. #define CYAN {HSV_CYAN}
  35. #define AZURE {HSV_AZURE}
  36. #define BLUE {HSV_BLUE}
  37. #define PURPLE {HSV_PURPLE}
  38. #define MAGENTA {HSV_MAGENTA}
  39. #define PINK {HSV_PINK}
  40. //========================================================== CONFIGURABLE DEFAULTS ==========================================================
  41. #define RGB_DEFAULT_TIME_OUT 30
  42. #define RGB_FAST_MODE_TIME_OUT 3
  43. #define RGB_TIME_OUT_MAX 600
  44. #define RGB_TIME_OUT_MIN 10
  45. #define RGB_TIME_OUT_STEP 10
  46. extern bool g_suspend_state;
  47. bool disable_layer_color;
  48. uint8_t dfa_state; //state for my language switching DFA
  49. bool rgb_enabled_flag; // Current LED state flag. If false then LED is off.
  50. bool rgb_time_out_enable; // Idle LED toggle enable. If false then LED will not turn off after idle timeout.
  51. bool rgb_time_out_fast_mode_enabled; // Enable flag for RGB timeout fast mode
  52. bool rgb_time_out_user_value; // This holds the toggle value set by user with ROUT_TG. It's necessary as RGB_TOG changes timeout enable.
  53. uint16_t rgb_time_out_seconds; // Idle LED timeout value, in seconds not milliseconds
  54. uint16_t rgb_time_out_saved_seconds; // The saved user config for RGB timeout period
  55. led_flags_t rgb_time_out_saved_flag; // Store LED flag before timeout so it can be restored when LED is turned on again.