The `FingerprintUSBHost` library isn't the most reliable thing, so instead of setting false expectations, remove auto-detection instead. This makes the plugin a whole lost simpler, and depend on one less library. Fixes #9. Signed-off-by: Gergely Nagy <algernon@keyboard.io>pull/389/head
parent
74f5f6d2e7
commit
985e31b48b
@ -1,47 +0,0 @@
|
||||
/* -*- mode: c++ -*-
|
||||
* Kaleidoscope-HostOS -- Host OS detection and tracking for Kaleidoscope
|
||||
* Copyright (C) 2016, 2017, 2018 Keyboard.io, Inc
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by the Free Software
|
||||
* Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <Kaleidoscope/HostOS-Guesser.h>
|
||||
|
||||
#include <FingerprintUSBHost.h>
|
||||
|
||||
namespace kaleidoscope {
|
||||
namespace hostos {
|
||||
|
||||
void Guesser::autoDetect(void) {
|
||||
Serial.begin(9600);
|
||||
|
||||
delay(15000);
|
||||
|
||||
switch (FingerprintUSBHost.guessHostOS()) {
|
||||
case GuessedHost::WINDOWS:
|
||||
os_ = WINDOWS;
|
||||
break;
|
||||
case GuessedHost::LINUX:
|
||||
os_ = LINUX;
|
||||
break;
|
||||
case GuessedHost::MACOS:
|
||||
os_ = OSX;
|
||||
break;
|
||||
default:
|
||||
os_ = OTHER;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/* -*- mode: c++ -*-
|
||||
* Kaleidoscope-HostOS -- Host OS detection and tracking for Kaleidoscope
|
||||
* Copyright (C) 2016, 2017, 2018 Keyboard.io, Inc
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by the Free Software
|
||||
* Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Kaleidoscope/HostOS-Base.h>
|
||||
|
||||
namespace kaleidoscope {
|
||||
namespace hostos {
|
||||
|
||||
class Guesser : public Base {
|
||||
public:
|
||||
Guesser(void) {}
|
||||
|
||||
protected:
|
||||
void autoDetect(void) final;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in new issue