mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 09:10:30 +08:00
refactoring
This commit is contained in:
parent
79e1b457b7
commit
50b6237e98
@ -64,7 +64,7 @@ namespace DRIVERS {
|
||||
}
|
||||
}
|
||||
|
||||
Storage* Factory::makeStorage(type _type) {
|
||||
Storage *Factory::makeStorage(type _type) {
|
||||
switch (_type) {
|
||||
# ifdef HID_DYNAMIC
|
||||
case NON_VOLATILE_STORAGE:
|
||||
@ -75,14 +75,14 @@ namespace DRIVERS {
|
||||
}
|
||||
}
|
||||
|
||||
Board* Factory::makeBoard(type _type) {
|
||||
Board *Factory::makeBoard(type _type) {
|
||||
switch (_type) {
|
||||
default:
|
||||
return new Board(DRIVERS::DUMMY);
|
||||
}
|
||||
}
|
||||
|
||||
Connection* Factory::makeConnection(type _type) {
|
||||
Connection *Factory::makeConnection(type _type) {
|
||||
# ifdef CMD_SERIAL
|
||||
return new Serial();
|
||||
# elif defined(CMD_SPI)
|
||||
|
||||
@ -64,7 +64,7 @@ namespace DRIVERS {
|
||||
}
|
||||
}
|
||||
|
||||
Storage* Factory::makeStorage(type _type) {
|
||||
Storage *Factory::makeStorage(type _type) {
|
||||
switch (_type) {
|
||||
# ifdef HID_DYNAMIC
|
||||
case NON_VOLATILE_STORAGE:
|
||||
@ -75,7 +75,7 @@ namespace DRIVERS {
|
||||
}
|
||||
}
|
||||
|
||||
Board* Factory::makeBoard(type _type) {
|
||||
Board *Factory::makeBoard(type _type) {
|
||||
switch (_type) {
|
||||
case BOARD:
|
||||
return new BoardStm32();
|
||||
@ -84,7 +84,7 @@ namespace DRIVERS {
|
||||
}
|
||||
}
|
||||
|
||||
Connection* Factory::makeConnection(type _type) {
|
||||
Connection *Factory::makeConnection(type _type) {
|
||||
# ifdef CMD_SERIAL
|
||||
return new Serial();
|
||||
# else
|
||||
|
||||
@ -32,8 +32,8 @@ namespace DRIVERS {
|
||||
struct Factory {
|
||||
static Keyboard *makeKeyboard(type _type);
|
||||
static Mouse *makeMouse(type _type);
|
||||
static Storage* makeStorage(type _type);
|
||||
static Board* makeBoard(type _type);
|
||||
static Connection* makeConnection(type _type);
|
||||
static Storage *makeStorage(type _type);
|
||||
static Board *makeBoard(type _type);
|
||||
static Connection *makeConnection(type _type);
|
||||
};
|
||||
}
|
||||
|
||||
@ -24,19 +24,21 @@
|
||||
|
||||
#include "tools.h"
|
||||
#include "proto.h"
|
||||
#include "board.h"
|
||||
#include "outputs.h"
|
||||
#ifdef AUM
|
||||
# include "aum.h"
|
||||
#endif
|
||||
#include "board.h"
|
||||
#include "outputs.h"
|
||||
|
||||
static DRIVERS::Connection* _conn;
|
||||
static DRIVERS::Board* _board;
|
||||
|
||||
static DRIVERS::Connection *_conn;
|
||||
static DRIVERS::Board *_board;
|
||||
static Outputs _out;
|
||||
|
||||
#ifdef HID_DYNAMIC
|
||||
# define RESET_TIMEOUT 500000
|
||||
static bool _reset_required = false;
|
||||
static unsigned long _reset_timestamp;
|
||||
# define RESET_TIMEOUT 500000
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user