summaryrefslogtreecommitdiff
path: root/hid/lib/drivers-stm32/factory.cpp
diff options
context:
space:
mode:
authortomaszduda23 <[email protected]>2023-03-04 18:25:16 +0100
committerGitHub <[email protected]>2023-03-04 20:25:16 +0300
commit52ac8d93a18521f19dc45e9b4283417ed06f63d8 (patch)
treecaf95bfe17db38067891d4ed958cdffe50ef4459 /hid/lib/drivers-stm32/factory.cpp
parent1f9e826f2fa9e27c705146254cf3597f531f0599 (diff)
adds abstraction for connection (#111)
Diffstat (limited to 'hid/lib/drivers-stm32/factory.cpp')
-rw-r--r--hid/lib/drivers-stm32/factory.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/hid/lib/drivers-stm32/factory.cpp b/hid/lib/drivers-stm32/factory.cpp
index 60145a4d..010eb507 100644
--- a/hid/lib/drivers-stm32/factory.cpp
+++ b/hid/lib/drivers-stm32/factory.cpp
@@ -27,6 +27,7 @@
#include "usb/mouse-relative-stm32.h"
#include "backup-register.h"
#include "board-stm32.h"
+#include "serial.h"
#ifndef __STM32F1__
# error "Only STM32F1 is supported"
@@ -82,4 +83,12 @@ namespace DRIVERS {
return new Board(DRIVERS::DUMMY);
}
}
+
+ Connection* Factory::makeConnection(type _type) {
+# ifdef CMD_SERIAL
+ return new Serial();
+# else
+# error CMD phy is not defined
+# endif
+ }
}