Add uhk_slave_t.disconnect() callback so that upon disconnecting the left keyboard half, the left LED driver IC can be marked as disconnected too, so it'll be reinitialized upon reconnect. This usually didn't happen because LED states are cached so the LED drivers are rarely spoken to.

This commit is contained in:
László Monda
2017-10-01 02:47:29 +02:00
parent 320923b41c
commit 3079d527b1
4 changed files with 15 additions and 1 deletions

View File

@@ -141,3 +141,10 @@ status_t UhkModuleSlaveDriver_Update(uint8_t uhkModuleDriverId)
return status;
}
void UhkModuleSlaveDriver_Disconnect(uint8_t uhkModuleDriverId)
{
if (uhkModuleDriverId == SlaveId_LeftKeyboardHalf) {
Slaves[SlaveId_LeftLedDriver].isConnected = false;
}
}