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.

62 lines
1.2 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. #include "frosty_flake.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. DDRB |= (1<<7);
  19. DDRC |= (1<<5) | (1<<6);
  20. print_dec(usb_led);
  21. if (usb_led & (1<<USB_LED_CAPS_LOCK))
  22. PORTC &= ~(1<<5);
  23. else
  24. PORTC |= (1<<5);
  25. if (usb_led & (1<<USB_LED_NUM_LOCK))
  26. PORTB &= ~(1<<7);
  27. else
  28. PORTB |= (1<<7);
  29. if (usb_led & (1<<USB_LED_SCROLL_LOCK))
  30. PORTC &= ~(1<<6);
  31. else
  32. PORTC |= (1<<6);
  33. led_set_user(usb_led);
  34. }
  35. __attribute__ ((weak))
  36. void matrix_init_user(void) {
  37. }
  38. __attribute__ ((weak))
  39. void matrix_scan_user(void) {
  40. }
  41. __attribute__ ((weak))
  42. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  43. return true;
  44. }
  45. __attribute__ ((weak))
  46. void led_set_user(uint8_t usb_led) {
  47. }