[riot-notifications] [RIOT-OS/RIOT] cpu/efm32/uart: fix handling of RX when no RX callback is configured (#12278)

Thomas Stilwell notifications at github.com
Fri Sep 20 04:58:44 CEST 2019

### Contribution description
This fixes a crash that happens on efm32 when the UART receives a character while no UART RX callback is configured.

The first commit is adequate to avoid the crash but the next commits do some refactoring to make the rest of the driver consistent with the use case where no RX callback is configured.

### Testing procedure
1) Flash any example with a shell and confirm that UART still works as intended.
1) Flash the `hello-world` example (it has no shell) and confirm that typing UART characters causes no crash
1) Without this PR, the previous step causes a crash due to calling `rx_cb()` while `rx_cb == NULL`

You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * cpu/efm32/uart: fix crash on rx with no callback configured
  * cpu/efm32/uart: move reusable code into uart_poweron/off()
  * cpu/efm32/uart: don't enable rx if no callback is configured

-- File Changes --

    M cpu/efm32/periph/uart.c (75)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190919/b77faba7/attachment.htm>

More information about the notifications mailing list