File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ sysfs_gpio = { version = "0.6.1", optional = true }
2929i2cdev = { version = " 0.6.0" , optional = true }
3030nb = " 1"
3131serialport = { version = " 4.2.0" , default-features = false }
32- spidev = { version = " 0.6.0 " , optional = true }
32+ spidev = { version = " 0.6.1 " , optional = true }
3333nix = " 0.27.1"
3434
3535[dev-dependencies ]
Original file line number Diff line number Diff line change @@ -173,9 +173,8 @@ mod embedded_hal_impl {
173173 }
174174
175175 fn transfer_in_place ( & mut self , words : & mut [ u8 ] ) -> Result < ( ) , Self :: Error > {
176- let tx = words. to_owned ( ) ;
177176 self . 0
178- . transfer ( & mut SpidevTransfer :: read_write ( & tx , words) )
177+ . transfer ( & mut SpidevTransfer :: read_write_in_place ( words) )
179178 . map_err ( |err| SPIError { err } )
180179 }
181180
@@ -214,11 +213,7 @@ mod embedded_hal_impl {
214213 }
215214 } ,
216215 SpiOperation :: TransferInPlace ( buf) => {
217- let tx = unsafe {
218- let p = buf. as_ptr ( ) ;
219- std:: slice:: from_raw_parts ( p, buf. len ( ) )
220- } ;
221- transfers. push ( SpidevTransfer :: read_write ( tx, buf) ) ;
216+ transfers. push ( SpidevTransfer :: read_write_in_place ( buf) ) ;
222217 }
223218 SpiOperation :: DelayNs ( ns) => {
224219 let us = {
You can’t perform that action at this time.
0 commit comments