summaryrefslogtreecommitdiffstats
path: root/keyboards/converter/sun_usb/led.c
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2023-06-27 09:15:33 +1000
committerGitHub <noreply@github.com>2023-06-27 09:15:33 +1000
commit5542f5ede1356df387dfb10587f2d74e40fa62a8 (patch)
tree2f2821aefd33fa68f5253facfa1eb55fff26d874 /keyboards/converter/sun_usb/led.c
parentfa4ea73bf6668832a363da6817d0792c1e16d37a (diff)
Get rid of `USB_LED_KANA` and `USB_LED_COMPOSE` (#21366)
Diffstat (limited to 'keyboards/converter/sun_usb/led.c')
-rw-r--r--keyboards/converter/sun_usb/led.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/keyboards/converter/sun_usb/led.c b/keyboards/converter/sun_usb/led.c
index 493825bac8..160664ffde 100644
--- a/keyboards/converter/sun_usb/led.c
+++ b/keyboards/converter/sun_usb/led.c
@@ -19,15 +19,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "print.h"
#include "uart.h"
-void led_set(uint8_t usb_led)
+bool led_update_kb(led_t led_state)
{
- uint8_t sun_led = 0;
- if (usb_led & (1<<USB_LED_NUM_LOCK)) sun_led |= (1<<0);
- if (usb_led & (1<<USB_LED_COMPOSE)) sun_led |= (1<<1);
- if (usb_led & (1<<USB_LED_SCROLL_LOCK)) sun_led |= (1<<2);
- if (usb_led & (1<<USB_LED_CAPS_LOCK)) sun_led |= (1<<3);
- xprintf("LED: %02X\n", usb_led);
+ bool res = led_update_user(led_state);
+ if (res) {
+ uint8_t sun_led = 0;
+ if (led_state.num_lock) sun_led |= (1<<0);
+ if (led_state.compose) sun_led |= (1<<1);
+ if (led_state.scroll_lock) sun_led |= (1<<2);
+ if (led_state.caps_lock) sun_led |= (1<<3);
- uart_write(0x0E);
- uart_write(sun_led);
+ uart_write(0x0E);
+ uart_write(sun_led);
+ }
+ return res;
}