From c5abbdcd54fe037fada81ddda5924fdf2561d727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Sun, 23 Jul 2017 20:14:29 +0200 Subject: [PATCH] Move system property enum to system_properties.h --- right/src/system_properties.h | 9 +++++++++ right/src/usb_protocol_handler.c | 8 ++++---- right/src/usb_protocol_handler.h | 7 ------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/right/src/system_properties.h b/right/src/system_properties.h index 2a0642e..5938496 100644 --- a/right/src/system_properties.h +++ b/right/src/system_properties.h @@ -8,4 +8,13 @@ #define SYSTEM_PROPERTY_DATA_MODEL_VERSION 1 #define SYSTEM_PROPERTY_FIRMWARE_VERSION 1 +// Typedefs: + + typedef enum { + SystemPropertyId_UsbProtocolVersion = 0, + SystemPropertyId_BridgeProtocolVersion = 1, + SystemPropertyId_DataModelVersion = 2, + SystemPropertyId_FirmwareVersion = 3, + } system_property_t; + #endif diff --git a/right/src/usb_protocol_handler.c b/right/src/usb_protocol_handler.c index 9e40520..47d68b0 100644 --- a/right/src/usb_protocol_handler.c +++ b/right/src/usb_protocol_handler.c @@ -36,16 +36,16 @@ void getSystemProperty(void) { uint8_t propertyId = GenericHidInBuffer[1]; switch (propertyId) { - case SystemProperty_UsbProtocolVersionId: + case SystemPropertyId_UsbProtocolVersion: SetResponseByte(SYSTEM_PROPERTY_USB_PROTOCOL_VERSION); break; - case SystemProperty_BridgeProtocolVersionId: + case SystemPropertyId_BridgeProtocolVersion: SetResponseByte(SYSTEM_PROPERTY_BRIDGE_PROTOCOL_VERSION); break; - case SystemProperty_DataModelVersionId: + case SystemPropertyId_DataModelVersion: SetResponseByte(SYSTEM_PROPERTY_DATA_MODEL_VERSION); break; - case SystemProperty_FirmwareVersionId: + case SystemPropertyId_FirmwareVersion: SetResponseByte(SYSTEM_PROPERTY_FIRMWARE_VERSION); break; default: diff --git a/right/src/usb_protocol_handler.h b/right/src/usb_protocol_handler.h index 948c46b..577945c 100644 --- a/right/src/usb_protocol_handler.h +++ b/right/src/usb_protocol_handler.h @@ -23,13 +23,6 @@ UsbCommand_ReadUserConfiguration = 15, } usb_command_t; - typedef enum { - SystemProperty_UsbProtocolVersionId = 0, - SystemProperty_BridgeProtocolVersionId = 1, - SystemProperty_DataModelVersionId = 2, - SystemProperty_FirmwareVersionId = 3, - } system_property_t; - typedef enum { UsbResponse_Success = 0, UsbResponse_GenericError = 1,