From 312f56048b08bfbc6e69a89ae13f23ad1503afee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Thu, 14 Dec 2017 16:40:44 +0100 Subject: [PATCH] Add DevicePropertyId_ConfigSizes. --- right/src/usb_commands/usb_command_get_property.c | 11 ++++++++--- right/src/usb_commands/usb_command_get_property.h | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/right/src/usb_commands/usb_command_get_property.c b/right/src/usb_commands/usb_command_get_property.c index 52781d9..1fd60b3 100644 --- a/right/src/usb_commands/usb_command_get_property.c +++ b/right/src/usb_commands/usb_command_get_property.c @@ -10,7 +10,7 @@ version_t deviceProtocolVersion = { DEVICE_PROTOCOL_PATCH_VERSION, }; -version_t everyProtocolVersion[] = +version_t protocolVersions[] = { { FIRMWARE_MAJOR_VERSION, @@ -39,6 +39,8 @@ version_t everyProtocolVersion[] = } }; +uint16_t configSizes[] = {HARDWARE_CONFIG_SIZE, USER_CONFIG_SIZE}; + void UsbCommand_GetProperty(void) { uint8_t propertyId = GetUsbRxBufferUint8(1); @@ -47,8 +49,11 @@ void UsbCommand_GetProperty(void) case DevicePropertyId_DeviceProtocolVersion: memcpy(GenericHidOutBuffer+1, (uint8_t*)&deviceProtocolVersion, sizeof(deviceProtocolVersion)); break; - case DevicePropertyId_EveryProtocolVersion: - memcpy(GenericHidOutBuffer+1, (uint8_t*)&everyProtocolVersion, sizeof(everyProtocolVersion)); + case DevicePropertyId_ProtocolVersions: + memcpy(GenericHidOutBuffer+1, (uint8_t*)&protocolVersions, sizeof(protocolVersions)); + break; + case DevicePropertyId_ConfigSizes: + memcpy(GenericHidOutBuffer+1, (uint8_t*)&configSizes, sizeof(configSizes)); break; case DevicePropertyId_HardwareConfigSize: SetUsbTxBufferUint16(1, HARDWARE_CONFIG_SIZE); diff --git a/right/src/usb_commands/usb_command_get_property.h b/right/src/usb_commands/usb_command_get_property.h index db86e11..3208d9b 100644 --- a/right/src/usb_commands/usb_command_get_property.h +++ b/right/src/usb_commands/usb_command_get_property.h @@ -5,7 +5,8 @@ typedef enum { DevicePropertyId_DeviceProtocolVersion = 0, - DevicePropertyId_EveryProtocolVersion = 1, + DevicePropertyId_ProtocolVersions = 1, + DevicePropertyId_ConfigSizes = 2, DevicePropertyId_HardwareConfigSize = 4, DevicePropertyId_UserConfigSize = 5, } system_property_t;