mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-09 09:23:39 +00:00
flash/drivers: fix EraseBlocks method which is erasing sectors instead
This commit is contained in:
committed by
Ron Evans
parent
e77e9249cd
commit
23776bf906
+1
-2
@@ -290,9 +290,8 @@ func (dev *Device) EraseBlockSize() 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 (dev *Device) EraseBlocks(start, len int64) error {
|
func (dev *Device) EraseBlocks(start, len int64) error {
|
||||||
// TODO: maybe combine sector erase operations into block erase operations
|
|
||||||
for i := start; i < start+len; i++ {
|
for i := start; i < start+len; i++ {
|
||||||
if err := dev.EraseSector(uint32(i)); err != nil {
|
if err := dev.EraseBlock(uint32(i)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user