Rename UsbResponse_*() to UsbStatusCode_*(), SetUsbError() to SetUsbStatusCode(), and other USB status codes consistently.

This commit is contained in:
László Monda
2017-11-05 19:25:13 +01:00
parent eb451d6153
commit 6db3eb3045
7 changed files with 16 additions and 16 deletions

View File

@@ -16,7 +16,7 @@ void UsbCommand_ApplyConfig(void)
*(uint16_t*)(GenericHidOutBuffer+1) = StagingUserConfigBuffer.offset;
GenericHidOutBuffer[3] = 0;
if (GenericHidOutBuffer[0] != UsbResponse_Success) {
if (GenericHidOutBuffer[0] != UsbStatusCode_Success) {
return;
}
@@ -37,7 +37,7 @@ void UsbCommand_ApplyConfig(void)
*(uint16_t*)(GenericHidOutBuffer+1) = ValidatedUserConfigBuffer.offset;
GenericHidOutBuffer[3] = 1;
if (GenericHidOutBuffer[0] != UsbResponse_Success) {
if (GenericHidOutBuffer[0] != UsbStatusCode_Success) {
return;
}

View File

@@ -27,7 +27,7 @@ void UsbCommand_GetProperty(void)
SetUsbResponseWord(USER_CONFIG_SIZE);
break;
default:
SetUsbError(1);
SetUsbStatusCode(1);
break;
}
}

View File

@@ -6,7 +6,7 @@ void UsbCommand_JumpToSlaveBootloader(void)
uint8_t uhkModuleDriverId = GenericHidInBuffer[1];
if (uhkModuleDriverId >= UHK_MODULE_MAX_COUNT) {
SetUsbError(JumpToBootloaderError_InvalidModuleDriverId);
SetUsbStatusCode(UsbStatusCode_JumpToSlaveBootloader_InvalidModuleDriverId);
return;
}

View File

@@ -9,7 +9,7 @@ void UsbCommand_ReadConfig(bool isHardware)
uint16_t offset = *(uint16_t*)(GenericHidInBuffer+2);
if (length > USB_GENERIC_HID_OUT_BUFFER_LENGTH-1) {
SetUsbError(ConfigTransferResponse_LengthTooLarge);
SetUsbStatusCode(UsbStatusCode_TransferConfig_LengthTooLarge);
return;
}
@@ -17,7 +17,7 @@ void UsbCommand_ReadConfig(bool isHardware)
uint16_t bufferLength = isHardware ? HARDWARE_CONFIG_SIZE : USER_CONFIG_SIZE;
if (offset + length > bufferLength) {
SetUsbError(ConfigTransferResponse_BufferOutOfBounds);
SetUsbStatusCode(UsbStatusCode_TransferConfig_BufferOutOfBounds);
return;
}

View File

@@ -9,7 +9,7 @@ void UsbCommand_WriteConfig(bool isHardware)
uint16_t offset = *((uint16_t*)(GenericHidInBuffer+1+1));
if (length > USB_GENERIC_HID_OUT_BUFFER_LENGTH-1-1-2) {
SetUsbError(ConfigTransferResponse_LengthTooLarge);
SetUsbStatusCode(UsbStatusCode_TransferConfig_LengthTooLarge);
return;
}
@@ -17,7 +17,7 @@ void UsbCommand_WriteConfig(bool isHardware)
uint16_t bufferLength = isHardware ? HARDWARE_CONFIG_SIZE : USER_CONFIG_SIZE;
if (offset + length > bufferLength) {
SetUsbError(ConfigTransferResponse_BufferOutOfBounds);
SetUsbStatusCode(UsbStatusCode_TransferConfig_BufferOutOfBounds);
return;
}