Implement detachFromHost() and attachToHost()

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/427/head^2
Gergely Nagy 7 years ago
parent c6be3cf804
commit e706ffaa89

@ -217,6 +217,14 @@ void ErgoDox::debounceRow(uint8_t change, uint8_t row) {
}
}
void ErgoDox::detachFromHost() {
UDCON |= (1 << DETACH);
}
void ErgoDox::attachToHost() {
UDCON &= ~(1 << DETACH);
}
}
}

@ -63,6 +63,17 @@ class ErgoDox {
void actOnMatrixScan(void);
void setup();
/** 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();
/* Key masking
* -----------
*

Loading…
Cancel
Save