File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,13 @@ where
237237 return Err ( Error :: WriteError ) ;
238238 }
239239 } else {
240+ // > It is recommended using this command preceding CMD25, some of the cards will be faster for Multiple
241+ // > Write Blocks operation. Note that the host should send ACMD23 just before WRITE command if the host
242+ // > wants to use the pre-erased feature
243+ s. card_acmd ( ACMD23 , blocks. len ( ) as u32 ) ?;
244+ // wait for card to be ready before sending the next command
245+ s. wait_not_busy ( Delay :: new_write ( ) ) ?;
246+
240247 // Start a multi-block write
241248 s. card_command ( CMD25 , start_idx) ?;
242249 for block in blocks. iter ( ) {
Original file line number Diff line number Diff line change @@ -60,6 +60,12 @@ pub const CMD55: u8 = 0x37;
6060pub const CMD58 : u8 = 0x3A ;
6161/// CRC_ON_OFF - enable or disable CRC checking
6262pub const CMD59 : u8 = 0x3B ;
63+ /// Pre-erased before writing
64+ ///
65+ /// > It is recommended using this command preceding CMD25, some of the cards will be faster for Multiple
66+ /// > Write Blocks operation. Note that the host should send ACMD23 just before WRITE command if the host
67+ /// > wants to use the pre-erased feature
68+ pub const ACMD23 : u8 = 0x17 ;
6369/// SD_SEND_OP_COMD - Sends host capacity support information and activates
6470/// the card's initialization process
6571pub const ACMD41 : u8 = 0x29 ;
You can’t perform that action at this time.
0 commit comments