atomic.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #include "atomic.h"
  2. __attribute__ ((weak))
  3. void matrix_init_user(void) {
  4. // leave this function blank - it can be defined in a keymap file
  5. };
  6. __attribute__ ((weak))
  7. void matrix_scan_user(void) {
  8. // leave this function blank - it can be defined in a keymap file
  9. }
  10. __attribute__ ((weak))
  11. void process_action_user(keyrecord_t *record) {
  12. // leave this function blank - it can be defined in a keymap file
  13. }
  14. __attribute__ ((weak))
  15. void led_set_user(uint8_t usb_led) {
  16. // leave this function blank - it can be defined in a keymap file
  17. }
  18. void matrix_init_kb(void) {
  19. // put your keyboard start-up code here
  20. // runs once when the firmware starts up
  21. MCUCR |= (1<<JTD);
  22. MCUCR |= (1<<JTD);
  23. #ifdef BACKLIGHT_ENABLE
  24. backlight_init_ports();
  25. #endif
  26. // Turn status LED on
  27. DDRE |= (1<<6);
  28. PORTE |= (1<<6);
  29. matrix_init_user();
  30. }
  31. void matrix_scan_kb(void) {
  32. // put your looping keyboard code here
  33. // runs every cycle (a lot)
  34. matrix_scan_user();
  35. }
  36. void process_action_kb(keyrecord_t *record) {
  37. // put your per-action keyboard code here
  38. // runs for every action, just before processing by the firmware
  39. process_action_user(record);
  40. }
  41. void led_set_kb(uint8_t usb_led) {
  42. // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
  43. led_set_user(usb_led);
  44. }