diff options
| author | Xyverz <xyverz@gmail.com> | 2018-08-04 09:01:26 -0700 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2018-08-04 09:01:26 -0700 |
| commit | 3e8f2728732b20b5b6af63db73ad8b6f2be18823 (patch) | |
| tree | d2440b5f7aaed4522ad2dd91c2dbd647bf151963 | |
| parent | f8a915a2dbed01df73f14fc9baef60f4265d42e9 (diff) | |
| download | qmk_firmware-3e8f2728732b20b5b6af63db73ad8b6f2be18823.tar.gz qmk_firmware-3e8f2728732b20b5b6af63db73ad8b6f2be18823.zip | |
Keyboard: LED fixes for Kinesis Stapelberg controller, and keymap changes (#3564)
* Rules for vitamins_included
Added a section to disable RGB underglow for the Let's Split
Vitamins Included board.
* fixing ortho_4x12 configs
* Using upstream/master version instead
* Additions and Corrections
Corrected the Kinesis/Stapelberg's .c file to allow LEDs to work
Removed excess cruft from my Kinesis keymap to reflect this change
Other minor tweaks and adjustments to my ortho_4x12 and 5x12 layouts
* Updated readme
| -rw-r--r-- | keyboards/kinesis/keymaps/xyverz/keymap.c | 52 | ||||
| -rw-r--r-- | keyboards/kinesis/keymaps/xyverz/readme.md | 4 | ||||
| -rw-r--r-- | keyboards/kinesis/stapelberg/stapelberg.c | 86 | ||||
| -rw-r--r-- | layouts/community/ortho_4x12/xyverz/config.h | 5 | ||||
| -rw-r--r-- | layouts/community/ortho_5x12/xyverz/keymap.c | 10 | ||||
| -rw-r--r-- | layouts/community/ortho_5x12/xyverz/rules.mk | 12 |
6 files changed, 52 insertions, 117 deletions
diff --git a/keyboards/kinesis/keymaps/xyverz/keymap.c b/keyboards/kinesis/keymaps/xyverz/keymap.c index 533047b15..1025df076 100644 --- a/keyboards/kinesis/keymaps/xyverz/keymap.c +++ b/keyboards/kinesis/keymaps/xyverz/keymap.c | |||
| @@ -299,58 +299,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 299 | return true; | 299 | return true; |
| 300 | }; | 300 | }; |
| 301 | 301 | ||
| 302 | // getting the LEDs working... | ||
| 303 | void led_set_user(uint8_t usb_led) { | ||
| 304 | |||
| 305 | DDRF |= (1<<0); // Keypad LED | ||
| 306 | if (usb_led & (1<<USB_LED_COMPOSE)) { | ||
| 307 | PORTF |= (1<<0); | ||
| 308 | } else { | ||
| 309 | PORTF &= ~(1<<0); | ||
| 310 | } | ||
| 311 | |||
| 312 | DDRF |= (1<<1); // ScrLock LED | ||
| 313 | if (usb_led & (1<<USB_LED_SCROLL_LOCK)) { | ||
| 314 | PORTF |= (1<<1); | ||
| 315 | } else { | ||
| 316 | PORTF &= ~(1<<1); | ||
| 317 | } | ||
| 318 | |||
| 319 | DDRF |= (1<<2); // NumLock LED | ||
| 320 | if (usb_led & (1<<USB_LED_NUM_LOCK)) { | ||
| 321 | PORTF |= (1<<2); | ||
| 322 | } else { | ||
| 323 | PORTF &= ~(1<<2); | ||
| 324 | } | ||
| 325 | |||
| 326 | DDRF |= (1<<3); // CapsLock LED | ||
| 327 | if (usb_led & (1<<USB_LED_CAPS_LOCK)) { | ||
| 328 | PORTF |= (1<<3); | ||
| 329 | } else { | ||
| 330 | PORTF &= ~(1<<3); | ||
| 331 | } | ||
| 332 | |||
| 333 | } | ||
| 334 | |||
| 335 | // Runs just one time when the keyboard initializes. | 302 | // Runs just one time when the keyboard initializes. |
| 336 | void matrix_init_user(void) { | 303 | void matrix_init_user(void) { |
| 337 | |||
| 338 | }; | 304 | }; |
| 339 | |||
| 340 | void led_set_user(uint8_t usb_led) { | ||
| 341 | if (usb_led & (1<<USB_LED_NUM_LOCK)) { | ||
| 342 | PORTF |= (1<<2); | ||
| 343 | } else { | ||
| 344 | PORTF &= ~(1<<2); | ||
| 345 | } | ||
| 346 | if (usb_led & (1<<USB_LED_CAPS_LOCK)) { | ||
| 347 | PORTF |= (1<<3); | ||
| 348 | } else { | ||
| 349 | PORTF &= ~(1<<3); | ||
| 350 | } | ||
| 351 | if (usb_led & (1<<USB_LED_SCROLL_LOCK)) { | ||
| 352 | PORTF |= (1<<1); | ||
| 353 | } else { | ||
| 354 | PORTF &= ~(1<<1); | ||
| 355 | } | ||
| 356 | } | ||
diff --git a/keyboards/kinesis/keymaps/xyverz/readme.md b/keyboards/kinesis/keymaps/xyverz/readme.md index 12320996e..4f270445d 100644 --- a/keyboards/kinesis/keymaps/xyverz/readme.md +++ b/keyboards/kinesis/keymaps/xyverz/readme.md | |||
| @@ -10,9 +10,11 @@ The QWERTY layout shown here is based entirely on the Kinesis Advantage layout. | |||
| 10 | 10 | ||
| 11 | I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck layouts. | 11 | I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck layouts. |
| 12 | 12 | ||
| 13 | As of August 4 2018, I've got the LEDs working ... mostly. Caps Lock and Num Lock LEDs work for me. The Scroll Lock LED does work on my keyboard, but I can't get it to work when I use the Scroll Lock key on my keyboard. I also have no idea how to get the Num Pad LED working when I switch to the Numpad layer. | ||
| 14 | |||
| 13 | ## Still to do: | 15 | ## Still to do: |
| 14 | 16 | ||
| 15 | * Implement the CapsLock, NumLock, and ScrLck LEDs on the off-chance that I decide to actually solder some to the keyboard. | 17 | * Figure out how to make the Numpad and ScrLck LEDs work properly. |
| 16 | 18 | ||
| 17 | ### Function Keys on All Layers (keypad toggles): | 19 | ### Function Keys on All Layers (keypad toggles): |
| 18 | ,-----------------------------------------------------------------. | 20 | ,-----------------------------------------------------------------. |
diff --git a/keyboards/kinesis/stapelberg/stapelberg.c b/keyboards/kinesis/stapelberg/stapelberg.c index 94d15316d..af407ac4f 100644 --- a/keyboards/kinesis/stapelberg/stapelberg.c +++ b/keyboards/kinesis/stapelberg/stapelberg.c | |||
| @@ -27,65 +27,35 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | |||
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | void led_init_ports() { | 29 | void led_init_ports() { |
| 30 | // * Set our LED pins as output | 30 | // * Set our LED pins as output |
| 31 | DDRF |= (1<<0); // Keypad LED | 31 | DDRF |= (1<<0); // Keypad LED |
| 32 | DDRF |= (1<<1); // ScrLock LED | 32 | DDRF |= (1<<1); // ScrLock LED |
| 33 | DDRF |= (1<<2); // NumLock LED | 33 | DDRF |= (1<<2); // NumLock LED |
| 34 | DDRF |= (1<<3); // CapsLock LED | 34 | DDRF |= (1<<3); // CapsLock LED |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | void led_set_kb(uint8_t usb_led) { | 37 | void led_set_kb(uint8_t usb_led) { |
| 38 | DDRF |= (1<<0); // Keypad LED | 38 | if (usb_led & (1<<USB_LED_COMPOSE)) { |
| 39 | if (usb_led & (1<<USB_LED_COMPOSE)) { | 39 | PORTF &= ~(1<<0); |
| 40 | PORTF |= (1<<0); | 40 | } else { |
| 41 | } else { | 41 | PORTF |= (1<<0); |
| 42 | PORTF &= ~(1<<0); | 42 | } |
| 43 | } | 43 | |
| 44 | 44 | if (usb_led & (1<<USB_LED_SCROLL_LOCK)) { | |
| 45 | DDRF |= (1<<1); // ScrLock LED | 45 | PORTF &= ~(1<<1); |
| 46 | if (usb_led & (1<<USB_LED_SCROLL_LOCK)) { | 46 | } else { |
| 47 | PORTF |= (1<<1); | 47 | PORTF |= (1<<1); |
| 48 | } else { | 48 | } |
| 49 | PORTF &= ~(1<<1); | 49 | |
| 50 | } | 50 | if (usb_led & (1<<USB_LED_NUM_LOCK)) { |
| 51 | 51 | PORTF &= ~(1<<2); | |
| 52 | DDRF |= (1<<2); // NumLock LED | 52 | } else { |
| 53 | if (usb_led & (1<<USB_LED_NUM_LOCK)) { | 53 | PORTF |= (1<<2); |
| 54 | PORTF |= (1<<2); | 54 | } |
| 55 | } else { | 55 | |
| 56 | PORTF &= ~(1<<2); | 56 | if (usb_led & (1<<USB_LED_CAPS_LOCK)) { |
| 57 | } | 57 | PORTF &= ~(1<<3); |
| 58 | 58 | } else { | |
| 59 | DDRF |= (1<<3); // CapsLock LED | 59 | PORTF |= (1<<3); |
| 60 | if (usb_led & (1<<USB_LED_CAPS_LOCK)) { | 60 | } |
| 61 | PORTF |= (1<<3); | ||
| 62 | } else { | ||
| 63 | PORTF &= ~(1<<3); | ||
| 64 | } | ||
| 65 | |||
| 66 | led_set_user(usb_led); | ||
| 67 | |||
| 68 | inline void kinesis_keypad_led_on(void) { DDRF |= (1<<0); PORTF |= (1<<0); } | ||
| 69 | inline void kinesis_scroll_led_on(void) { DDRF |= (1<<1); PORTF |= (1<<1); } | ||
| 70 | inline void kinesis_num_led_on(void) { DDRF |= (1<<2); PORTF |= (1<<2); } | ||
| 71 | inline void kinesis_caps_led_on(void) { DDRF |= (1<<3); PORTF |= (1<<3); } | ||
| 72 | |||
| 73 | inline void kinesis_keypad_led_off(void) { DDRF &= ~(1<<0); PORTF &= ~(1<<0); } | ||
| 74 | inline void kinesis_scroll_led_off(void) { DDRF &= ~(1<<1); PORTF &= ~(1<<1); } | ||
| 75 | inline void kinesis_num_led_off(void) { DDRF &= ~(1<<2); PORTF &= ~(1<<2); } | ||
| 76 | inline void kinesis_caps_led_off(void) { DDRF &= ~(1<<3); PORTF &= ~(1<<3); } | ||
| 77 | |||
| 78 | |||
| 79 | } | 61 | } |
| 80 | |||
| 81 | /* This is the old code that has the port information in it. | ||
| 82 | inline void kinesis_keypad_led_on(void) { DDRF |= (1<<0); PORTF |= (1<<0); } | ||
| 83 | inline void kinesis_scroll_led_on(void) { DDRF |= (1<<1); PORTF |= (1<<1); } | ||
| 84 | inline void kinesis_num_led_on(void) { DDRF |= (1<<2); PORTF |= (1<<2); } | ||
| 85 | inline void kinesis_caps_led_on(void) { DDRF |= (1<<3); PORTF |= (1<<3); } | ||
| 86 | |||
| 87 | inline void kinesis_keypad_led_off(void) { DDRF &= ~(1<<0); PORTF &= ~(1<<0); } | ||
| 88 | inline void kinesis_scroll_led_off(void) { DDRF &= ~(1<<1); PORTF &= ~(1<<1); } | ||
| 89 | inline void kinesis_num_led_off(void) { DDRF &= ~(1<<2); PORTF &= ~(1<<2); } | ||
| 90 | inline void kinesis_caps_led_off(void) { DDRF &= ~(1<<3); PORTF &= ~(1<<3); } | ||
| 91 | */ | ||
diff --git a/layouts/community/ortho_4x12/xyverz/config.h b/layouts/community/ortho_4x12/xyverz/config.h index d2c329767..0fa89d6c7 100644 --- a/layouts/community/ortho_4x12/xyverz/config.h +++ b/layouts/community/ortho_4x12/xyverz/config.h | |||
| @@ -15,12 +15,11 @@ | |||
| 15 | #define RGBLED_NUM 12 | 15 | #define RGBLED_NUM 12 |
| 16 | #elif defined(KEYBOARD_lets_split_rev2) | 16 | #elif defined(KEYBOARD_lets_split_rev2) |
| 17 | #define RGBLED_NUM 8 | 17 | #define RGBLED_NUM 8 |
| 18 | #elif defined(KEYBOARD_jj40) | ||
| 19 | #define RGBLED_NUM 5 | ||
| 18 | #else | 20 | #else |
| 19 | #define RGBLED_NUM 1 | 21 | #define RGBLED_NUM 1 |
| 20 | #endif | 22 | #endif |
| 21 | #ifdef KEYBOARD_jj40 | ||
| 22 | #define RGBLED_NUM 5 | ||
| 23 | #endif | ||
| 24 | 23 | ||
| 25 | #define RGBLIGHT_ANIMATIONS | 24 | #define RGBLIGHT_ANIMATIONS |
| 26 | #define RGBLIGHT_HUE_STEP 8 | 25 | #define RGBLIGHT_HUE_STEP 8 |
diff --git a/layouts/community/ortho_5x12/xyverz/keymap.c b/layouts/community/ortho_5x12/xyverz/keymap.c index a0f1274d0..23a456e6d 100644 --- a/layouts/community/ortho_5x12/xyverz/keymap.c +++ b/layouts/community/ortho_5x12/xyverz/keymap.c | |||
| @@ -175,6 +175,16 @@ void persistent_default_layer_set(uint16_t default_layer) { | |||
| 175 | default_layer_set(default_layer); | 175 | default_layer_set(default_layer); |
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | void matrix_init_user(void) { | ||
| 179 | #ifdef BOOTLOADER_CATERINA | ||
| 180 | // This will disable the red LEDs on the ProMicros | ||
| 181 | DDRD &= ~(1<<5); | ||
| 182 | PORTD &= ~(1<<5); | ||
| 183 | DDRB &= ~(1<<0); | ||
| 184 | PORTB &= ~(1<<0); | ||
| 185 | #endif | ||
| 186 | }; | ||
| 187 | |||
| 178 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 188 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| 179 | switch (keycode) { | 189 | switch (keycode) { |
| 180 | case QWERTY: | 190 | case QWERTY: |
diff --git a/layouts/community/ortho_5x12/xyverz/rules.mk b/layouts/community/ortho_5x12/xyverz/rules.mk index 44bbc61e5..63c544ad5 100644 --- a/layouts/community/ortho_5x12/xyverz/rules.mk +++ b/layouts/community/ortho_5x12/xyverz/rules.mk | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | # Build Options | 1 | # Build Options |
| 2 | # change to "no" to disable the options, or define them in the Makefile in | 2 | # change to "no" to disable the options, or define them in the Makefile in |
| 3 | # the appropriate keymap folder that will get included automatically | 3 | # the appropriate keymap folder that will get included automatically |
| 4 | # | 4 | # |
| 5 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | 5 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) |
| @@ -7,12 +7,18 @@ MOUSEKEY_ENABLE = no # Mouse keys(+4700) | |||
| 7 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | 7 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) |
| 8 | CONSOLE_ENABLE = no # Console for debug(+400) | 8 | CONSOLE_ENABLE = no # Console for debug(+400) |
| 9 | COMMAND_ENABLE = no # Commands for debug and configuration | 9 | COMMAND_ENABLE = no # Commands for debug and configuration |
| 10 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | ||
| 11 | MIDI_ENABLE = no # MIDI controls | 10 | MIDI_ENABLE = no # MIDI controls |
| 12 | AUDIO_ENABLE = no # Audio output on port C6 | 11 | AUDIO_ENABLE = no # Audio output on port C6 |
| 13 | UNICODE_ENABLE = no # Unicode | 12 | UNICODE_ENABLE = no # Unicode |
| 14 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | 13 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID |
| 15 | RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. | 14 | |
| 15 | ifneq ("$(KEYBOARD)","nyquist") | ||
| 16 | RGBLIGHT_ENABLE = yes | ||
| 17 | BACKLIGHT_ENABLE = yes | ||
| 18 | else | ||
| 19 | RGBLIGHT_ENABLE = no | ||
| 20 | BACKLIGHT_ENABLE = no | ||
| 21 | endif | ||
| 16 | 22 | ||
| 17 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | 23 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
| 18 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 24 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
