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.

68 lines
1.1 KiB

7 years ago
7 years ago
  1. #include "vision_division.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. if (usb_led & (1 << USB_LED_CAPS_LOCK))
  20. {
  21. // HI
  22. DDRD |= (1<<4);
  23. PORTD |= (1<<4);
  24. }
  25. else
  26. {
  27. // Hi-Z
  28. DDRD &= ~(1<<4);
  29. PORTD &= ~(1<<4);
  30. }
  31. if (usb_led & (1 << USB_LED_NUM_LOCK))
  32. {
  33. // HI
  34. DDRD |= (1<<5);
  35. PORTD |= (1<<5);
  36. }
  37. else
  38. {
  39. // Hi-Z
  40. DDRD &= ~(1<<5);
  41. PORTD &= ~(1<<5);
  42. }
  43. if (usb_led & (1 << USB_LED_SCROLL_LOCK))
  44. {
  45. // HI
  46. DDRD |= (1<<6);
  47. PORTD |= (1<<6);
  48. }
  49. else
  50. {
  51. // Hi-Z
  52. DDRD &= ~(1<<6);
  53. PORTD &= ~(1<<6);
  54. }
  55. led_set_user(usb_led);
  56. }