diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-11-30 22:39:18 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-11-30 22:39:18 +0000 |
| commit | 9500c8c17b7bace2dcdaadcbbd99ba62be46daa0 (patch) | |
| tree | 4430bea845de53e8551f3732844ebc74c666403a /examples/nrf/src/bin/uart.rs | |
| parent | e36e36dab6b19ae90c6f78b1cdd2233e295bd171 (diff) | |
| parent | 496ad4ed43ab3b0948553d371709771c010de565 (diff) | |
Merge #509
509: Remove unsafe from nRF uarte and improve doco with rationale r=Dirbaio a=huntc
The constructors themselves are not strictly unsafe. Interactions with DMA can be generally unsafe if a future is dropped, but that's a separate issue. It is important that we use the `unsafe` keyword diligently as it can lead to confusion otherwise.
I've also provided some rationale re. the usage of [Uarte] vs [BufferedUarte].
Co-authored-by: huntc <[email protected]>
Diffstat (limited to 'examples/nrf/src/bin/uart.rs')
| -rw-r--r-- | examples/nrf/src/bin/uart.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/nrf/src/bin/uart.rs b/examples/nrf/src/bin/uart.rs index 6b89e083d..208961c8b 100644 --- a/examples/nrf/src/bin/uart.rs +++ b/examples/nrf/src/bin/uart.rs | |||
| @@ -18,8 +18,7 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 18 | config.baudrate = uarte::Baudrate::BAUD115200; | 18 | config.baudrate = uarte::Baudrate::BAUD115200; |
| 19 | 19 | ||
| 20 | let irq = interrupt::take!(UARTE0_UART0); | 20 | let irq = interrupt::take!(UARTE0_UART0); |
| 21 | let mut uart = | 21 | let mut uart = uarte::Uarte::new(p.UARTE0, irq, p.P0_08, p.P0_06, NoPin, NoPin, config); |
| 22 | unsafe { uarte::Uarte::new(p.UARTE0, irq, p.P0_08, p.P0_06, NoPin, NoPin, config) }; | ||
| 23 | 22 | ||
| 24 | info!("uarte initialized!"); | 23 | info!("uarte initialized!"); |
| 25 | 24 | ||
