summaryrefslogtreecommitdiff
path: root/hid/lib/drivers-avr/factory.cpp
diff options
context:
space:
mode:
authortomaszduda23 <[email protected]>2022-07-11 11:59:56 +0900
committerGitHub <[email protected]>2022-07-11 05:59:56 +0300
commitdc1bc121c89600e2d5a18458283aa5960aa39e24 (patch)
tree9c212046147cdea8a65973b3b0fd1405cbdeb5c4 /hid/lib/drivers-avr/factory.cpp
parent89aff795fd7905aaf192428bb99814c13b98d5c2 (diff)
add interface for storage (#99)
Diffstat (limited to 'hid/lib/drivers-avr/factory.cpp')
-rw-r--r--hid/lib/drivers-avr/factory.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/hid/lib/drivers-avr/factory.cpp b/hid/lib/drivers-avr/factory.cpp
index 26f10583..c6968777 100644
--- a/hid/lib/drivers-avr/factory.cpp
+++ b/hid/lib/drivers-avr/factory.cpp
@@ -23,6 +23,7 @@
#include "usb/hid.h"
#include "ps2/hid.h"
#include "factory.h"
+#include "eeprom.h"
namespace DRIVERS {
@@ -56,4 +57,16 @@ namespace DRIVERS {
return new Mouse(DRIVERS::DUMMY);
}
}
+ Storage* Factory::makeStorage(type _type) {
+ switch (_type)
+ {
+# ifdef HID_DYNAMIC
+ case NON_VOLATILE_STORAGE:
+ return new Eeprom(DRIVERS::NON_VOLATILE_STORAGE);
+# endif
+ default:
+ return new Storage(DRIVERS::DUMMY);
+ }
+ }
+
}