diff --git a/keyboards/converter/adb_usb/adb_usb.c b/keyboards/converter/adb_usb/adb_usb.c new file mode 100644 index 00000000000..2dca32998fe --- /dev/null +++ b/keyboards/converter/adb_usb/adb_usb.c @@ -0,0 +1,13 @@ +// Copyright 2011 Jun Wako +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "led.h" +#include "adb.h" + +bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if(res) { + adb_host_kbd_led(~led_state.raw); + } + return res; +} diff --git a/keyboards/converter/adb_usb/led.c b/keyboards/converter/adb_usb/led.c deleted file mode 100644 index 3ee64a8e7d3..00000000000 --- a/keyboards/converter/adb_usb/led.c +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include "adb.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ - adb_host_kbd_led(~usb_led); -} diff --git a/keyboards/converter/adb_usb/rules.mk b/keyboards/converter/adb_usb/rules.mk index b4a73249dde..75b7f1354f2 100644 --- a/keyboards/converter/adb_usb/rules.mk +++ b/keyboards/converter/adb_usb/rules.mk @@ -1,5 +1,5 @@ CUSTOM_MATRIX = yes -SRC += matrix.c adb.c led.c +SRC += matrix.c adb.c # OPT_DEFS += -DADB_MOUSE_ENABLE -DMOUSE_ENABLE diff --git a/keyboards/converter/usb_usb/custom_matrix.cpp b/keyboards/converter/usb_usb/custom_matrix.cpp index e1ef6955707..0c552a09bca 100644 --- a/keyboards/converter/usb_usb/custom_matrix.cpp +++ b/keyboards/converter/usb_usb/custom_matrix.cpp @@ -224,11 +224,14 @@ extern "C" { } } - void led_set(uint8_t usb_led) { - if (kbd1.isReady()) kbd1.SetReport(0, 0, 2, 0, 1, &usb_led); - if (kbd2.isReady()) kbd2.SetReport(0, 0, 2, 0, 1, &usb_led); - if (kbd3.isReady()) kbd3.SetReport(0, 0, 2, 0, 1, &usb_led); - if (kbd4.isReady()) kbd4.SetReport(0, 0, 2, 0, 1, &usb_led); - led_update_kb((led_t){.raw = usb_led}); + bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if(res) { + if (kbd1.isReady()) kbd1.SetReport(0, 0, 2, 0, 1, &led_state.raw); + if (kbd2.isReady()) kbd2.SetReport(0, 0, 2, 0, 1, &led_state.raw); + if (kbd3.isReady()) kbd3.SetReport(0, 0, 2, 0, 1, &led_state.raw); + if (kbd4.isReady()) kbd4.SetReport(0, 0, 2, 0, 1, &led_state.raw); + } + return res; } } diff --git a/keyboards/sirius/unigo66/custom_matrix.cpp b/keyboards/sirius/unigo66/custom_matrix.cpp index 879a0e7c153..122136f1bc9 100644 --- a/keyboards/sirius/unigo66/custom_matrix.cpp +++ b/keyboards/sirius/unigo66/custom_matrix.cpp @@ -210,13 +210,15 @@ extern "C" } } - void led_set(uint8_t usb_led) - { - kbd1.SetReport(0, 0, 2, 0, 1, &usb_led); - kbd2.SetReport(0, 0, 2, 0, 1, &usb_led); - kbd3.SetReport(0, 0, 2, 0, 1, &usb_led); - kbd4.SetReport(0, 0, 2, 0, 1, &usb_led); - led_update_kb((led_t){.raw = usb_led}); + bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if(res) { + kbd1.SetReport(0, 0, 2, 0, 1, &led_state.raw); + kbd2.SetReport(0, 0, 2, 0, 1, &led_state.raw); + kbd3.SetReport(0, 0, 2, 0, 1, &led_state.raw); + kbd4.SetReport(0, 0, 2, 0, 1, &led_state.raw); + } + return res; } };