diff options
| author | Joel Challis <git@zvecr.com> | 2020-11-18 17:51:53 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-18 17:51:53 +0000 |
| commit | f00402a2f3d551bcb1fb87245238e2b392192eb5 (patch) | |
| tree | aad0bdc88a3fae31ac58cfdd62d99bac06dc67d0 /keyboards/hineybush | |
| parent | e1e13c53acb24c3617c3de88fa401acb3d628074 (diff) | |
| download | qmk_firmware-f00402a2f3d551bcb1fb87245238e2b392192eb5.tar.gz qmk_firmware-f00402a2f3d551bcb1fb87245238e2b392192eb5.zip | |
Refactor to use led config - Part 3 (#10966)
* Refactor to use led config
* Refactor to use led config
* Refactor to use led config
* Refactor to use led config
Diffstat (limited to 'keyboards/hineybush')
| -rw-r--r-- | keyboards/hineybush/hineyg80/config.h | 5 | ||||
| -rw-r--r-- | keyboards/hineybush/hineyg80/hineyg80.c | 47 |
2 files changed, 5 insertions, 47 deletions
diff --git a/keyboards/hineybush/hineyg80/config.h b/keyboards/hineybush/hineyg80/config.h index 4072def2f..81bf62272 100644 --- a/keyboards/hineybush/hineyg80/config.h +++ b/keyboards/hineybush/hineyg80/config.h | |||
| @@ -22,6 +22,11 @@ | |||
| 22 | /* COL2ROW or ROW2COL */ | 22 | /* COL2ROW or ROW2COL */ |
| 23 | #define DIODE_DIRECTION COL2ROW | 23 | #define DIODE_DIRECTION COL2ROW |
| 24 | 24 | ||
| 25 | |||
| 26 | #define LED_NUM_LOCK_PIN C6 | ||
| 27 | #define LED_CAPS_LOCK_PIN B6 | ||
| 28 | #define LED_SCROLL_LOCK_PIN B5 | ||
| 29 | |||
| 25 | /* number of backlight levels */ | 30 | /* number of backlight levels */ |
| 26 | 31 | ||
| 27 | #ifdef BACKLIGHT_PIN | 32 | #ifdef BACKLIGHT_PIN |
diff --git a/keyboards/hineybush/hineyg80/hineyg80.c b/keyboards/hineybush/hineyg80/hineyg80.c index 236c646be..a56e46e9d 100644 --- a/keyboards/hineybush/hineyg80/hineyg80.c +++ b/keyboards/hineybush/hineyg80/hineyg80.c | |||
| @@ -14,50 +14,3 @@ | |||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include "hineyg80.h" | 16 | #include "hineyg80.h" |
| 17 | |||
| 18 | void matrix_init_kb(void) { | ||
| 19 | // put your keyboard start-up code here | ||
| 20 | // runs once when the firmware starts up | ||
| 21 | |||
| 22 | matrix_init_user(); | ||
| 23 | } | ||
| 24 | |||
| 25 | void matrix_scan_kb(void) { | ||
| 26 | // put your looping keyboard code here | ||
| 27 | // runs every cycle (a lot) | ||
| 28 | |||
| 29 | matrix_scan_user(); | ||
| 30 | } | ||
| 31 | |||
| 32 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
| 33 | // put your per-action keyboard code here | ||
| 34 | // runs for every action, just before processing by the firmware | ||
| 35 | |||
| 36 | return process_record_user(keycode, record); | ||
| 37 | } | ||
| 38 | |||
| 39 | void led_set_kb(uint8_t usb_led) { | ||
| 40 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here | ||
| 41 | if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { | ||
| 42 | // Turn numlock on | ||
| 43 | writePinHigh(C6); | ||
| 44 | } else { | ||
| 45 | // Turn numlock off | ||
| 46 | writePinLow(C6); | ||
| 47 | } | ||
| 48 | if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { | ||
| 49 | // Turn capslock on | ||
| 50 | writePinHigh(B6); | ||
| 51 | } else { | ||
| 52 | // Turn capslock off | ||
| 53 | writePinLow(B6); | ||
| 54 | } | ||
| 55 | if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { | ||
| 56 | // Turn scrolllock on | ||
| 57 | writePinHigh(B5); | ||
| 58 | } else { | ||
| 59 | // Turn scrolllock off | ||
| 60 | writePinLow(B5); | ||
| 61 | } | ||
| 62 | led_set_user(usb_led); | ||
| 63 | } | ||
