Add DevicePropertyId_ConfigSizes.

This commit is contained in:
László Monda
2017-12-14 16:40:44 +01:00
parent 494621a841
commit 312f56048b
2 changed files with 10 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ version_t deviceProtocolVersion = {
DEVICE_PROTOCOL_PATCH_VERSION, DEVICE_PROTOCOL_PATCH_VERSION,
}; };
version_t everyProtocolVersion[] = version_t protocolVersions[] =
{ {
{ {
FIRMWARE_MAJOR_VERSION, FIRMWARE_MAJOR_VERSION,
@@ -39,6 +39,8 @@ version_t everyProtocolVersion[] =
} }
}; };
uint16_t configSizes[] = {HARDWARE_CONFIG_SIZE, USER_CONFIG_SIZE};
void UsbCommand_GetProperty(void) void UsbCommand_GetProperty(void)
{ {
uint8_t propertyId = GetUsbRxBufferUint8(1); uint8_t propertyId = GetUsbRxBufferUint8(1);
@@ -47,8 +49,11 @@ void UsbCommand_GetProperty(void)
case DevicePropertyId_DeviceProtocolVersion: case DevicePropertyId_DeviceProtocolVersion:
memcpy(GenericHidOutBuffer+1, (uint8_t*)&deviceProtocolVersion, sizeof(deviceProtocolVersion)); memcpy(GenericHidOutBuffer+1, (uint8_t*)&deviceProtocolVersion, sizeof(deviceProtocolVersion));
break; break;
case DevicePropertyId_EveryProtocolVersion: case DevicePropertyId_ProtocolVersions:
memcpy(GenericHidOutBuffer+1, (uint8_t*)&everyProtocolVersion, sizeof(everyProtocolVersion)); memcpy(GenericHidOutBuffer+1, (uint8_t*)&protocolVersions, sizeof(protocolVersions));
break;
case DevicePropertyId_ConfigSizes:
memcpy(GenericHidOutBuffer+1, (uint8_t*)&configSizes, sizeof(configSizes));
break; break;
case DevicePropertyId_HardwareConfigSize: case DevicePropertyId_HardwareConfigSize:
SetUsbTxBufferUint16(1, HARDWARE_CONFIG_SIZE); SetUsbTxBufferUint16(1, HARDWARE_CONFIG_SIZE);

View File

@@ -5,7 +5,8 @@
typedef enum { typedef enum {
DevicePropertyId_DeviceProtocolVersion = 0, DevicePropertyId_DeviceProtocolVersion = 0,
DevicePropertyId_EveryProtocolVersion = 1, DevicePropertyId_ProtocolVersions = 1,
DevicePropertyId_ConfigSizes = 2,
DevicePropertyId_HardwareConfigSize = 4, DevicePropertyId_HardwareConfigSize = 4,
DevicePropertyId_UserConfigSize = 5, DevicePropertyId_UserConfigSize = 5,
} system_property_t; } system_property_t;