summaryrefslogtreecommitdiff
path: root/hid/lib/drivers-avr
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-07-11 02:12:38 +0300
committerMaxim Devaev <[email protected]>2022-07-11 02:12:38 +0300
commit89aff795fd7905aaf192428bb99814c13b98d5c2 (patch)
tree8f80c599f0c6f7d754f702f106c2e30d2fa60395 /hid/lib/drivers-avr
parent1afd96cdb932ccb1df0f0ed7e6662080f2618a26 (diff)
refactoring
Diffstat (limited to 'hid/lib/drivers-avr')
-rw-r--r--hid/lib/drivers-avr/factory.cpp22
-rw-r--r--hid/lib/drivers-avr/spi.cpp3
-rw-r--r--hid/lib/drivers-avr/spi.h1
-rw-r--r--hid/lib/drivers-avr/usb/hid.h1
4 files changed, 12 insertions, 15 deletions
diff --git a/hid/lib/drivers-avr/factory.cpp b/hid/lib/drivers-avr/factory.cpp
index d58e6c96..26f10583 100644
--- a/hid/lib/drivers-avr/factory.cpp
+++ b/hid/lib/drivers-avr/factory.cpp
@@ -19,43 +19,41 @@
# #
*****************************************************************************/
+
#include "usb/hid.h"
#include "ps2/hid.h"
#include "factory.h"
-namespace DRIVERS
-{
+namespace DRIVERS {
Keyboard *Factory::makeKeyboard(type _type) {
switch (_type) {
-
-# ifdef HID_WITH_USB
+# ifdef HID_WITH_USB
case USB_KEYBOARD:
return new UsbKeyboard();
-# endif
+# endif
-# ifdef HID_WITH_PS2
+# ifdef HID_WITH_PS2
case PS2_KEYBOARD:
return new Ps2Keyboard();
-# endif
+# endif
+
default:
return new Keyboard(DUMMY);
}
}
Mouse *Factory::makeMouse(type _type) {
- switch(_type)
- {
-# ifdef HID_WITH_USB
+ switch (_type) {
+# ifdef HID_WITH_USB
case USB_MOUSE_ABSOLUTE:
case USB_MOUSE_ABSOLUTE_WIN98:
return new UsbMouseAbsolute(_type);
case USB_MOUSE_RELATIVE:
return new UsbMouseRelative();
-# endif
+# endif
default:
return new Mouse(DRIVERS::DUMMY);
}
}
-
}
diff --git a/hid/lib/drivers-avr/spi.cpp b/hid/lib/drivers-avr/spi.cpp
index e2b56928..66061692 100644
--- a/hid/lib/drivers-avr/spi.cpp
+++ b/hid/lib/drivers-avr/spi.cpp
@@ -22,9 +22,6 @@
#include "spi.h"
-#include <Arduino.h>
-#include <SPI.h>
-
static volatile uint8_t _spi_in[8] = {0};
static volatile uint8_t _spi_in_index = 0;
diff --git a/hid/lib/drivers-avr/spi.h b/hid/lib/drivers-avr/spi.h
index fc9337e5..6a8e9e8c 100644
--- a/hid/lib/drivers-avr/spi.h
+++ b/hid/lib/drivers-avr/spi.h
@@ -23,6 +23,7 @@
#pragma once
#include <Arduino.h>
+#include <SPI.h>
void spiBegin();
diff --git a/hid/lib/drivers-avr/usb/hid.h b/hid/lib/drivers-avr/usb/hid.h
index 0bc5cb2d..dec850a7 100644
--- a/hid/lib/drivers-avr/usb/hid.h
+++ b/hid/lib/drivers-avr/usb/hid.h
@@ -69,6 +69,7 @@ using namespace DRIVERS;
#endif
+
class UsbKeyboard : public DRIVERS::Keyboard {
public:
UsbKeyboard() : DRIVERS::Keyboard(DRIVERS::USB_KEYBOARD) {}