mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-25 19:03:35 +04:00
Correct typos in drivers/block/sdcard.rs
This commit is contained in:
parent
46900cc9af
commit
03151ac124
@ -317,14 +317,14 @@ impl</*'a,*/ X: SPI> SDCard</*'a,*/ X> {
|
|||||||
* Get SD card data response.
|
* Get SD card data response.
|
||||||
* @param None
|
* @param None
|
||||||
* @retval The SD status: Read data response xxx0<status>1
|
* @retval The SD status: Read data response xxx0<status>1
|
||||||
* - status 010: Data accecpted
|
* - status 010: Data accepted
|
||||||
* - status 101: Data rejected due to a crc error
|
* - status 101: Data rejected due to a crc error
|
||||||
* - status 110: Data rejected due to a Write error.
|
* - status 110: Data rejected due to a Write error.
|
||||||
* - status 111: Data rejected due to other error.
|
* - status 111: Data rejected due to other error.
|
||||||
*/
|
*/
|
||||||
fn get_dataresponse(&self) -> u8 {
|
fn get_dataresponse(&self) -> u8 {
|
||||||
let response = &mut [0u8];
|
let response = &mut [0u8];
|
||||||
/* Read resonse */
|
/* Read response */
|
||||||
self.read_data(response);
|
self.read_data(response);
|
||||||
/* Mask unused bits */
|
/* Mask unused bits */
|
||||||
response[0] &= 0x1F;
|
response[0] &= 0x1F;
|
||||||
@ -419,7 +419,7 @@ impl</*'a,*/ X: SPI> SDCard</*'a,*/ X> {
|
|||||||
/* Byte 15 */
|
/* Byte 15 */
|
||||||
CSD_CRC: (csd_tab[15] & 0xFE) >> 1,
|
CSD_CRC: (csd_tab[15] & 0xFE) >> 1,
|
||||||
Reserved4: 1,
|
Reserved4: 1,
|
||||||
/* Return the reponse */
|
/* Return the response */
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -750,4 +750,4 @@ impl BlockDevice for SDCardWrapper {
|
|||||||
fn write_block(&self, block_id: usize, buf: &[u8]) {
|
fn write_block(&self, block_id: usize, buf: &[u8]) {
|
||||||
self.0.lock().write_sector(buf,block_id as u32).unwrap();
|
self.0.lock().write_sector(buf,block_id as u32).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user