diff options
| author | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2018-07-14 13:26:10 -0700 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2018-07-14 13:26:10 -0700 |
| commit | 4de809535a768a5f7ccecba58d941d38b4364482 (patch) | |
| tree | 4b377a433ed6837a0c4949f8cbde494a91227b86 | |
| parent | e954dfcf8c5deef29e46393816740f1ccf6e480b (diff) | |
| download | qmk_firmware-4de809535a768a5f7ccecba58d941d38b4364482.tar.gz qmk_firmware-4de809535a768a5f7ccecba58d941d38b4364482.zip | |
Configurator does not work with melody96 leds (#3396)
* move out led code from keymap.c to melody96.c
* remove the other led_set_user
| -rw-r--r-- | keyboards/melody96/keymaps/crilith/keymap.c | 34 | ||||
| -rw-r--r-- | keyboards/melody96/keymaps/default/keymap.c | 36 | ||||
| -rw-r--r-- | keyboards/melody96/melody96.c | 21 |
3 files changed, 21 insertions, 70 deletions
diff --git a/keyboards/melody96/keymaps/crilith/keymap.c b/keyboards/melody96/keymaps/crilith/keymap.c index 3f2699280..ca65b5ad1 100644 --- a/keyboards/melody96/keymaps/crilith/keymap.c +++ b/keyboards/melody96/keymaps/crilith/keymap.c | |||
| @@ -47,37 +47,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 47 | } | 47 | } |
| 48 | return true; | 48 | return true; |
| 49 | } | 49 | } |
| 50 | |||
| 51 | void led_set_user(uint8_t usb_led) { | ||
| 52 | |||
| 53 | if (usb_led & (1 << USB_LED_NUM_LOCK)) { | ||
| 54 | DDRC |= (1 << 6); PORTC &= ~(1 << 6); | ||
| 55 | } else { | ||
| 56 | DDRC &= ~(1 << 6); PORTC &= ~(1 << 6); | ||
| 57 | } | ||
| 58 | |||
| 59 | if (usb_led & (1 << USB_LED_CAPS_LOCK)) { | ||
| 60 | DDRC |= (1 << 7); PORTC &= ~(1 << 7); | ||
| 61 | } else { | ||
| 62 | DDRC &= ~(1 << 7); PORTC &= ~(1 << 7); | ||
| 63 | } | ||
| 64 | |||
| 65 | if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { | ||
| 66 | DDRB |= (1 << 5); PORTB &= ~(1 << 5); | ||
| 67 | } else { | ||
| 68 | DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); | ||
| 69 | } | ||
| 70 | |||
| 71 | if (usb_led & (1 << USB_LED_COMPOSE)) { | ||
| 72 | |||
| 73 | } else { | ||
| 74 | |||
| 75 | } | ||
| 76 | |||
| 77 | if (usb_led & (1 << USB_LED_KANA)) { | ||
| 78 | |||
| 79 | } else { | ||
| 80 | |||
| 81 | } | ||
| 82 | |||
| 83 | } | ||
diff --git a/keyboards/melody96/keymaps/default/keymap.c b/keyboards/melody96/keymaps/default/keymap.c index 21bee33d0..9142a0470 100644 --- a/keyboards/melody96/keymaps/default/keymap.c +++ b/keyboards/melody96/keymaps/default/keymap.c | |||
| @@ -1,7 +1,5 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | 2 | ||
| 3 | #define _______ KC_TRNS | ||
| 4 | |||
| 5 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 3 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 6 | 4 | ||
| 7 | /* Layer 0, default layer | 5 | /* Layer 0, default layer |
| @@ -84,37 +82,3 @@ void matrix_scan_user(void) { | |||
| 84 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 82 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| 85 | return true; | 83 | return true; |
| 86 | } | 84 | } |
| 87 | |||
| 88 | void led_set_user(uint8_t usb_led) { | ||
| 89 | |||
| 90 | if (usb_led & (1 << USB_LED_NUM_LOCK)) { | ||
| 91 | DDRC |= (1 << 6); PORTC &= ~(1 << 6); | ||
| 92 | } else { | ||
| 93 | DDRC &= ~(1 << 6); PORTC &= ~(1 << 6); | ||
| 94 | } | ||
| 95 | |||
| 96 | if (usb_led & (1 << USB_LED_CAPS_LOCK)) { | ||
| 97 | DDRC |= (1 << 7); PORTC &= ~(1 << 7); | ||
| 98 | } else { | ||
| 99 | DDRC &= ~(1 << 7); PORTC &= ~(1 << 7); | ||
| 100 | } | ||
| 101 | |||
| 102 | if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { | ||
| 103 | DDRB |= (1 << 5); PORTB &= ~(1 << 5); | ||
| 104 | } else { | ||
| 105 | DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); | ||
| 106 | } | ||
| 107 | |||
| 108 | if (usb_led & (1 << USB_LED_COMPOSE)) { | ||
| 109 | |||
| 110 | } else { | ||
| 111 | |||
| 112 | } | ||
| 113 | |||
| 114 | if (usb_led & (1 << USB_LED_KANA)) { | ||
| 115 | |||
| 116 | } else { | ||
| 117 | |||
| 118 | } | ||
| 119 | |||
| 120 | } | ||
diff --git a/keyboards/melody96/melody96.c b/keyboards/melody96/melody96.c index 44e813586..2d313bc1e 100644 --- a/keyboards/melody96/melody96.c +++ b/keyboards/melody96/melody96.c | |||
| @@ -1 +1,22 @@ | |||
| 1 | #include "melody96.h" | 1 | #include "melody96.h" |
| 2 | |||
| 3 | void led_set_user(uint8_t usb_led) { | ||
| 4 | |||
| 5 | if (usb_led & (1 << USB_LED_NUM_LOCK)) { | ||
| 6 | DDRC |= (1 << 6); PORTC &= ~(1 << 6); | ||
| 7 | } else { | ||
| 8 | DDRC &= ~(1 << 6); PORTC &= ~(1 << 6); | ||
| 9 | } | ||
| 10 | |||
| 11 | if (usb_led & (1 << USB_LED_CAPS_LOCK)) { | ||
| 12 | DDRC |= (1 << 7); PORTC &= ~(1 << 7); | ||
| 13 | } else { | ||
| 14 | DDRC &= ~(1 << 7); PORTC &= ~(1 << 7); | ||
| 15 | } | ||
| 16 | |||
| 17 | if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { | ||
| 18 | DDRB |= (1 << 5); PORTB &= ~(1 << 5); | ||
| 19 | } else { | ||
| 20 | DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); | ||
| 21 | } | ||
| 22 | } \ No newline at end of file | ||
