diff options
author | tomaszduda23 <[email protected]> | 2022-07-08 21:58:14 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-07-08 22:58:14 +0300 |
commit | e864aafcf7f9dea75582c1ebcbca5e8ac1a1ae26 (patch) | |
tree | a0363f589686f86f205c755316b96a01493634e7 /hid/src/usb | |
parent | b4c1cc9976052dbefc30826c61aacf89fdf501b2 (diff) |
Change name to simplify interface getLedsAs->getLeds. (#93)
Diffstat (limited to 'hid/src/usb')
-rw-r--r-- | hid/src/usb/hid.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/hid/src/usb/hid.h b/hid/src/usb/hid.h index 9d5ab75e..ac35179e 100644 --- a/hid/src/usb/hid.h +++ b/hid/src/usb/hid.h @@ -25,6 +25,7 @@ #include <Arduino.h> #include <HID-Project.h> +#include "keyboard.h" #include "../tools.h" #ifdef AUM # include "../aum.h" @@ -104,12 +105,12 @@ class UsbKeyboard { CLS_IS_OFFLINE(_kbd) - uint8_t getLedsAs(uint8_t caps, uint8_t scroll, uint8_t num) { + KeyboardLedsState getLeds() { uint8_t leds = _kbd.getLeds(); - uint8_t result = 0; - if (leds & LED_CAPS_LOCK) result |= caps; - if (leds & LED_SCROLL_LOCK) result |= scroll; - if (leds & LED_NUM_LOCK) result |= num; + KeyboardLedsState result; + result.caps = leds & LED_CAPS_LOCK; + result.scroll = leds & LED_SCROLL_LOCK; + result.num = leds & LED_NUM_LOCK; return result; } |