aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawnerd <Pawnerd@users.noreply.github.com>2018-03-05 03:29:38 +0100
committerJack Humbert <jack.humb@gmail.com>2018-03-04 21:29:38 -0500
commit12c8ee956dc0230b571bc51f785ae417073d5c67 (patch)
tree8d66546d16e562979c60282582329f4c552e478b
parentb36b4382d0a1da12492c14a8b7f25ca036e0af6d (diff)
downloadqmk_firmware-12c8ee956dc0230b571bc51f785ae417073d5c67.tar.gz
qmk_firmware-12c8ee956dc0230b571bc51f785ae417073d5c67.zip
Add knops configurator support (#2474)
* Committed initial version of the knops configurator. * Added support for the Knops v1.1
-rw-r--r--keyboards/knops/mini/keymaps/default/keymap.c17
-rw-r--r--keyboards/knops/mini/keymaps/knops/keymap.c30
2 files changed, 36 insertions, 11 deletions
diff --git a/keyboards/knops/mini/keymaps/default/keymap.c b/keyboards/knops/mini/keymaps/default/keymap.c
index e7773c0c0..40714c8a5 100644
--- a/keyboards/knops/mini/keymaps/default/keymap.c
+++ b/keyboards/knops/mini/keymaps/default/keymap.c
@@ -107,7 +107,11 @@ void set_switch_led(int ledId, bool state) {
107 PORTD |= (1<<7); 107 PORTD |= (1<<7);
108 break; 108 break;
109 case 2: 109 case 2:
110 PORTC |= (1<<6); 110 if((PINB & (1 << 7)) != 0) {
111 PORTC |= (1<<6);
112 } else {
113 PORTC |= (1<<7);
114 }
111 break; 115 break;
112 case 3: 116 case 3:
113 PORTD |= (1<<4); 117 PORTD |= (1<<4);
@@ -128,7 +132,11 @@ void set_switch_led(int ledId, bool state) {
128 PORTD &= ~(1<<7); 132 PORTD &= ~(1<<7);
129 break; 133 break;
130 case 2: 134 case 2:
131 PORTC &= ~(1<<6); 135 if((PINB & (1 << 7)) != 0) {
136 PORTC &= ~(1<<6);
137 } else {
138 PORTC &= ~(1<<7);
139 }
132 break; 140 break;
133 case 3: 141 case 3:
134 PORTD &= ~(1<<4); 142 PORTD &= ~(1<<4);
@@ -167,9 +175,12 @@ void set_layer_led(int layerId) {
167void matrix_init_user(void) { 175void matrix_init_user(void) {
168 led_init_ports(); 176 led_init_ports();
169 177
178 PORTB |= (1 << 7);
179 DDRB &= ~(1<<7);
170 180
171 PORTD |= (1<<7); 181 PORTD |= (1<<7);
172 PORTC |= (1<<6); 182 PORTC |= (1<<6);
183 PORTC |= (1<<7);
173 PORTD |= (1<<4); 184 PORTD |= (1<<4);
174 PORTE |= (1<<6); 185 PORTE |= (1<<6);
175 PORTB |= (1<<4); 186 PORTB |= (1<<4);
@@ -188,7 +199,9 @@ void led_init_ports() {
188 199
189 // led voor switch #2 200 // led voor switch #2
190 DDRC |= (1<<6); 201 DDRC |= (1<<6);
202 DDRC |= (1<<7);
191 PORTC &= ~(1<<6); 203 PORTC &= ~(1<<6);
204 PORTC &= ~(1<<7);
192 205
193 // led voor switch #3 206 // led voor switch #3
194 DDRD |= (1<<4); 207 DDRD |= (1<<4);
diff --git a/keyboards/knops/mini/keymaps/knops/keymap.c b/keyboards/knops/mini/keymaps/knops/keymap.c
index 4e50c29f5..34e560600 100644
--- a/keyboards/knops/mini/keymaps/knops/keymap.c
+++ b/keyboards/knops/mini/keymaps/knops/keymap.c
@@ -16,7 +16,11 @@ void set_led_state(int ledId, bool state) {
16 PORTD |= (1<<7); 16 PORTD |= (1<<7);
17 break; 17 break;
18 case 1: 18 case 1:
19 PORTC |= (1<<6); 19 if((PINB & (1 << 7)) != 0) {
20 PORTC |= (1<<6);
21 } else {
22 PORTC |= (1<<7);
23 }
20 break; 24 break;
21 case 2: 25 case 2:
22 PORTD |= (1<<4); 26 PORTD |= (1<<4);
@@ -47,7 +51,11 @@ void set_led_state(int ledId, bool state) {
47 PORTD &= ~(1<<7); 51 PORTD &= ~(1<<7);
48 break; 52 break;
49 case 1: 53 case 1:
50 PORTC &= ~(1<<6); 54 if((PINB & (1 << 7)) != 0) {
55 PORTC &= ~(1<<6);
56 } else {
57 PORTC &= ~(1<<7);
58 }
51 break; 59 break;
52 case 2: 60 case 2:
53 PORTD &= ~(1<<4); 61 PORTD &= ~(1<<4);
@@ -75,8 +83,12 @@ void set_led_state(int ledId, bool state) {
75} 83}
76 84
77void led_init_ports() { 85void led_init_ports() {
86 PORTB |= (1 << 7);
87 DDRB &= ~(1<<7);
88
78 DDRD |= (1<<7); 89 DDRD |= (1<<7);
79 DDRC |= (1<<6); 90 DDRC |= (1<<6);
91 DDRC |= (1<<7);
80 DDRD |= (1<<4); 92 DDRD |= (1<<4);
81 DDRE |= (1<<6); 93 DDRE |= (1<<6);
82 DDRB |= (1<<4); 94 DDRB |= (1<<4);
@@ -87,10 +99,16 @@ void led_init_ports() {
87 DDRB |= (1<<0); 99 DDRB |= (1<<0);
88} 100}
89 101
102void led_set_layer(int layer) {
103
104 /*KNOPS_SIMPLELED_STATES*/
105
106}
107
90void matrix_init_user(void) { 108void matrix_init_user(void) {
91 led_init_ports(); 109 led_init_ports();
92 110
93 led_set_layer(0); 111 led_set_layer(1);
94 112
95 /*KNOPS_INIT*/ 113 /*KNOPS_INIT*/
96} 114}
@@ -112,12 +130,6 @@ void led_set_user(uint8_t usb_led) {
112 130
113} 131}
114 132
115void led_set_layer(int layer) {
116
117 /*KNOPS_SIMPLELED_STATES*/
118
119}
120
121bool process_record_user (uint16_t keycode, keyrecord_t *record) { 133bool process_record_user (uint16_t keycode, keyrecord_t *record) {
122 134
123 /*KNOPS_PROCESS_STATE*/ 135 /*KNOPS_PROCESS_STATE*/