sd: backtrack on EraseSectors, stick to block nomenclature

This commit is contained in:
soypat
2024-01-23 20:25:58 -03:00
parent e14fbf6d3d
commit 8de5ab7c64
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -22,8 +22,8 @@ type Card interface {
// ReadBlocks reads the given number of blocks from the card, starting at the given block index.
// The dst buffer must be a multiple of the block size.
ReadBlocks(dst []byte, startBlockIdx int64) (int, error)
// EraseSectors erases sectors starting at startSectorIdx to startSectorIdx+numSectors.
EraseSectors(startSectorIdx, numSectors int64) error
// EraseBlocks erases blocks starting at startBlockIdx to startBlockIdx+numBlocks.
EraseBlocks(startBlock, numBlocks int64) error
}
// NewBlockDevice creates a new BlockDevice from a Card.
@@ -167,7 +167,7 @@ func (bd *BlockDevice) BlockSize() int64 {
// supports this. The start and len parameters are in block numbers, use
// EraseBlockSize to map addresses to blocks.
func (bd *BlockDevice) EraseBlocks(startEraseBlockIdx, len int64) error {
return bd.card.EraseSectors(startEraseBlockIdx, len)
return bd.card.EraseBlocks(startEraseBlockIdx, len)
}
// EraseBlockSize returns the smallest erasable area on this particular chip
+1 -1
View File
@@ -267,7 +267,7 @@ func (d *SPICard) ReadBlocks(dst []byte, startBlockIdx int64) (int, error) {
panic("unreachable numblocks<=0")
}
func (d *SPICard) EraseSectors(startSector, numberSectors int64) error {
func (d *SPICard) EraseBlocks(startBlock, numberOfBlocks int64) error {
return errors.New("sd:erase not implemented")
}