logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

solderable.c (2213B)


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