Skip to content

Commit eeaa6bd

Browse files
committed
rustfmt
1 parent 9ed96ae commit eeaa6bd

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

examples/uart-dma.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,21 @@ use stm32f4xx_hal::dma::{DmaFlag, PeripheralToMemory, Stream1};
88
use core::cell::RefCell;
99
use cortex_m::interrupt::Mutex;
1010
use cortex_m_rt::entry;
11-
use stm32f4xx_hal::pac::{interrupt, DMA1};
12-
use stm32f4xx_hal::pac::Interrupt;
13-
use stm32f4xx_hal::{dma::{StreamsTuple, Transfer}, pac, prelude::*, serial};
1411
use stm32f4xx_hal::dma::config::DmaConfig;
15-
use stm32f4xx_hal::uart::{Config, Rx, Serial};
12+
use stm32f4xx_hal::pac::Interrupt;
13+
use stm32f4xx_hal::pac::{interrupt, DMA1};
1614
use stm32f4xx_hal::uart::config::StopBits;
15+
use stm32f4xx_hal::uart::{Config, Rx, Serial};
16+
use stm32f4xx_hal::{
17+
dma::{StreamsTuple, Transfer},
18+
pac,
19+
prelude::*,
20+
serial,
21+
};
1722

1823
// uart buffer size
1924
const UART_BUFFER_SIZE: usize = 128;
2025

21-
2226
// Simple ring buffer
2327
pub struct Buffer {
2428
buffer: [u8; UART_BUFFER_SIZE],
@@ -144,7 +148,7 @@ fn main() -> ! {
144148
.dma(serial::config::DmaConfig::Rx),
145149
&clocks,
146150
)
147-
.unwrap();
151+
.unwrap();
148152

149153
// Note! It is better to use memory pools, such as heapless::pool::Pool. But it not work with embedded_dma yet.
150154
// See CHANGELOG of unreleased main branch and issue https://github.com/japaric/heapless/pull/362 for details.
@@ -179,7 +183,6 @@ fn main() -> ! {
179183

180184
cortex_m::interrupt::free(|cs| *G_TRANSFER.borrow(cs).borrow_mut() = Some(rx_transfer));
181185

182-
183186
// Enable interrupt
184187
unsafe {
185188
cortex_m::peripheral::NVIC::unmask(Interrupt::USART3);

0 commit comments

Comments
 (0)