Remove KEY_STATE_SIZE in favor of the more general BOOL_BYTES_TO_BITS_COUNT() macro.
This commit is contained in:
@@ -72,7 +72,7 @@ void SlaveTxHandler(void)
|
||||
}
|
||||
case SlaveCommand_RequestKeyStates:
|
||||
BoolBytesToBits(keyMatrix.keyStates, TxMessage.data, MODULE_KEY_COUNT);
|
||||
TxMessage.length = KEY_STATE_SIZE;
|
||||
TxMessage.length = BOOL_BYTES_TO_BITS_COUNT(MODULE_KEY_COUNT);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#define PROTOCOL_RESPONSE_SUCCESS 0
|
||||
#define PROTOCOL_RESPONSE_GENERIC_ERROR 1
|
||||
|
||||
#define KEY_STATE_SIZE (MODULE_KEY_COUNT/8 + (MODULE_KEY_COUNT % 8 ? 1 : 0))
|
||||
|
||||
// Variables:
|
||||
|
||||
extern i2c_message_t RxMessage;
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
// Macros:
|
||||
|
||||
#define UHK_MODULE_MAX_COUNT 3
|
||||
#define KEY_STATE_SIZE (LEFT_KEYBOARD_HALF_KEY_COUNT/8 + (LEFT_KEYBOARD_HALF_KEY_COUNT % 8 ? 1 : 0))
|
||||
#define MAX_PWM_BRIGHTNESS 0x64
|
||||
|
||||
// Typedefs:
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// Macros:
|
||||
|
||||
#define BOOL_BYTES_TO_BITS_COUNT(BYTE_COUNT) (BYTE_COUNT/8 + (BYTE_COUNT % 8 ? 1 : 0))
|
||||
|
||||
// Functions:
|
||||
|
||||
void BoolBytesToBits(uint8_t *srcBytes, uint8_t *dstBits, uint8_t byteCount);
|
||||
|
||||
Reference in New Issue
Block a user