diff options
| author | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2020-02-24 12:04:40 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-24 12:04:40 -0800 |
| commit | ef8878fba5d3786e3f9c66436da63a560cd36ac9 (patch) | |
| tree | 43a601cc661445a7389bd0f6125afe93c6f1c6dc /keyboards/hineybush | |
| parent | f673c965ba79f5354c1634466ef2167304ce9f35 (diff) | |
| download | qmk_firmware-ef8878fba5d3786e3f9c66436da63a560cd36ac9.tar.gz qmk_firmware-ef8878fba5d3786e3f9c66436da63a560cd36ac9.zip | |
Hineybush h87a lock indicators (#8237)
* move lighting code from VIA into the keyboard's .c file so that every keymap can access it
* after some serious conversations with default and wkl, they agreed to let me modify their keymaps. They weren't too happy
Diffstat (limited to 'keyboards/hineybush')
| -rw-r--r-- | keyboards/hineybush/h87a/h87a.c | 11 | ||||
| -rw-r--r-- | keyboards/hineybush/h87a/keymaps/default/keymap.c | 21 | ||||
| -rw-r--r-- | keyboards/hineybush/h87a/keymaps/via/keymap.c | 11 | ||||
| -rw-r--r-- | keyboards/hineybush/h87a/keymaps/wkl/keymap.c | 23 |
4 files changed, 10 insertions, 56 deletions
diff --git a/keyboards/hineybush/h87a/h87a.c b/keyboards/hineybush/h87a/h87a.c index c3bb89080..a3f511ffc 100644 --- a/keyboards/hineybush/h87a/h87a.c +++ b/keyboards/hineybush/h87a/h87a.c | |||
| @@ -18,7 +18,8 @@ | |||
| 18 | void matrix_init_kb(void) { | 18 | void matrix_init_kb(void) { |
| 19 | // put your keyboard start-up code here | 19 | // put your keyboard start-up code here |
| 20 | // runs once when the firmware starts up | 20 | // runs once when the firmware starts up |
| 21 | 21 | setPinOutput(D5); | |
| 22 | setPinOutput(E6); | ||
| 22 | matrix_init_user(); | 23 | matrix_init_user(); |
| 23 | } | 24 | } |
| 24 | 25 | ||
| @@ -42,6 +43,14 @@ void led_set_kb(uint8_t usb_led) { | |||
| 42 | led_set_user(usb_led); | 43 | led_set_user(usb_led); |
| 43 | } | 44 | } |
| 44 | 45 | ||
| 46 | bool led_update_kb(led_t led_state) { | ||
| 47 | if(led_update_user(led_state)) { | ||
| 48 | writePin(D5, !led_state.caps_lock); | ||
| 49 | writePin(E6, !led_state.scroll_lock); | ||
| 50 | } | ||
| 51 | return true; | ||
| 52 | } | ||
| 53 | |||
| 45 | void eeconfig_init_kb(void) { // EEPROM is getting reset! | 54 | void eeconfig_init_kb(void) { // EEPROM is getting reset! |
| 46 | rgblight_enable(); // Enable RGB by default | 55 | rgblight_enable(); // Enable RGB by default |
| 47 | rgblight_sethsv(0, 255, 128); // Set default HSV - red hue, full saturation, medium brightness | 56 | rgblight_sethsv(0, 255, 128); // Set default HSV - red hue, full saturation, medium brightness |
diff --git a/keyboards/hineybush/h87a/keymaps/default/keymap.c b/keyboards/hineybush/h87a/keymaps/default/keymap.c index 8aa116c93..abca0b199 100644 --- a/keyboards/hineybush/h87a/keymaps/default/keymap.c +++ b/keyboards/hineybush/h87a/keymaps/default/keymap.c | |||
| @@ -46,24 +46,3 @@ void matrix_scan_user(void) { | |||
| 46 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 46 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| 47 | return true; | 47 | return true; |
| 48 | } | 48 | } |
| 49 | |||
| 50 | void led_init_ports(void) { | ||
| 51 | DDRD |= (1<<5); // OUT | ||
| 52 | DDRE |= (1<<6); // OUT | ||
| 53 | } | ||
| 54 | |||
| 55 | void led_set_user(uint8_t usb_led) { | ||
| 56 | |||
| 57 | if (usb_led & (1 << USB_LED_CAPS_LOCK)) { | ||
| 58 | DDRD |= (1 << 5); PORTD &= ~(1 << 5); | ||
| 59 | } else { | ||
| 60 | DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); | ||
| 61 | } | ||
| 62 | |||
| 63 | if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { | ||
| 64 | DDRE |= (1 << 6); PORTE &= ~(1 << 6); | ||
| 65 | } else { | ||
| 66 | DDRE &= ~(1 << 6); PORTE &= ~(1 << 6); | ||
| 67 | } | ||
| 68 | |||
| 69 | } | ||
diff --git a/keyboards/hineybush/h87a/keymaps/via/keymap.c b/keyboards/hineybush/h87a/keymaps/via/keymap.c index e4be1cfc9..d248a6d4a 100644 --- a/keyboards/hineybush/h87a/keymaps/via/keymap.c +++ b/keyboards/hineybush/h87a/keymaps/via/keymap.c | |||
| @@ -50,14 +50,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 50 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | 50 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), |
| 51 | 51 | ||
| 52 | }; | 52 | }; |
| 53 | |||
| 54 | void led_init_ports(void) { | ||
| 55 | setPinOutput(D5); | ||
| 56 | setPinOutput(E6); | ||
| 57 | } | ||
| 58 | |||
| 59 | bool led_update_user(led_t led_state) { | ||
| 60 | writePin(D5, !led_state.caps_lock); | ||
| 61 | writePin(E6, !led_state.scroll_lock); | ||
| 62 | return true; | ||
| 63 | } | ||
diff --git a/keyboards/hineybush/h87a/keymaps/wkl/keymap.c b/keyboards/hineybush/h87a/keymaps/wkl/keymap.c index e3e410823..208cd3b34 100644 --- a/keyboards/hineybush/h87a/keymaps/wkl/keymap.c +++ b/keyboards/hineybush/h87a/keymaps/wkl/keymap.c | |||
| @@ -46,26 +46,3 @@ void matrix_scan_user(void) { | |||
| 46 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 46 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| 47 | return true; | 47 | return true; |
| 48 | } | 48 | } |
| 49 | |||
| 50 | void led_init_ports(void) { | ||
| 51 | setPinOutput(D5); | ||
| 52 | setPinOutput(E6); | ||
| 53 | } | ||
| 54 | |||
| 55 | void led_set_user(uint8_t usb_led) { | ||
| 56 | |||
| 57 | if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { | ||
| 58 | setPinOutput(D5); | ||
| 59 | writePinLow(D5); | ||
| 60 | } else { | ||
| 61 | setPinInput(D5); | ||
| 62 | } | ||
| 63 | |||
| 64 | if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { | ||
| 65 | setPinOutput(E6); | ||
| 66 | writePinLow(E6); | ||
| 67 | } else { | ||
| 68 | setPinInput(E6); | ||
| 69 | } | ||
| 70 | |||
| 71 | } | ||
