Skip to content

Commit

Permalink
[Keyboard] Fix knops keymaps (#13872)
Browse files Browse the repository at this point in the history
  • Loading branch information
daskygit authored Aug 4, 2021
1 parent 3568eaf commit 3917fd5
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 82 deletions.
42 changes: 21 additions & 21 deletions keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,27 +203,7 @@ void set_layer_led(int layerId) {
}
}

void matrix_init_user(void) {
led_init_ports_user();

PORTB |= (1 << 7);
DDRB &= ~(1<<7);

PORTD |= (1<<7);
PORTC |= (1<<6);
PORTC |= (1<<7);
PORTD |= (1<<4);
PORTE |= (1<<6);
PORTB |= (1<<4);
PORTD |= (1<<6);

set_layer_led(0);
}

void matrix_scan_user(void) {
}

void led_init_ports_user() {
void led_init_ports_user(void) {
// led voor switch #1
DDRD |= (1<<7);
PORTD &= ~(1<<7);
Expand Down Expand Up @@ -276,6 +256,26 @@ void led_init_ports_user() {
//led_set_layer(0);
}

void matrix_init_user(void) {
led_init_ports_user();

PORTB |= (1 << 7);
DDRB &= ~(1<<7);

PORTD |= (1<<7);
PORTC |= (1<<6);
PORTC |= (1<<7);
PORTD |= (1<<4);
PORTE |= (1<<6);
PORTB |= (1<<4);
PORTD |= (1<<6);

set_layer_led(0);
}

void matrix_scan_user(void) {
}

void led_set_user(uint8_t usb_led) {

if (usb_led & (1 << USB_LED_NUM_LOCK)) {
Expand Down
106 changes: 53 additions & 53 deletions keyboards/knops/mini/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,115 +129,115 @@ void set_layer_led(int layerId) {
}
}

void matrix_init_user(void) {
led_init_ports_user();

PORTB |= (1 << 7);
DDRB &= ~(1<<7);

PORTD |= (1<<7);
PORTC |= (1<<6);
PORTC |= (1<<7);
PORTD |= (1<<4);
PORTE |= (1<<6);
PORTB |= (1<<4);
PORTD |= (1<<6);

set_layer_led(0);
}

void matrix_scan_user(void) {
}

void led_init_ports_user() {
void led_init_ports_user(void) {
// led voor switch #1
DDRD |= (1<<7);
PORTD &= ~(1<<7);

// led voor switch #2
DDRC |= (1<<6);
DDRC |= (1<<7);
PORTC &= ~(1<<6);
PORTC &= ~(1<<7);

// led voor switch #3
DDRD |= (1<<4);
PORTD &= ~(1<<4);

// led voor switch #4
DDRE |= (1<<6);
PORTE &= ~(1<<6);

// led voor switch #5
DDRB |= (1<<4);
PORTB &= ~(1<<4);

// led voor switch #6
DDRD |= (1<<6);
PORTD &= ~(1<<6);

/*
DDRD |= (1<<7);
PORTD |= (1<<7);
DDRC |= (1<<6);
PORTC |= (1<<6);
DDRD |= (1<<4);
PORTD |= (1<<4);
DDRE |= (1<<6);
PORTE |= (1<<6);
DDRB |= (1<<4);
PORTB |= (1<<4);
DDRD |= (1<<6);
PORTD |= (1<<6);
// */
// */

DDRD |= (1<<5);
DDRB |= (1<<6);
DDRB |= (1<<0);
//led_set_layer(0);
}

void matrix_init_user(void) {
led_init_ports_user();

PORTB |= (1 << 7);
DDRB &= ~(1<<7);

PORTD |= (1<<7);
PORTC |= (1<<6);
PORTC |= (1<<7);
PORTD |= (1<<4);
PORTE |= (1<<6);
PORTB |= (1<<4);
PORTD |= (1<<6);

set_layer_led(0);
}

void matrix_scan_user(void) {
}

void led_set_user(uint8_t usb_led) {

if (usb_led & (1 << USB_LED_NUM_LOCK)) {

} else {

}

if (usb_led & (1 << USB_LED_CAPS_LOCK)) {

} else {

}

if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {

} else {

}

if (usb_led & (1 << USB_LED_COMPOSE)) {

} else {

}

if (usb_led & (1 << USB_LED_KANA)) {

} else {

}

}


/*
/*
* NOTE:
*
* In case you don't understand this coding stuff, please
Expand All @@ -257,11 +257,11 @@ void led_set_user(uint8_t usb_led) {
* | | | | | | | set_switch_led( [1-6], [true/false]);
* | 4 | | 5 | | 6 | <---
* |_____| |_____| |_____|
*
*
* < 0 > < 1 > < 2 > <--- These front-LEDs are called 'Layer LEDs'
* To turn one of them on, use:
* set_layer_led( [0-2] );
*
*
*/

/*
Expand All @@ -272,14 +272,14 @@ void led_set_user(uint8_t usb_led) {
*/
void led_set_layer(int layer) {
switch(layer) {

/**
* Here is an example to turn LEDs on and of. By default:
* - the LEDs are turned on in layer 0
* - the LEDs are turned off in layer 1
* - the LEDs don't change from state for layer 2
*/
*/

case 0:
set_layer_led(0); // Turn on only the first/left layer indicator
set_switch_led(1, true);
Expand All @@ -289,7 +289,7 @@ void led_set_layer(int layer) {
set_switch_led(5, true);
set_switch_led(6, true);
break;

case 1:
set_layer_led(1); // Turn on only the second/middle layer indicator
set_switch_led(1, false);
Expand All @@ -299,12 +299,12 @@ void led_set_layer(int layer) {
set_switch_led(5, false);
set_switch_led(6, false);
break;

case 2:
set_layer_led(2); // Turn on only the third/right layer indicator

// Keep leds for layer two in their current state, since we don't use set_switch_led(SWITCH_ID, TRUE_OR_FALSE)

break;
}
}
Expand Down
12 changes: 6 additions & 6 deletions keyboards/knops/mini/keymaps/knops/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ void set_led_state(int ledId, bool state) {
}
}

void led_init_ports_user() {
void led_init_ports_user(void) {
PORTB |= (1 << 7);
DDRB &= ~(1<<7);

DDRD |= (1<<7);
DDRC |= (1<<6);
DDRC |= (1<<7);
Expand All @@ -107,9 +107,9 @@ void led_set_layer(int layer) {

void matrix_init_user(void) {
led_init_ports_user();

led_set_layer(1);

/*KNOPS_INIT*/
}

Expand All @@ -132,11 +132,11 @@ void led_set_user(uint8_t usb_led) {
}

bool process_record_user (uint16_t keycode, keyrecord_t *record) {

/*KNOPS_PROCESS_STATE*/

return NULL;

}


2 changes: 1 addition & 1 deletion keyboards/knops/mini/keymaps/mverteuil/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void led_set_layer(int layer) {
/*
* Prepare all LED ports for output
*/
void led_init_ports_user() {
void led_init_ports_user(void) {
setPinOutput(D7); // Switch 1 LED
setPinOutput(C6); // Switch 2 LED Pin1
setPinOutput(C7); // Switch 2 LED Pin2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void set_led_state(int ledId, bool state)
}
}

void led_init_ports_user()
void led_init_ports_user(void)
{
// Switch #1
DDRD |= (1 << 6);
Expand Down

0 comments on commit 3917fd5

Please sign in to comment.