forked from atomvm/AtomVM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix concurrency issues and error handling in ESP32 UART driver
Fixes possible concurrency problems by using a mutex for access to `reader_process_pid` and `reader_ref_ticks` in `uart_data`. Avoid possible overflow of the queue by handling all mesages in the interrupt callback. Now cleans up and returns errors, with improved log messages when initalization fails with a badarg in the configuration parameters, rather than aborting. Fixes incorrect pin integers being cast to terms. Pin numbers are validated for the chip the VM is compiled for before use to mitigate VM crashes from bad input parameters. Signed-off-by: Winford <[email protected]>
- Loading branch information
1 parent
7b1688d
commit 518d18e
Showing
2 changed files
with
111 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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