Merge branch 'bugfix/usj_wrong_return_value_v5.0' into 'release/v5.0'

fix(usb_serial_jtag): wrong return value in usb_serial_jtag_write_bytes (v5.0)

See merge request espressif/esp-idf!37973
This commit is contained in:
morris
2025-03-24 16:06:16 +08:00

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@@ -198,9 +198,8 @@ int usb_serial_jtag_read_bytes(void* buf, uint32_t length, TickType_t ticks_to_w
int usb_serial_jtag_write_bytes(const void* src, size_t size, TickType_t ticks_to_wait) int usb_serial_jtag_write_bytes(const void* src, size_t size, TickType_t ticks_to_wait)
{ {
ESP_RETURN_ON_FALSE(size != 0, ESP_ERR_INVALID_ARG, USB_SERIAL_JTAG_TAG, "size should be larger than 0"); ESP_RETURN_ON_FALSE(src && size, 0, USB_SERIAL_JTAG_TAG, "invalid buffer or size");
ESP_RETURN_ON_FALSE(src != NULL, ESP_ERR_INVALID_ARG, USB_SERIAL_JTAG_TAG, "Invalid buffer pointer."); ESP_RETURN_ON_FALSE(p_usb_serial_jtag_obj != NULL, 0, USB_SERIAL_JTAG_TAG, "driver is not initialized yet");
ESP_RETURN_ON_FALSE(p_usb_serial_jtag_obj != NULL, ESP_ERR_INVALID_ARG, USB_SERIAL_JTAG_TAG, "The driver hasn't been initialized");
const uint8_t *buff = (const uint8_t *)src; const uint8_t *buff = (const uint8_t *)src;
// Blocking method, Sending data to ringbuffer, and handle the data in ISR. // Blocking method, Sending data to ringbuffer, and handle the data in ISR.