diff --git a/right/src/slave_drivers/kboot_driver.c b/right/src/slave_drivers/kboot_driver.c index 44f66e4..15b2d87 100644 --- a/right/src/slave_drivers/kboot_driver.c +++ b/right/src/slave_drivers/kboot_driver.c @@ -27,7 +27,7 @@ status_t KbootSlaveDriver_Update(uint8_t kbootInstanceId) { status_t status = kStatus_Uhk_IdleSlave; - switch (KbootDriverState.commandType) { + switch (KbootDriverState.command) { case KbootCommand_Idle: break; case KbootCommand_Ping: @@ -49,7 +49,7 @@ status_t KbootSlaveDriver_Update(uint8_t kbootInstanceId) case KbootPhase_CheckPingResponseStatus: KbootDriverState.status = Slaves[SlaveId_KbootDriver].previousStatus; if (KbootDriverState.status == kStatus_Success) { - KbootDriverState.commandType = KbootCommand_Idle; + KbootDriverState.command = KbootCommand_Idle; } else { KbootDriverState.phase = KbootPhase_SendPing; return kStatus_Uhk_IdleCycle; @@ -72,7 +72,7 @@ status_t KbootSlaveDriver_Update(uint8_t kbootInstanceId) break; case KbootPhase_CheckResetSendAck: status = tx(ackMessage, sizeof(ackMessage)); - KbootDriverState.commandType = KbootCommand_Idle; + KbootDriverState.command = KbootCommand_Idle; break; } break; diff --git a/right/src/slave_drivers/kboot_driver.h b/right/src/slave_drivers/kboot_driver.h index a0bd9e9..5c3a8ae 100644 --- a/right/src/slave_drivers/kboot_driver.h +++ b/right/src/slave_drivers/kboot_driver.h @@ -39,7 +39,7 @@ } kboot_reset_phase_t; typedef struct { - kboot_command_t commandType; + kboot_command_t command; uint8_t i2cAddress; uint8_t phase; uint32_t status; diff --git a/right/src/usb_commands/usb_command_get_device_property.c b/right/src/usb_commands/usb_command_get_device_property.c index 377b95c..9760e7a 100644 --- a/right/src/usb_commands/usb_command_get_device_property.c +++ b/right/src/usb_commands/usb_command_get_device_property.c @@ -3,6 +3,7 @@ #include "usb_protocol_handler.h" #include "eeprom.h" #include "versions.h" +#include "slave_drivers/kboot_driver.h" version_t deviceProtocolVersion = { DEVICE_PROTOCOL_MAJOR_VERSION, @@ -55,6 +56,9 @@ void UsbCommand_GetDeviceProperty(void) case DevicePropertyId_ConfigSizes: memcpy(GenericHidOutBuffer+1, (uint8_t*)&configSizes, sizeof(configSizes)); break; + case DevicePropertyId_CurrentKbootCommand: + GenericHidOutBuffer[1] = KbootDriverState.command; + break; default: SetUsbTxBufferUint8(0, UsbStatusCode_GetDeviceProperty_InvalidProperty); break; diff --git a/right/src/usb_commands/usb_command_get_device_property.h b/right/src/usb_commands/usb_command_get_device_property.h index 6662bb8..f063c52 100644 --- a/right/src/usb_commands/usb_command_get_device_property.h +++ b/right/src/usb_commands/usb_command_get_device_property.h @@ -7,6 +7,7 @@ DevicePropertyId_DeviceProtocolVersion = 0, DevicePropertyId_ProtocolVersions = 1, DevicePropertyId_ConfigSizes = 2, + DevicePropertyId_CurrentKbootCommand = 3, } system_property_t; typedef enum { diff --git a/right/src/usb_commands/usb_command_send_kboot_command_to_module.c b/right/src/usb_commands/usb_command_send_kboot_command_to_module.c index fea63ac..08397fb 100644 --- a/right/src/usb_commands/usb_command_send_kboot_command_to_module.c +++ b/right/src/usb_commands/usb_command_send_kboot_command_to_module.c @@ -6,5 +6,5 @@ void UsbCommand_SendKbootCommandToModule(void) { KbootDriverState.phase = 0; KbootDriverState.i2cAddress = GetUsbRxBufferUint8(2); - KbootDriverState.commandType = GetUsbRxBufferUint8(1); // Command should be set last. + KbootDriverState.command = GetUsbRxBufferUint8(1); // Command should be set last. }