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.

41 lines
1.2 KiB

  1. /*
  2. * Copyright 2019 Ethan Durrant (emdarcher)
  3. *
  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. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #include "quantum.h"
  18. void keyboard_pre_init_kb(void){
  19. //init the CAPS LOCK LED pin as an output
  20. setPinOutput(D1);
  21. //init the Backlight Pin as an output
  22. setPinOutput(D4);
  23. //call any user initialization code
  24. keyboard_pre_init_user();
  25. }
  26. void led_set_kb(uint8_t usb_led){
  27. //control the caps lock LED
  28. if(IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)){
  29. //set led pin to high
  30. writePinHigh(D1);
  31. } else {
  32. //set to low
  33. writePinLow(D1);
  34. }
  35. //call any user LED functions
  36. led_set_user(usb_led);
  37. }