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.

30 lines
607 B

  1. #include "amjpad.h"
  2. #include "led.h"
  3. void matrix_init_kb(void) {
  4. // put your keyboard start-up code here
  5. // runs once when the firmware starts up
  6. matrix_init_user();
  7. led_init_ports();
  8. };
  9. void matrix_scan_kb(void) {
  10. // put your looping keyboard code here
  11. // runs every cycle (a lot)
  12. matrix_scan_user();
  13. };
  14. void led_init_ports(void) {
  15. // * Set our LED pins as output
  16. DDRD |= (1<<6);
  17. }
  18. void led_set_kb(uint8_t usb_led) {
  19. if (usb_led & (1<<USB_LED_NUM_LOCK)) {
  20. // Turn numlock on
  21. PORTD &= ~(1<<6);
  22. } else {
  23. // Turn numlock off
  24. PORTD |= (1<<6);
  25. }
  26. }