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/ps2 | |
parent | b4c1cc9976052dbefc30826c61aacf89fdf501b2 (diff) |
Change name to simplify interface getLedsAs->getLeds. (#93)
Diffstat (limited to 'hid/src/ps2')
-rw-r--r-- | hid/src/ps2/hid.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/hid/src/ps2/hid.h b/hid/src/ps2/hid.h index ec55b80a..db7247e4 100644 --- a/hid/src/ps2/hid.h +++ b/hid/src/ps2/hid.h @@ -25,6 +25,7 @@ #include <Arduino.h> #include <ps2dev.h> +#include "keyboard.h" #include "keymap.h" // #define HID_PS2_KBD_CLOCK_PIN 7 @@ -78,13 +79,13 @@ class Ps2Keyboard { return false; } - uint8_t getLedsAs(uint8_t caps, uint8_t scroll, uint8_t num) { - uint8_t result = 0; + KeyboardLedsState getLeds() { + KeyboardLedsState result; periodic(); - if (_leds & 0b00000100) result |= caps; - if (_leds & 0b00000001) result |= scroll; - if (_leds & 0b00000010) result |= num; + result.caps = _leds & 0b00000100; + result.scroll = _leds & 0b00000001; + result.num = _leds & 0b00000010; return result; } |