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.

142 lines
2.2 KiB

  1. #include "mini.h"
  2. /*KNOPS_MISC*/
  3. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  4. /*KNOPS_KEYMAP*/
  5. };
  6. void set_led_state(int ledId, bool state) {
  7. if(state) {
  8. switch(ledId) {
  9. /* LED 0 to 5 are the leds of each keyswitch. From left to right, top to bottom. These are equal to the numbers in the legends of the default keycaps. */
  10. case 0:
  11. PORTD |= (1<<7);
  12. break;
  13. case 1:
  14. if((PINB & (1 << 7)) != 0) {
  15. PORTC |= (1<<6);
  16. } else {
  17. PORTC |= (1<<7);
  18. }
  19. break;
  20. case 2:
  21. PORTD |= (1<<4);
  22. break;
  23. case 3:
  24. PORTE |= (1<<6);
  25. break;
  26. case 4:
  27. PORTB |= (1<<4);
  28. break;
  29. case 5:
  30. PORTD |= (1<<6);
  31. break;
  32. /* LED 6 to 8 are the three layer leds in front of the device from left to right. */
  33. case 6:
  34. PORTD &= ~(1<<5);
  35. break;
  36. case 7:
  37. PORTB |= (1<<6);
  38. break;
  39. case 8:
  40. PORTB &= ~(1<<0);
  41. break;
  42. }
  43. } else {
  44. switch(ledId) {
  45. case 0:
  46. PORTD &= ~(1<<7);
  47. break;
  48. case 1:
  49. if((PINB & (1 << 7)) != 0) {
  50. PORTC &= ~(1<<6);
  51. } else {
  52. PORTC &= ~(1<<7);
  53. }
  54. break;
  55. case 2:
  56. PORTD &= ~(1<<4);
  57. break;
  58. case 3:
  59. PORTE &= ~(1<<6);
  60. break;
  61. case 4:
  62. PORTB &= ~(1<<4);
  63. break;
  64. case 5:
  65. PORTD &= ~(1<<6);
  66. break;
  67. case 6:
  68. PORTD |= (1<<5);
  69. break;
  70. case 7:
  71. PORTB &= ~(1<<6);
  72. break;
  73. case 8:
  74. PORTB |= (1<<0);
  75. break;
  76. }
  77. }
  78. }
  79. void led_init_ports_user() {
  80. PORTB |= (1 << 7);
  81. DDRB &= ~(1<<7);
  82. DDRD |= (1<<7);
  83. DDRC |= (1<<6);
  84. DDRC |= (1<<7);
  85. DDRD |= (1<<4);
  86. DDRE |= (1<<6);
  87. DDRB |= (1<<4);
  88. DDRD |= (1<<6);
  89. DDRD |= (1<<5);
  90. DDRB |= (1<<6);
  91. DDRB |= (1<<0);
  92. }
  93. void led_set_layer(int layer) {
  94. /*KNOPS_SIMPLELED_STATES*/
  95. }
  96. void matrix_init_user(void) {
  97. led_init_ports_user();
  98. led_set_layer(1);
  99. /*KNOPS_INIT*/
  100. }
  101. const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
  102. //keyevent_t event = record->event;
  103. /*KNOPS_MACRO*/
  104. return NULL;
  105. }
  106. void matrix_scan_user(void) {
  107. /*KNOPS_SCAN*/
  108. }
  109. void led_set_user(uint8_t usb_led) {
  110. /*KNOPS_FUNCTIONALLED_STATES*/
  111. }
  112. bool process_record_user (uint16_t keycode, keyrecord_t *record) {
  113. /*KNOPS_PROCESS_STATE*/
  114. return NULL;
  115. }