diff options
| author | huntc <[email protected]> | 2021-12-01 09:14:24 +1100 |
|---|---|---|
| committer | huntc <[email protected]> | 2021-12-01 09:14:24 +1100 |
| commit | 469852c667cd7105d5eba7b197e1e2b5b9528d15 (patch) | |
| tree | c3a7b3e1d294ae129b38d11127dd88229fa0ed6e /examples/nrf/src/bin/uart.rs | |
| parent | e36e36dab6b19ae90c6f78b1cdd2233e295bd171 (diff) | |
Removed unsafe from uarte
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.
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 | ||
