From dc1bc121c89600e2d5a18458283aa5960aa39e24 Mon Sep 17 00:00:00 2001 From: tomaszduda23 Date: Mon, 11 Jul 2022 11:59:56 +0900 Subject: add interface for storage (#99) --- hid/lib/drivers-avr/factory.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'hid/lib/drivers-avr/factory.cpp') 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); + } + } + } -- cgit v1.2.3