fix examples/sd/main.go

This commit is contained in:
soypat
2024-01-23 20:38:30 -03:00
parent 37ae0ad5b8
commit 62f51445b6
2 changed files with 2 additions and 3 deletions
+1 -2
View File
@@ -48,8 +48,7 @@ func main() {
cid := sdcard.CID()
fmt.Printf("name=%s\ncsd=\n%s\n", cid.ProductName(), csd.String())
const placeholderEraseSectorSize = 512
bd, err := sd.NewBlockDevice(sdcard, int(csd.ReadBlockLen()), csd.NumberOfBlocks(), placeholderEraseSectorSize)
bd, err := sd.NewBlockDevice(sdcard, csd.ReadBlockLen(), csd.NumberOfBlocks())
if err != nil {
panic("block device creation:" + err.Error())
}
+1 -1
View File
@@ -154,7 +154,7 @@ func (c *CSD) CommandClasses() CommandClasses {
}
// ReadBlockLen returns the Max Read Data Block Length in bytes.
func (c *CSD) ReadBlockLen() int64 { return 1 << c.ReadBlockLenShift() }
func (c *CSD) ReadBlockLen() int { return 1 << c.ReadBlockLenShift() }
func (c *CSD) ReadBlockLenShift() uint8 { return c.data[5] & 0x0F }
// AllowsReadBlockPartial should always return true. Indicates that