Split usb_status_code_transfer_config_t as usb_status_code_read_config_t and usb_status_code_write_config_t

This commit is contained in:
László Monda
2017-11-05 22:14:49 +01:00
parent a8bde4e007
commit f7e26eef8a
5 changed files with 18 additions and 9 deletions

View File

@@ -9,7 +9,7 @@ void UsbCommand_ReadConfig(bool isHardware)
uint16_t offset = GET_USB_BUFFER_UINT16(2);
if (length > USB_GENERIC_HID_OUT_BUFFER_LENGTH-1) {
SET_USB_BUFFER_UINT8(0, UsbStatusCode_TransferConfig_LengthTooLarge);
SET_USB_BUFFER_UINT8(0, UsbStatusCode_ReadConfig_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) {
SET_USB_BUFFER_UINT8(0, UsbStatusCode_TransferConfig_BufferOutOfBounds);
SET_USB_BUFFER_UINT8(0, UsbStatusCode_ReadConfig_BufferOutOfBounds);
return;
}