@@ -1555,7 +1555,10 @@ impl Hardware {
15551555 let spi = sdcard:: FakeSpi ( self , true ) ;
15561556 let cs = sdcard:: FakeCs ( ) ;
15571557 let delayer = sdcard:: FakeDelayer ( ) ;
1558- let options = embedded_sdmmc:: sdcard:: AcquireOpts { use_crc : true } ;
1558+ let options = embedded_sdmmc:: sdcard:: AcquireOpts {
1559+ use_crc : true ,
1560+ acquire_retries : 5 ,
1561+ } ;
15591562 let sdcard = embedded_sdmmc:: SdCard :: new_with_options ( spi, cs, delayer, options) ;
15601563 // Talk to the card to trigger a scan if its type
15611564 let num_blocks = sdcard. num_blocks ( ) ;
@@ -2359,12 +2362,13 @@ pub extern "C" fn block_write(
23592362
23602363/// Read one or more sectors to a block device.
23612364///
2362- /// The function will block until all data is read. The array pointed
2363- /// to by `data` must be `num_blocks * block_size` in length, where
2364- /// `block_size` is given by `block_dev_get_info`.
2365+ /// The function will block until all data is read. The array pointed to by
2366+ /// `data` must be `num_blocks * block_size` in length, where `block_size` is
2367+ /// given by `block_dev_get_info`.
23652368///
2366- /// There are no requirements on the alignment of `data` but if it is
2367- /// aligned, the BIOS may be able to use a higher-performance code path.
2369+ /// The API docs say there are no requirements on the alignment of `data` but we
2370+ /// unsafely transmute it into a `[embedded_sdmmc::Block]` so it should match
2371+ /// whatever that needs.
23682372pub extern "C" fn block_read (
23692373 device : u8 ,
23702374 block : common:: block_dev:: BlockIdx ,
@@ -2391,7 +2395,10 @@ pub extern "C" fn block_read(
23912395 let spi = sdcard:: FakeSpi ( hw, false ) ;
23922396 let cs = sdcard:: FakeCs ( ) ;
23932397 let delayer = sdcard:: FakeDelayer ( ) ;
2394- let options = embedded_sdmmc:: sdcard:: AcquireOpts { use_crc : true } ;
2398+ let options = embedded_sdmmc:: sdcard:: AcquireOpts {
2399+ use_crc : true ,
2400+ acquire_retries : 5 ,
2401+ } ;
23952402 let sdcard = embedded_sdmmc:: SdCard :: new_with_options ( spi, cs, delayer, options) ;
23962403 unsafe {
23972404 sdcard. mark_card_as_init ( info. card_type ) ;
0 commit comments