mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
refactoring
This commit is contained in:
parent
24651f4db3
commit
9f289914e9
@ -43,10 +43,12 @@
|
||||
#endif
|
||||
#include "outputs.h"
|
||||
|
||||
|
||||
static Outputs _out;
|
||||
#ifdef HID_DYNAMIC
|
||||
static bool _reset_required = false;
|
||||
#endif
|
||||
static Outputs _out;
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
static void _cmdSetKeyboard(const uint8_t *data) { // 1 bytes
|
||||
|
||||
@ -19,9 +19,11 @@
|
||||
# #
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#include "factory.h"
|
||||
#include "proto.h"
|
||||
|
||||
|
||||
class Outputs {
|
||||
public:
|
||||
void writeOutputs(uint8_t mask, uint8_t outputs, bool force) {
|
||||
@ -40,16 +42,15 @@ class Outputs {
|
||||
}
|
||||
|
||||
void initOutputs() {
|
||||
int outputs;
|
||||
# ifdef HID_DYNAMIC
|
||||
_storage = DRIVERS::Factory::makeStorage(DRIVERS::NON_VOLATILE_STORAGE);
|
||||
# else
|
||||
_storage = DRIVERS::Factory::makeStorage(DRIVERS::DUMMY);
|
||||
# endif
|
||||
outputs = _readOutputs();
|
||||
|
||||
uint8_t outputs = _readOutputs();
|
||||
if (outputs < 0) {
|
||||
outputs = 0;
|
||||
|
||||
# if defined(HID_WITH_USB) && defined(HID_SET_USB_KBD)
|
||||
outputs |= PROTO::OUTPUTS1::KEYBOARD::USB;
|
||||
# elif defined(HID_WITH_PS2) && defined(HID_SET_PS2_KBD)
|
||||
@ -95,9 +96,11 @@ class Outputs {
|
||||
mouse = DRIVERS::Factory::makeMouse(DRIVERS::DUMMY);
|
||||
break;
|
||||
}
|
||||
|
||||
# ifdef ARDUINO_ARCH_AVR
|
||||
USBDevice.attach();
|
||||
# endif
|
||||
|
||||
kbd->begin();
|
||||
mouse->begin();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user