Add knops configurator support (#2474)

* Committed initial version of the knops configurator.

* Added support for the Knops v1.1
planck_rev6
Pawnerd 7 years ago committed by Jack Humbert
parent b36b4382d0
commit 12c8ee956d

@ -107,7 +107,11 @@ void set_switch_led(int ledId, bool state) {
PORTD |= (1<<7); PORTD |= (1<<7);
break; break;
case 2: case 2:
if((PINB & (1 << 7)) != 0) {
PORTC |= (1<<6); PORTC |= (1<<6);
} else {
PORTC |= (1<<7);
}
break; break;
case 3: case 3:
PORTD |= (1<<4); PORTD |= (1<<4);
@ -128,7 +132,11 @@ void set_switch_led(int ledId, bool state) {
PORTD &= ~(1<<7); PORTD &= ~(1<<7);
break; break;
case 2: case 2:
if((PINB & (1 << 7)) != 0) {
PORTC &= ~(1<<6); PORTC &= ~(1<<6);
} else {
PORTC &= ~(1<<7);
}
break; break;
case 3: case 3:
PORTD &= ~(1<<4); PORTD &= ~(1<<4);
@ -167,9 +175,12 @@ void set_layer_led(int layerId) {
void matrix_init_user(void) { void matrix_init_user(void) {
led_init_ports(); led_init_ports();
PORTB |= (1 << 7);
DDRB &= ~(1<<7);
PORTD |= (1<<7); PORTD |= (1<<7);
PORTC |= (1<<6); PORTC |= (1<<6);
PORTC |= (1<<7);
PORTD |= (1<<4); PORTD |= (1<<4);
PORTE |= (1<<6); PORTE |= (1<<6);
PORTB |= (1<<4); PORTB |= (1<<4);
@ -188,7 +199,9 @@ void led_init_ports() {
// led voor switch #2 // led voor switch #2
DDRC |= (1<<6); DDRC |= (1<<6);
DDRC |= (1<<7);
PORTC &= ~(1<<6); PORTC &= ~(1<<6);
PORTC &= ~(1<<7);
// led voor switch #3 // led voor switch #3
DDRD |= (1<<4); DDRD |= (1<<4);

@ -16,7 +16,11 @@ void set_led_state(int ledId, bool state) {
PORTD |= (1<<7); PORTD |= (1<<7);
break; break;
case 1: case 1:
if((PINB & (1 << 7)) != 0) {
PORTC |= (1<<6); PORTC |= (1<<6);
} else {
PORTC |= (1<<7);
}
break; break;
case 2: case 2:
PORTD |= (1<<4); PORTD |= (1<<4);
@ -47,7 +51,11 @@ void set_led_state(int ledId, bool state) {
PORTD &= ~(1<<7); PORTD &= ~(1<<7);
break; break;
case 1: case 1:
if((PINB & (1 << 7)) != 0) {
PORTC &= ~(1<<6); PORTC &= ~(1<<6);
} else {
PORTC &= ~(1<<7);
}
break; break;
case 2: case 2:
PORTD &= ~(1<<4); PORTD &= ~(1<<4);
@ -75,8 +83,12 @@ void set_led_state(int ledId, bool state) {
} }
void led_init_ports() { void led_init_ports() {
PORTB |= (1 << 7);
DDRB &= ~(1<<7);
DDRD |= (1<<7); DDRD |= (1<<7);
DDRC |= (1<<6); DDRC |= (1<<6);
DDRC |= (1<<7);
DDRD |= (1<<4); DDRD |= (1<<4);
DDRE |= (1<<6); DDRE |= (1<<6);
DDRB |= (1<<4); DDRB |= (1<<4);
@ -87,10 +99,16 @@ void led_init_ports() {
DDRB |= (1<<0); DDRB |= (1<<0);
} }
void led_set_layer(int layer) {
/*KNOPS_SIMPLELED_STATES*/
}
void matrix_init_user(void) { void matrix_init_user(void) {
led_init_ports(); led_init_ports();
led_set_layer(0); led_set_layer(1);
/*KNOPS_INIT*/ /*KNOPS_INIT*/
} }
@ -112,12 +130,6 @@ void led_set_user(uint8_t usb_led) {
} }
void led_set_layer(int layer) {
/*KNOPS_SIMPLELED_STATES*/
}
bool process_record_user (uint16_t keycode, keyrecord_t *record) { bool process_record_user (uint16_t keycode, keyrecord_t *record) {
/*KNOPS_PROCESS_STATE*/ /*KNOPS_PROCESS_STATE*/

Loading…
Cancel
Save