diff options
Diffstat (limited to 'keyboards/knops')
-rw-r--r-- | keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c | 42 | ||||
-rw-r--r-- | keyboards/knops/mini/keymaps/default/keymap.c | 106 | ||||
-rw-r--r-- | keyboards/knops/mini/keymaps/knops/keymap.c | 14 | ||||
-rw-r--r-- | keyboards/knops/mini/keymaps/mverteuil/keymap.c | 4 |
4 files changed, 83 insertions, 83 deletions
diff --git a/keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c b/keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c index 68c96fc192..3851719f19 100644 --- a/keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c +++ b/keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c @@ -203,27 +203,7 @@ 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); - PORTD |= (1<<6); - - set_layer_led(0); -} - -void matrix_scan_user(void) { -} - -void led_init_ports() { +void led_init_ports_user(void) { // led voor switch #1 DDRD |= (1<<7); PORTD &= ~(1<<7); @@ -276,6 +256,26 @@ void led_init_ports() { //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)) { diff --git a/keyboards/knops/mini/keymaps/default/keymap.c b/keyboards/knops/mini/keymaps/default/keymap.c index 859f07aa07..ee6a0741ca 100644 --- a/keyboards/knops/mini/keymaps/default/keymap.c +++ b/keyboards/knops/mini/keymaps/default/keymap.c @@ -129,72 +129,52 @@ 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); - PORTD |= (1<<6); - - set_layer_led(0); -} - -void matrix_scan_user(void) { -} - -void led_init_ports() { +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); @@ -202,42 +182,62 @@ void led_init_ports() { //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 @@ -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] ); -* +* */ /* @@ -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); @@ -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); @@ -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; } } diff --git a/keyboards/knops/mini/keymaps/knops/keymap.c b/keyboards/knops/mini/keymaps/knops/keymap.c index 7bc7fbe43d..15d9e5bc11 100644 --- a/keyboards/knops/mini/keymaps/knops/keymap.c +++ b/keyboards/knops/mini/keymaps/knops/keymap.c @@ -82,10 +82,10 @@ void set_led_state(int ledId, bool state) { } } -void led_init_ports() { +void led_init_ports_user(void) { PORTB |= (1 << 7); DDRB &= ~(1<<7); - + DDRD |= (1<<7); DDRC |= (1<<6); DDRC |= (1<<7); @@ -106,10 +106,10 @@ void led_set_layer(int layer) { } void matrix_init_user(void) { - led_init_ports(); - + led_init_ports_user(); + led_set_layer(1); - + /*KNOPS_INIT*/ } @@ -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; - + } diff --git a/keyboards/knops/mini/keymaps/mverteuil/keymap.c b/keyboards/knops/mini/keymaps/mverteuil/keymap.c index 5ecba0d5a1..12afb57da2 100644 --- a/keyboards/knops/mini/keymaps/mverteuil/keymap.c +++ b/keyboards/knops/mini/keymaps/mverteuil/keymap.c @@ -270,7 +270,7 @@ void led_set_layer(int layer) { /* * Prepare all LED ports for output */ -void led_init_ports() { +void led_init_ports_user(void) { setPinOutput(D7); // Switch 1 LED setPinOutput(C6); // Switch 2 LED Pin1 setPinOutput(C7); // Switch 2 LED Pin2 @@ -291,7 +291,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { } void matrix_init_user(void) { - led_init_ports(); + led_init_ports_user(); led_init_animation(); } |