mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-18 05:33:58 +00:00
sd: backtrack on EraseSectors, stick to block nomenclature
This commit is contained in:
+3
-3
@@ -22,8 +22,8 @@ type Card interface {
|
|||||||
// ReadBlocks reads the given number of blocks from the card, starting at the given block index.
|
// 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.
|
// The dst buffer must be a multiple of the block size.
|
||||||
ReadBlocks(dst []byte, startBlockIdx int64) (int, error)
|
ReadBlocks(dst []byte, startBlockIdx int64) (int, error)
|
||||||
// EraseSectors erases sectors starting at startSectorIdx to startSectorIdx+numSectors.
|
// EraseBlocks erases blocks starting at startBlockIdx to startBlockIdx+numBlocks.
|
||||||
EraseSectors(startSectorIdx, numSectors int64) error
|
EraseBlocks(startBlock, numBlocks int64) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBlockDevice creates a new BlockDevice from a Card.
|
// 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
|
// supports this. The start and len parameters are in block numbers, use
|
||||||
// EraseBlockSize to map addresses to blocks.
|
// EraseBlockSize to map addresses to blocks.
|
||||||
func (bd *BlockDevice) EraseBlocks(startEraseBlockIdx, len int64) error {
|
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
|
// EraseBlockSize returns the smallest erasable area on this particular chip
|
||||||
|
|||||||
+1
-1
@@ -267,7 +267,7 @@ func (d *SPICard) ReadBlocks(dst []byte, startBlockIdx int64) (int, error) {
|
|||||||
panic("unreachable numblocks<=0")
|
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")
|
return errors.New("sd:erase not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user