Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UART driver install #2116

Merged
merged 1 commit into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions targets/ESP32/_common/WireProtocol_HAL_Interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,16 @@ bool WP_Initialise(COM_HANDLE port)

ASSERT(WP_Port <= SOC_UART_NUM);

uart_config_t uart_config = {
// baudrate
.baud_rate = TARGET_SERIAL_BAUDRATE,
// baudrate
.data_bits = UART_DATA_8_BITS,
// parity mode
.parity = UART_PARITY_DISABLE,
// stop bit mode
.stop_bits = UART_STOP_BITS_1,
// hardware flow control(cts/rts)
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE
};
uart_config_t uart_config = {// baudrate
.baud_rate = TARGET_SERIAL_BAUDRATE,
// baudrate
.data_bits = UART_DATA_8_BITS,
// parity mode
.parity = UART_PARITY_DISABLE,
// stop bit mode
.stop_bits = UART_STOP_BITS_1,
// hardware flow control(cts/rts)
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE};

uart_param_config(WP_Port, &uart_config);

Expand All @@ -70,7 +68,7 @@ bool WP_Initialise(COM_HANDLE port)
UART_PIN_NO_CHANGE);

// setup UART driver with UART queue
uart_driver_install(WP_Port, 256, 256, 0, NULL, 0);
uart_driver_install(WP_Port, 256, 256, 0, NULL, ESP_INTR_FLAG_IRAM);

WP_Port_Intitialised = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -833,12 +833,14 @@ HRESULT Library_sys_io_ser_native_System_IO_Ports_SerialPort::NativeInit___VOID(
// Install driver
esp_err = uart_driver_install(
uart_num,
UART_BUFER_SIZE, // rx_buffer_size,
0, // tx_buffer_size, not buffered
20, // queue_size
&(palUart->UartEventQueue), // QueueHandle_t *uart_queue ( none for now )
0 // intr_alloc_flags
);
// rx_buffer_size
UART_BUFER_SIZE,
// tx_buffer_size, not buffered
0,
// queue_size
20,
&(palUart->UartEventQueue),
ESP_INTR_FLAG_IRAM);
if (esp_err != ESP_OK)
{
ESP_LOGE(TAG, "Failed to install uart driver");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,16 @@ HRESULT Library_win_dev_serial_native_Windows_Devices_SerialCommunication_Serial
// Install driver
esp_err = uart_driver_install(
uart_num,
UART_BUFER_SIZE, // rx_buffer_size,
0, // tx_buffer_size, not buffered
20, // queue_size
&(palUart->UartEventQueue), // QueueHandle_t *uart_queue ( none for now )
0 // intr_alloc_flags
);
// rx_buffer_size,
UART_BUFER_SIZE,
// tx_buffer_size, not buffered
0,
// queue_size
20,
// QueueHandle_t *uart_queue ( none for now )
&(palUart->UartEventQueue),

ESP_INTR_FLAG_IRAM);
if (esp_err != ESP_OK)
{
ESP_LOGE(TAG, "Failed to install uart driver");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ bool oneWireInit()
UART_PIN_NO_CHANGE,
UART_PIN_NO_CHANGE) != ESP_OK)
return false;
if (uart_driver_install(UartDriver, UART_FIFO_LEN * 2, 0, 0, NULL, 0) != ESP_OK)
if (uart_driver_install(UartDriver, UART_FIFO_LEN * 2, 0, 0, NULL, ESP_INTR_FLAG_IRAM) != ESP_OK)
return false;

#if (ONEWIRE_USE_MUTUAL_EXCLUSION == TRUE)
Expand Down