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.

53 lines
1.1 KiB

  1. #include "e6v2.h"
  2. void matrix_init_kb(void) {
  3. // put your keyboard start-up code here
  4. // runs once when the firmware starts up
  5. matrix_init_user();
  6. }
  7. void matrix_scan_kb(void) {
  8. // put your looping keyboard code here
  9. // runs every cycle (a lot)
  10. matrix_scan_user();
  11. }
  12. bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
  13. // put your per-action keyboard code here
  14. // runs for every action, just before processing by the firmware
  15. return process_record_user(keycode, record);
  16. }
  17. void led_set_kb(uint8_t usb_led) {
  18. // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
  19. DDRB |= (1<<6);
  20. if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
  21. // output low
  22. DDRB |= (1<<2);
  23. PORTB &= ~(1<<2);
  24. } else {
  25. // Hi-Z
  26. DDRB &= ~(1<<2);
  27. PORTB &= ~(1<<2);
  28. }
  29. // DDRB |= (1<<7);
  30. // DDRB |= (1<<1);
  31. // DDRB |= (1<<3);
  32. // DDRE |= (1<<6);
  33. if (usb_led == 0){
  34. PORTB |= (1<<6);
  35. // PORTB |= (1<<7);
  36. // PORTB |= (1<<1);
  37. // PORTB |= (1<<3);
  38. // PORTE |= (1<<6);
  39. }
  40. else{
  41. PORTB &= ~(1<<6);
  42. // PORTB &= ~(1<<7);
  43. }
  44. led_set_user(usb_led);
  45. }