File tree 2 files changed +7
-4
lines changed 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
19
19
importing the ` nb ` crate directly in dependendent crates.
20
20
- ` blocking::Serial ` : renamed ` bwrite_all ` to ` write ` , ` bflush ` to `flush.
21
21
- Removed ` prelude ` to avoid method name conflicts between different flavors (blocking, nb) of the same trait. Traits must now be manually imported.
22
+ - Removed ` &[W] ` returned slice in ` spi::blocking::Transfer ` .
22
23
23
24
### Removed
24
25
- Removed random number generation (` rng ` ) traits in favor of [ rand_core] ( https://crates.io/crates/rand_core ) .
Original file line number Diff line number Diff line change @@ -5,8 +5,10 @@ pub trait Transfer<W> {
5
5
/// Error type
6
6
type Error ;
7
7
8
- /// Writes `words` to the slave. Returns the `words` received from the slave
9
- fn transfer < ' w > ( & mut self , words : & ' w mut [ W ] ) -> Result < & ' w [ W ] , Self :: Error > ;
8
+ /// Writes and reads simultaneously. The contents of `words` are
9
+ /// written to the slave, and the received words are stored into the same
10
+ /// `words` buffer, overwriting it.
11
+ fn transfer ( & mut self , words : & mut [ W ] ) -> Result < ( ) , Self :: Error > ;
10
12
}
11
13
12
14
/// Blocking write
@@ -42,13 +44,13 @@ pub mod transfer {
42
44
{
43
45
type Error = S :: Error ;
44
46
45
- fn transfer < ' w > ( & mut self , words : & ' w mut [ W ] ) -> Result < & ' w [ W ] , S :: Error > {
47
+ fn transfer ( & mut self , words : & mut [ W ] ) -> Result < ( ) , S :: Error > {
46
48
for word in words. iter_mut ( ) {
47
49
nb:: block!( self . write( word. clone( ) ) ) ?;
48
50
* word = nb:: block!( self . read( ) ) ?;
49
51
}
50
52
51
- Ok ( words )
53
+ Ok ( ( ) )
52
54
}
53
55
}
54
56
}
You can’t perform that action at this time.
0 commit comments