Merge pull request #24 from keyboardio/f/detach-attach

Implement a way to detach from / attach to the host
pull/365/head
Jesse Vincent 7 years ago committed by GitHub
commit 37da56fb6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -251,4 +251,12 @@ void Model01::setKeyscanInterval(uint8_t interval) {
rightHand.setKeyscanInterval(interval);
}
void Model01::detachFromHost() {
UDCON |= (1 << DETACH);
}
void Model01::attachToHost() {
UDCON &= ~(1 << DETACH);
}
HARDWARE_IMPLEMENTATION KeyboardHardware;

@ -29,6 +29,17 @@ class Model01 {
void rebootBootloader();
/** Detaching from / attaching to the host.
*
* These two functions should detach the device from (or attach it to) the
* host, preferably without rebooting the device. Their purpose is to allow
* one to do some configuration inbetween, so the re-attach happens with
* different properties. The device remains powered between these operations,
* only the connection to the host gets severed.
*/
void detachFromHost();
void attachToHost();
/* These public functions are things supported by the Model 01, but
* aren't necessarily part of the Kaleidoscope API
*/

Loading…
Cancel
Save