Replace {GET,SET}_USB_BUFFER_UINT8 with {Get,Set}UsbRxBufferUint8

This commit is contained in:
László Monda
2017-11-11 16:49:48 +01:00
parent f4de0df149
commit 22141ba1e3
14 changed files with 75 additions and 44 deletions

View File

@@ -5,11 +5,11 @@
void UsbCommand_ReadConfig(bool isHardware)
{
uint8_t length = GET_USB_BUFFER_UINT8(1);
uint16_t offset = GET_USB_BUFFER_UINT16(2);
uint8_t length = GetUsbRxBufferUint8(1);
uint16_t offset = GetUsbRxBufferUint16(2);
if (length > USB_GENERIC_HID_OUT_BUFFER_LENGTH - USB_STATUS_CODE_SIZE) {
SET_USB_BUFFER_UINT8(0, UsbStatusCode_ReadConfig_LengthTooLarge);
SetUsbTxBufferUint8(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_ReadConfig_BufferOutOfBounds);
SetUsbTxBufferUint8(0, UsbStatusCode_ReadConfig_BufferOutOfBounds);
return;
}