Replace {GET,SET}_USB_BUFFER_UINT8 with {Get,Set}UsbRxBufferUint8
This commit is contained in:
@@ -5,12 +5,12 @@
|
||||
|
||||
void UsbCommand_WriteConfig(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);
|
||||
const uint8_t paramsSize = USB_STATUS_CODE_SIZE + sizeof(length) + sizeof(offset);
|
||||
|
||||
if (length > USB_GENERIC_HID_OUT_BUFFER_LENGTH - paramsSize) {
|
||||
SET_USB_BUFFER_UINT8(0, UsbStatusCode_WriteConfig_LengthTooLarge);
|
||||
SetUsbTxBufferUint8(0, UsbStatusCode_WriteConfig_LengthTooLarge);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ void UsbCommand_WriteConfig(bool isHardware)
|
||||
uint16_t bufferLength = isHardware ? HARDWARE_CONFIG_SIZE : USER_CONFIG_SIZE;
|
||||
|
||||
if (offset + length > bufferLength) {
|
||||
SET_USB_BUFFER_UINT8(0, UsbStatusCode_WriteConfig_BufferOutOfBounds);
|
||||
SetUsbTxBufferUint8(0, UsbStatusCode_WriteConfig_BufferOutOfBounds);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user