forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mimxrt: Fix and complete UART.deinit() and uart_deinit_all().
The code did not check at deinit whether a UART was initialized. That did not matter for all MCU's except MIMXRT1176, which crashes at the second soft reset in a row. But since it is a general problem to use UART methods of a UART which has been deinitialized, checks were added to all applicable methods for a clear response instead of e.g. a crash. Deinitialize UART using software reset. It resets the UART but keeps it accessible for software, avoiding an exception when UART registers are accessed after a DeInit. Signed-off-by: robert-hh <robert@hammelrath.com>
- Loading branch information
Showing
1 changed file
with
15 additions
and
4 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