File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,10 @@ use core::{
5
5
task:: { Context , Poll } ,
6
6
} ;
7
7
8
- use atomic_waker:: AtomicWaker ;
9
8
use embedded_hal:: spi:: ErrorType ;
10
9
use embedded_hal_async:: spi:: SpiBus ;
10
+ use futures_util:: join;
11
+ use futures_util:: task:: AtomicWaker ;
11
12
12
13
use crate :: gpdma:: {
13
14
config:: DmaConfig ,
@@ -104,9 +105,7 @@ where
104
105
result : Result < ( ) , DmaError > ,
105
106
) -> Result < ( ) , Error > {
106
107
let result = match result {
107
- Ok ( _) => {
108
- SpiDmaFuture :: new ( self ) . await
109
- }
108
+ Ok ( _) => SpiDmaFuture :: new ( self ) . await ,
110
109
Err ( error) => {
111
110
self . abort_transaction ( ) ;
112
111
Err ( Error :: DmaError ( error) )
@@ -319,7 +318,8 @@ where
319
318
) -> Result < ( ) , Error > {
320
319
let ( tx, rx) = self . start_dma_duplex_transfer ( read, write) ?;
321
320
let ( tx, rx) = ( tx. to_async ( ) , rx. to_async ( ) ) ;
322
- let result = tx. await . and ( rx. await ) ;
321
+ let results = join ! ( tx, rx) ;
322
+ let result = results. 0 . and ( results. 1 ) ;
323
323
324
324
self . finish_transfer_async ( result) . await
325
325
}
You can’t perform that action at this time.
0 commit comments