Make the left half send only as many bytes of key state information as required.

This commit is contained in:
László Monda
2017-05-31 02:24:55 +02:00
parent 2172b58a00
commit 57319489d2
2 changed files with 5 additions and 3 deletions

View File

@@ -33,9 +33,8 @@ void SlaveProtocolHandler(void)
uint8_t commandId = SlaveRxBuffer[0];
switch (commandId) {
case SlaveCommand_GetKeyStates:
SlaveTxSize = KEYBOARD_MATRIX_COLS_NUM*KEYBOARD_MATRIX_ROWS_NUM;
BoolBytesToBits(keyMatrix.keyStates, SlaveTxBuffer, SlaveTxSize);
// memcpy(SlaveTxBuffer, keyMatrix.keyStates, SlaveTxSize);
SlaveTxSize = KEY_STATE_BUFFER_SIZE;
BoolBytesToBits(keyMatrix.keyStates, SlaveTxBuffer, LEFT_KEYBOARD_HALF_KEY_COUNT);
break;
case SlaveCommand_SetTestLed:
SlaveTxSize = 0;