Skip to content

Commit

Permalink
Correct calculation of the erase sector size
Browse files Browse the repository at this point in the history
The specification states that the real value is obtained by increasing
by one the value extracted from the csd register.
  • Loading branch information
LemonBoy committed Aug 13, 2017
1 parent 2d24758 commit f3be7cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SDBlockDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ uint32_t SDBlockDevice::_sd_sectors() {
_erase_size = BLOCK_SIZE_HC;
} else {
// ERASE_BLK_EN = 1: Erase in multiple of SECTOR_SIZE supported
_erase_size = ext_bits(csd, 45, 39);
_erase_size = ext_bits(csd, 45, 39) + 1;
}
break;

Expand Down

0 comments on commit f3be7cb

Please sign in to comment.