File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,7 @@ use crate::target::TWIM1;
1818
1919use crate :: {
2020 gpio:: { Floating , Input , Pin } ,
21- slice_in_ram_or,
22- slice_in_ram,
21+ slice_in_ram, slice_in_ram_or,
2322 target_constants:: { EASY_DMA_SIZE , FORCE_COPY_BUFFER_SIZE } ,
2423} ;
2524
@@ -349,10 +348,9 @@ where
349348 type Error = Error ;
350349
351350 fn write < ' w > ( & mut self , addr : u8 , bytes : & ' w [ u8 ] ) -> Result < ( ) , Error > {
352- if slice_in_ram ( bytes) {
351+ if slice_in_ram ( bytes) {
353352 self . write ( addr, bytes)
354- }
355- else {
353+ } else {
356354 let buf = & mut [ 0 ; FORCE_COPY_BUFFER_SIZE ] [ ..] ;
357355 for chunk in bytes. chunks ( FORCE_COPY_BUFFER_SIZE ) {
358356 buf[ ..chunk. len ( ) ] . copy_from_slice ( chunk) ;
@@ -386,7 +384,7 @@ where
386384 bytes : & ' w [ u8 ] ,
387385 buffer : & ' w mut [ u8 ] ,
388386 ) -> Result < ( ) , Error > {
389- if slice_in_ram ( bytes) {
387+ if slice_in_ram ( bytes) {
390388 self . write_then_read ( addr, bytes, buffer)
391389 } else {
392390 let txi = bytes. chunks ( FORCE_COPY_BUFFER_SIZE ) ;
You can’t perform that action at this time.
0 commit comments