uart: fix threshold configuration loss when interrupts are disabled (IDFGH-17749)#18677
Open
AbanoubSalah wants to merge 1 commit into
Open
uart: fix threshold configuration loss when interrupts are disabled (IDFGH-17749)#18677AbanoubSalah wants to merge 1 commit into
AbanoubSalah wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Description: Fixes an asymmetric flaw in the UART driver where uart_set_rx_full_threshold and uart_set_tx_empty_threshold silently drop developer configuration updates and return ESP_OK if executed before the hardware interrupts are enabled.
Problem: Checking uart_hal_get_intr_ena_status inside setters prevents developer from setting-up initialization config. If a developer configures hardware thresholds before calling uart_driver_install or unmasking interrupts, the settings never reach HAL while the API reports ESP_OK. Meanwhile, uart_set_rx_timeout applies configurations unconditionally.
Solution: Refactored both functions to write directly to their respective HAL threshold registers unconditionally inside the critical section, aligning their architectural behavior with uart_set_rx_timeout.
Related
Fixes issue #13116
Testing
It compiles perfectly with v6.1-dev
Checklist
Before submitting a Pull Request, please ensure the following: