diff options
author | Pawnerd <Pawnerd@users.noreply.github.com> | 2018-03-05 03:29:38 +0100 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2018-03-04 21:29:38 -0500 |
commit | 12c8ee956dc0230b571bc51f785ae417073d5c67 (patch) | |
tree | 8d66546d16e562979c60282582329f4c552e478b /keyboards/knops/mini/keymaps/default/keymap.c | |
parent | b36b4382d0a1da12492c14a8b7f25ca036e0af6d (diff) |
Add knops configurator support (#2474)
* Committed initial version of the knops configurator.
* Added support for the Knops v1.1
Diffstat (limited to 'keyboards/knops/mini/keymaps/default/keymap.c')
-rw-r--r-- | keyboards/knops/mini/keymaps/default/keymap.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/keyboards/knops/mini/keymaps/default/keymap.c b/keyboards/knops/mini/keymaps/default/keymap.c index e7773c0c0d..40714c8a51 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) { PORTD |= (1<<7); break; case 2: - PORTC |= (1<<6); + if((PINB & (1 << 7)) != 0) { + PORTC |= (1<<6); + } else { + PORTC |= (1<<7); + } break; case 3: PORTD |= (1<<4); @@ -128,7 +132,11 @@ void set_switch_led(int ledId, bool state) { PORTD &= ~(1<<7); break; case 2: - PORTC &= ~(1<<6); + if((PINB & (1 << 7)) != 0) { + PORTC &= ~(1<<6); + } else { + PORTC &= ~(1<<7); + } break; case 3: PORTD &= ~(1<<4); @@ -167,9 +175,12 @@ void set_layer_led(int layerId) { void matrix_init_user(void) { led_init_ports(); + PORTB |= (1 << 7); + DDRB &= ~(1<<7); PORTD |= (1<<7); PORTC |= (1<<6); + PORTC |= (1<<7); PORTD |= (1<<4); PORTE |= (1<<6); PORTB |= (1<<4); @@ -188,7 +199,9 @@ void led_init_ports() { // led voor switch #2 DDRC |= (1<<6); + DDRC |= (1<<7); PORTC &= ~(1<<6); + PORTC &= ~(1<<7); // led voor switch #3 DDRD |= (1<<4); |