mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(usb_serial_jtag): Fix usb_serial_jtag wrong return value, vfs lose data randomly,
Closes https://github.com/espressif/esp-idf/issues/12119, Closes https://github.com/espressif/esp-idf/pull/11344, Closes https://github.com/espressif/esp-idf/issues/9318 Closes https://github.com/espressif/esp-idf/issues/11192
This commit is contained in:
parent
7a32d72409
commit
69d283b9ae
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -163,10 +163,10 @@ int usb_serial_jtag_write_bytes(const void* src, size_t size, TickType_t ticks_t
|
||||
|
||||
const uint8_t *buff = (const uint8_t *)src;
|
||||
// Blocking method, Sending data to ringbuffer, and handle the data in ISR.
|
||||
xRingbufferSend(p_usb_serial_jtag_obj->tx_ring_buf, (void*) (buff), size, ticks_to_wait);
|
||||
BaseType_t result = xRingbufferSend(p_usb_serial_jtag_obj->tx_ring_buf, (void*) (buff), size, ticks_to_wait);
|
||||
// Now trigger the ISR to read data from the ring buffer.
|
||||
usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY);
|
||||
return size;
|
||||
usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY);
|
||||
return (result == pdFALSE) ? 0 : size;
|
||||
}
|
||||
|
||||
esp_err_t usb_serial_jtag_driver_uninstall(void)
|
||||
|
Loading…
Reference in New Issue
Block a user