summaryrefslogtreecommitdiff
path: root/hid/src/ps2/hid.h
diff options
context:
space:
mode:
Diffstat (limited to 'hid/src/ps2/hid.h')
-rw-r--r--hid/src/ps2/hid.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/hid/src/ps2/hid.h b/hid/src/ps2/hid.h
index 3f226090..c344625b 100644
--- a/hid/src/ps2/hid.h
+++ b/hid/src/ps2/hid.h
@@ -27,24 +27,20 @@
#include "keymap.h"
-// #define PS2_KBD_CLOCK_PIN 7
-// #define PS2_KBD_DATA_PIN 5
+// #define HID_PS2_KBD_CLOCK_PIN 7
+// #define HID_PS2_KBD_DATA_PIN 5
-class Ps2HidKeyboard {
+class Ps2Keyboard {
// https://wiki.osdev.org/PS/2_Keyboard
public:
- Ps2HidKeyboard() : _dev(PS2_KBD_CLOCK_PIN, PS2_KBD_DATA_PIN) {}
+ Ps2Keyboard() : _dev(HID_PS2_KBD_CLOCK_PIN, HID_PS2_KBD_DATA_PIN) {}
void begin() {
_dev.keyboard_init();
}
- bool isOnline() {
- return true;
- }
-
void periodic() {
_dev.keyboard_handle(&_leds);
}
@@ -57,7 +53,7 @@ class Ps2HidKeyboard {
if (ps2_type != PS2_KEY_TYPE_UNKNOWN) {
// Не отправлялась часть нажатий. Когда clock на нуле, комп не принимает ничего от клавы.
// Этот костыль понижает процент пропущенных нажатий.
- while (digitalRead(PS2_KBD_CLOCK_PIN) == 0) {};
+ while (digitalRead(HID_PS2_KBD_CLOCK_PIN) == 0) {};
if (state) {
switch (ps2_type) {
case PS2_KEY_TYPE_REG: _dev.keyboard_press(ps2_code); break;
@@ -78,6 +74,10 @@ class Ps2HidKeyboard {
}
}
+ uint8_t getOfflineAs(uint8_t offline) {
+ return 0;
+ }
+
uint8_t getLedsAs(uint8_t caps, uint8_t scroll, uint8_t num) {
uint8_t result = 0;