Replace SLOT_ID_* macros with SlotId_* enum values.

This commit is contained in:
László Monda
2017-09-26 20:01:18 +02:00
parent 065a19fdc8
commit 9dde9ee917
3 changed files with 11 additions and 7 deletions

View File

@@ -50,7 +50,7 @@ void UpdateUsbReports()
KeyMatrix_Scan(&KeyMatrix);
memcpy(CurrentKeyStates[SLOT_ID_RIGHT_KEYBOARD_HALF], KeyMatrix.keyStates, MAX_KEY_COUNT_PER_MODULE);
memcpy(CurrentKeyStates[SlotId_RightKeyboardHalf], KeyMatrix.keyStates, MAX_KEY_COUNT_PER_MODULE);
UpdateActiveUsbReports();
SwitchActiveUsbBasicKeyboardReport();

View File

@@ -47,7 +47,7 @@ status_t UhkModuleSlaveDriver_Update(uint8_t uhkModuleId)
break;
case UhkModulePhase_ProcessKeystates:
if (CRC16_IsMessageValid(&rxMessage)) {
BoolBitsToBytes(rxMessage.data, CurrentKeyStates[SLOT_ID_LEFT_KEYBOARD_HALF], LEFT_KEYBOARD_HALF_KEY_COUNT);
BoolBitsToBytes(rxMessage.data, CurrentKeyStates[SlotId_LeftKeyboardHalf], LEFT_KEYBOARD_HALF_KEY_COUNT);
}
status = kStatus_Uhk_NoOp;
uhkModulePhase = UhkModulePhase_SetTestLed;

View File

@@ -12,11 +12,15 @@
// Macros:
#define SLOT_ID_RIGHT_KEYBOARD_HALF 0
#define SLOT_ID_LEFT_KEYBOARD_HALF 1
#define SLOT_ID_LEFT_MODULE 2
#define SLOT_ID_RIGHT_MODULE 3
#define SLOT_COUNT 4
// Typedefs:
typedef enum {
SlotId_RightKeyboardHalf = 0,
SlotId_LeftKeyboardHalf = 1,
SlotId_LeftModule = 2,
SlotId_RightModule = 3,
} slot_t;
#endif