File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ extern crate stm32g0xx_hal as hal;
7
7
8
8
use core:: fmt:: Write ;
9
9
10
- use hal:: dma:: { self , Channel , Target , Event } ;
10
+ use hal:: dma:: { self , Channel , Event , Target } ;
11
11
use hal:: prelude:: * ;
12
12
use hal:: serial:: * ;
13
13
use hal:: stm32;
@@ -59,12 +59,11 @@ fn main() -> ! {
59
59
tx. enable_dma ( ) ;
60
60
dma. ch1 . enable ( ) ;
61
61
62
-
63
62
// Create a second buffer to send after the first dma transfer has completed
64
63
let mut tx_buffer2: [ u8 ; 23 ] = * b"Transfer complete {0}!\n " ;
65
64
let tx_dma_buf_addr: u32 = tx_buffer2. as_ptr ( ) as u32 ;
66
65
67
- let mut delay = dp. TIM1 . delay ( & mut rcc) ;
66
+ let mut delay = dp. TIM1 . delay ( & mut rcc) ;
68
67
69
68
loop {
70
69
if dma. ch1 . event_occurred ( Event :: TransferComplete ) {
@@ -82,7 +81,6 @@ fn main() -> ! {
82
81
83
82
led. toggle ( ) . unwrap ( ) ;
84
83
85
-
86
84
dma. ch1 . set_memory_address ( tx_dma_buf_addr, true ) ;
87
85
dma. ch1 . set_transfer_length ( tx_buffer2. len ( ) as u16 ) ;
88
86
dma. ch1 . enable ( ) ;
You can’t perform that action at this time.
0 commit comments