aboutsummaryrefslogtreecommitdiff
path: root/keyboards/hineybush/hbcp
diff options
context:
space:
mode:
authorRyan <[email protected]>2023-07-03 04:24:22 +1000
committerGitHub <[email protected]>2023-07-02 19:24:22 +0100
commit7ff80a57cbe57e888646c3b90e2f4f9dea977156 (patch)
tree9917aa79a37e2c51124b63af094da8a96591313c /keyboards/hineybush/hbcp
parent9dbad1fa5c068c42f0e948242a2f1922824fbb22 (diff)
downloadqmk_firmware-7ff80a57cbe57e888646c3b90e2f4f9dea977156.tar.gz
qmk_firmware-7ff80a57cbe57e888646c3b90e2f4f9dea977156.zip
Get rid of `USB_LED_SCROLL_LOCK` (#21405)
Diffstat (limited to 'keyboards/hineybush/hbcp')
-rw-r--r--keyboards/hineybush/hbcp/hbcp.c46
-rw-r--r--keyboards/hineybush/hbcp/keymaps/hiney/keymap.c9
2 files changed, 32 insertions, 23 deletions
diff --git a/keyboards/hineybush/hbcp/hbcp.c b/keyboards/hineybush/hbcp/hbcp.c
index d4601cd2e3..7d0f5ecf73 100644
--- a/keyboards/hineybush/hbcp/hbcp.c
+++ b/keyboards/hineybush/hbcp/hbcp.c
@@ -45,32 +45,40 @@ void eeconfig_init_kb(void) { // EEPROM is getting reset!
#ifdef RGBLIGHT_ENABLE
-__attribute__ ((weak))
-void led_set_user(uint8_t usb_led) {
- if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
- sethsv_raw(HSV_CAPS, (LED_TYPE *)&led[0]);
- } else {
- sethsv(HSV_BLACK, (LED_TYPE *)&led[0]);
- }
- if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
- sethsv_raw(HSV_NLCK, (LED_TYPE *)&led[1]);
- } else {
- sethsv(HSV_BLACK, (LED_TYPE *)&led[1]);
- }
- if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) {
- sethsv_raw(HSV_SCRL, (LED_TYPE *)&led[2]);
- } else {
- sethsv(HSV_BLACK, (LED_TYPE *)&led[2]);
+bool led_update_kb(led_t led_state) {
+ bool res = led_update_user(led_state);
+ if (res) {
+ if (led_state.caps_lock) {
+ sethsv_raw(HSV_CAPS, (LED_TYPE *)&led[0]);
+ } else {
+ sethsv(HSV_BLACK, (LED_TYPE *)&led[0]);
+ }
+ if (led_state.num_lock) {
+ sethsv_raw(HSV_NLCK, (LED_TYPE *)&led[1]);
+ } else {
+ sethsv(HSV_BLACK, (LED_TYPE *)&led[1]);
+ }
+ if (led_state.scroll_lock) {
+ sethsv_raw(HSV_SCRL, (LED_TYPE *)&led[2]);
+ } else {
+ sethsv(HSV_BLACK, (LED_TYPE *)&led[2]);
+ }
+ rgblight_set();
}
- rgblight_set();
+ return false;
}
__attribute__ ((weak))
void keyboard_post_init_user(void) {
rgblight_set_effect_range(3, RGBLED_NUM-3);
- led_set_user(_BV(USB_LED_CAPS_LOCK)|_BV(USB_LED_NUM_LOCK)|_BV(USB_LED_SCROLL_LOCK));
+ led_t led_state = {
+ .caps_lock = true,
+ .num_lock = true,
+ .scroll_lock = true
+ };
+ led_update_kb(led_state);
wait_ms(300);
- led_set_user(0);
+ led_update_kb((led_t){0});
}
__attribute__ ((weak))
diff --git a/keyboards/hineybush/hbcp/keymaps/hiney/keymap.c b/keyboards/hineybush/hbcp/keymaps/hiney/keymap.c
index 5f1d7700f6..26a67fe7ca 100644
--- a/keyboards/hineybush/hbcp/keymaps/hiney/keymap.c
+++ b/keyboards/hineybush/hbcp/keymaps/hiney/keymap.c
@@ -77,23 +77,24 @@ void matrix_scan_user(void) {
#ifdef RGBLIGHT_ENABLE
// The first three LEDs are used as indicators for CAPS_LOCK, NUM_LOCK and SCROLL_LOCK.
-void led_set_user(uint8_t usb_led) {
- if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
+bool led_update_user(led_t led_state) {
+ if (led_state.caps_lock) {
sethsv_raw(HSV_SOFT_RED, (LED_TYPE *)&led[0]);
} else {
sethsv(HSV_BLACK, (LED_TYPE *)&led[0]);
}
- if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
+ if (led_state.num_lock) {
sethsv_raw(HSV_WARM_WHITE, (LED_TYPE *)&led[1]);
} else {
sethsv(HSV_BLACK, (LED_TYPE *)&led[1]);
}
- if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) {
+ if (led_state.scroll_lock) {
sethsv_raw(HSV_SOFT_BLUE, (LED_TYPE *)&led[2]);
} else {
sethsv(HSV_BLACK, (LED_TYPE *)&led[2]);
}
rgblight_set();
+ return false;
}
#endif