summaryrefslogtreecommitdiff
path: root/keyboards/converter/sun_usb/led.c
diff options
context:
space:
mode:
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;
}