add interface for storage (#99)

This commit is contained in:
tomaszduda23
2022-07-11 11:59:56 +09:00
committed by GitHub
parent 89aff795fd
commit dc1bc121c8
6 changed files with 95 additions and 6 deletions

View File

@@ -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);
}
}
}