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.

29 lines
701 B

  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. DDRD |= (1<<6); // Esc
  7. DDRB |= (1<<7); // Page Up
  8. DDRD |= (1<<4); // Arrows
  9. // Set our LED pins low
  10. PORTD &= ~(1<<6); // Esc
  11. PORTB &= ~(1<<7); // Page Up
  12. PORTD &= ~(1<<4); // Arrows
  13. }
  14. void backlight_set(uint8_t level) {
  15. if ( level == 0 ) {
  16. // Turn off light
  17. PORTD |= (1<<6); // Esc
  18. PORTB |= (1<<7); // Page Up
  19. PORTD |= (1<<4); // Arrows
  20. } else {
  21. // Turn on light
  22. PORTD &= ~(1<<6); // Esc
  23. PORTB &= ~(1<<7); // Page Up
  24. PORTD &= ~(1<<4); // Arrows
  25. }
  26. }