kopia lustrzana https://github.com/espressif/esp-idf
usb_serial_jtag: enable blocking implementation on esp32s3
rodzic
f5266c1066
commit
24529a6aec
|
@ -58,6 +58,7 @@ if(${target} STREQUAL "esp32s3")
|
|||
"sdmmc_host.c"
|
||||
"sdmmc_transaction.c"
|
||||
"mcpwm.c"
|
||||
"usb_serial_jtag.c"
|
||||
"spi_slave_hd.c"
|
||||
"touch_sensor_common.c")
|
||||
endif()
|
||||
|
|
|
@ -67,20 +67,20 @@ static void usb_serial_jtag_isr_handler_default(void *arg) {
|
|||
// If the hardware fifo is avaliable, write in it. Otherwise, do nothing.
|
||||
if (queued_buff != NULL) { //Although tx_queued_bytes may be larger than 0. We may have interrupt before xRingbufferSend() was called.
|
||||
//Copy the queued buffer into the TX FIFO
|
||||
usb_serial_jtag_ll_clr_intr_sts_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY);
|
||||
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY);
|
||||
usb_serial_jtag_write_and_flush(queued_buff, queued_size);
|
||||
vRingbufferReturnItemFromISR(p_usb_serial_jtag_obj->tx_ring_buf, queued_buff, &xTaskWoken);
|
||||
usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY);
|
||||
}
|
||||
} else {
|
||||
usb_serial_jtag_ll_clr_intr_sts_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY);
|
||||
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
if (usbjtag_intr_status & USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT) {
|
||||
// read rx buffer(max length is 64), and send avaliable data to ringbuffer.
|
||||
// Ensure the rx buffer size is larger than RX_MAX_SIZE.
|
||||
usb_serial_jtag_ll_clr_intr_sts_mask(USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT);
|
||||
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT);
|
||||
uint32_t rx_fifo_len = usb_serial_jtag_ll_read_rxfifo(p_usb_serial_jtag_obj->rx_data_buf, USB_SER_JTAG_RX_MAX_SIZE);
|
||||
xRingbufferSendFromISR(p_usb_serial_jtag_obj->rx_ring_buf, p_usb_serial_jtag_obj->rx_data_buf, rx_fifo_len, &xTaskWoken);
|
||||
}
|
||||
|
@ -120,12 +120,12 @@ esp_err_t usb_serial_jtag_driver_install(usb_serial_jtag_driver_config_t *usb_se
|
|||
goto _exit;
|
||||
}
|
||||
|
||||
usb_serial_jtag_ll_clr_intr_sts_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY|
|
||||
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY|
|
||||
USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT);
|
||||
usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY|
|
||||
USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT);
|
||||
|
||||
err = esp_intr_alloc(ETS_USB_INTR_SOURCE, 0, usb_serial_jtag_isr_handler_default, NULL, &p_usb_serial_jtag_obj->intr_handle);
|
||||
err = esp_intr_alloc(ETS_USB_SERIAL_JTAG_INTR_SOURCE, 0, usb_serial_jtag_isr_handler_default, NULL, &p_usb_serial_jtag_obj->intr_handle);
|
||||
if (err != ESP_OK) {
|
||||
goto _exit;
|
||||
}
|
||||
|
|
|
@ -51,18 +51,6 @@ static inline void usb_serial_jtag_ll_ena_intr_mask(uint32_t mask)
|
|||
USB_SERIAL_JTAG.int_ena.val |= mask;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the USB_SERIAL_JTAG interrupt based on the given mask.
|
||||
*
|
||||
* @param mask The bitmap of the interrupts bits need to be cleared.
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static inline void usb_serial_jtag_ll_clr_intr_sts_mask(uint32_t mask)
|
||||
{
|
||||
USB_SERIAL_JTAG.int_clr.val = mask;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable the USB_SERIAL_JTAG interrupt based on the given mask.
|
||||
*
|
||||
|
|
|
@ -76,7 +76,7 @@ typedef enum {
|
|||
ETS_LEDC_INTR_SOURCE, /**< interrupt of LED PWM, level*/
|
||||
ETS_EFUSE_INTR_SOURCE, /**< interrupt of efuse, level, not likely to use*/
|
||||
ETS_TWAI_INTR_SOURCE, /**< interrupt of can, level*/
|
||||
ETS_USB_INTR_SOURCE, /**< interrupt of USB, level*/
|
||||
ETS_USB_SERIAL_JTAG_INTR_SOURCE, /**< interrupt of USB, level*/
|
||||
ETS_RTC_CORE_INTR_SOURCE, /**< interrupt of rtc core, level, include rtc watchdog*/
|
||||
ETS_RMT_INTR_SOURCE, /**< interrupt of remote controller, level*/
|
||||
ETS_I2C_EXT0_INTR_SOURCE, /**< interrupt of I2C controller1, level*/
|
||||
|
|
|
@ -154,7 +154,7 @@ typedef enum {
|
|||
ETS_BACKUP_PMS_VIOLATE_INTR_SOURCE,
|
||||
ETS_CACHE_CORE0_ACS_INTR_SOURCE,
|
||||
ETS_CACHE_CORE1_ACS_INTR_SOURCE,
|
||||
ETS_USB_DEVICE_INTR_SOURCE,
|
||||
ETS_USB_SERIAL_JTAG_INTR_SOURCE,
|
||||
ETS_PREI_BACKUP_INTR_SOURCE,
|
||||
ETS_DMA_EXTMEM_REJECT_SOURCE,
|
||||
ETS_MAX_INTR_SOURCE, /**< number of interrupt sources */
|
||||
|
|
Ładowanie…
Reference in New Issue