logo

qmk_firmware

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

rev2.c (788B)


  1. #include "quantum.h"
  2. #include "print.h"
  3. void backlight_init_ports(void) {
  4. print("init_backlight_pin()\n");
  5. // Set our LED pins as output
  6. gpio_set_pin_output(D6); // Esc
  7. gpio_set_pin_output(B7); // Page Up
  8. gpio_set_pin_output(D4); // Arrows
  9. // Set our LED pins low
  10. gpio_write_pin_low(D6); // Esc
  11. gpio_write_pin_low(B7); // Page Up
  12. gpio_write_pin_low(D4); // Arrows
  13. }
  14. void backlight_set(uint8_t level) {
  15. if ( level == 0 ) {
  16. // Turn off light
  17. gpio_write_pin_high(D6); // Esc
  18. gpio_write_pin_high(B7); // Page Up
  19. gpio_write_pin_high(D4); // Arrows
  20. } else {
  21. // Turn on light
  22. gpio_write_pin_low(D6); // Esc
  23. gpio_write_pin_low(B7); // Page Up
  24. gpio_write_pin_low(D4); // Arrows
  25. }
  26. }