Implement DevicePropertyId_Uptime

This commit is contained in:
László Monda
2018-01-14 18:32:18 +01:00
parent c854e98d84
commit 2661c3d909
2 changed files with 5 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
#include "i2c.h" #include "i2c.h"
#include "init_peripherals.h" #include "init_peripherals.h"
#include "fsl_i2c.h" #include "fsl_i2c.h"
#include "timer.h"
version_t deviceProtocolVersion = { version_t deviceProtocolVersion = {
DEVICE_PROTOCOL_MAJOR_VERSION, DEVICE_PROTOCOL_MAJOR_VERSION,
@@ -67,6 +68,9 @@ void UsbCommand_GetDeviceProperty(void)
SetUsbTxBufferUint32(2, I2cMainBusRequestedBaudRateBps); SetUsbTxBufferUint32(2, I2cMainBusRequestedBaudRateBps);
SetUsbTxBufferUint32(6, I2cMainBusActualBaudRateBps); SetUsbTxBufferUint32(6, I2cMainBusActualBaudRateBps);
break; break;
case DevicePropertyId_Uptime:
SetUsbTxBufferUint32(1, CurrentTime);
break;
default: default:
SetUsbTxBufferUint8(0, UsbStatusCode_GetDeviceProperty_InvalidProperty); SetUsbTxBufferUint8(0, UsbStatusCode_GetDeviceProperty_InvalidProperty);
break; break;

View File

@@ -9,6 +9,7 @@
DevicePropertyId_ConfigSizes = 2, DevicePropertyId_ConfigSizes = 2,
DevicePropertyId_CurrentKbootCommand = 3, DevicePropertyId_CurrentKbootCommand = 3,
DevicePropertyId_I2cMainBusBaudRate = 4, DevicePropertyId_I2cMainBusBaudRate = 4,
DevicePropertyId_Uptime = 5,
} device_property_t; } device_property_t;
typedef enum { typedef enum {