Skip to content

Commit e73cfe5

Browse files
committed
hooks: Fix for keyboard LED update
1 parent e6120c5 commit e73cfe5

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

common/hooks.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
1515
along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18+
#include "keyboard.h"
1819
#include "hooks.h"
1920

2021
/* -------------------------------------------------
@@ -44,7 +45,7 @@ void matrix_change_hook(keyevent_t event) {
4445
/* Default behaviour: calls led_set (for compatibility). */
4546
__attribute__((weak))
4647
void led_update_hook(uint8_t led_status) {
47-
led_set(led_status);
48+
keyboard_set_leds(led_status);
4849
}
4950

5051
/* Called when indicator LEDs need updating from firmware. */

common/hooks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,4 @@ void led_update_hook(uint8_t led_status);
8585
/* Default behaviour: calls led_set (for compatibility). */
8686
void led_restore_hook(uint8_t led_status);
8787

88-
#endif /* _HOOKS_H_ */
88+
#endif /* _HOOKS_H_ */

common/keyboard.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,12 @@ void keyboard_task(void)
169169
// update LED
170170
if (led_status != host_keyboard_leds()) {
171171
led_status = host_keyboard_leds();
172-
keyboard_set_leds(led_status);
172+
if (debug_keyboard) dprintf("LED: %02X\n", led_status);
173+
led_update_hook(led_status);
173174
}
174175
}
175176

176177
void keyboard_set_leds(uint8_t leds)
177178
{
178-
if (debug_keyboard) { debug("keyboard_set_led: "); debug_hex8(leds); debug("\n"); }
179-
led_update_hook(leds);
179+
led_set(leds);
180180
}

0 commit comments

Comments
 (0)