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.

76 lines
2.0 KiB

  1. /* Copyright 2021 datafx
  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 "solderable.h"
  17. #include "quantum.h"
  18. #define noLed {255,255}
  19. #define ledSollSP (80+3)
  20. #define ledNumSP (80+7)
  21. #define ledCapSP (80+8)
  22. void backlight_init_ports(void) {
  23. setPinOutput(Lseg0);
  24. setPinOutput(Lseg1);
  25. setPinOutput(Lseg2);
  26. setPinOutput(Lseg3);
  27. setPinOutput(Lseg4);
  28. setPinOutput(Lseg5);
  29. setPinOutput(Lcom0);
  30. setPinOutput(Lcom1);
  31. setPinOutput(Lcom2);
  32. setPinOutput(Lcom3);
  33. setPinOutput(Lcom4);
  34. setPinOutput(Lcom5);
  35. setPinOutput(Lcom6);
  36. setPinOutput(Lcom7);
  37. setPinOutput(Lcom8);
  38. setPinOutput(Lcom9);
  39. setPinOutput(Lcom10);
  40. setPinOutput(Lcom11);
  41. setPinOutput(Lcom12);
  42. setPinOutput(Lcom13);
  43. setPinOutput(Lcom14);
  44. setPinOutput(Lcom15);
  45. }
  46. void backlight_set(uint8_t level) {
  47. }
  48. void backlight_task(void) {
  49. // This is a temporary workaround to get the status LEDs working until we can figure out the LED matrix
  50. led_t host_leds = host_keyboard_led_state();
  51. if (host_leds.scroll_lock) {
  52. writePinHigh(Lcom3);
  53. writePinHigh(Lseg5);
  54. } else {
  55. writePinLow(Lcom3);
  56. }
  57. if (host_leds.num_lock) {
  58. writePinHigh(Lcom7);
  59. writePinHigh(Lseg5);
  60. } else {
  61. writePinLow(Lcom7);
  62. }
  63. if (host_leds.caps_lock) {
  64. writePinHigh(Lcom8);
  65. writePinHigh(Lseg5);
  66. } else {
  67. writePinLow(Lcom8);
  68. }
  69. }