From 62f51445b61479f95c213825ea1f83ec2e8d7848 Mon Sep 17 00:00:00 2001 From: soypat Date: Tue, 23 Jan 2024 20:38:30 -0300 Subject: [PATCH] fix examples/sd/main.go --- examples/sd/main.go | 3 +-- sd/definitions.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/sd/main.go b/examples/sd/main.go index e80a3c2..706f50c 100644 --- a/examples/sd/main.go +++ b/examples/sd/main.go @@ -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()) } diff --git a/sd/definitions.go b/sd/definitions.go index c5df570..f58d3ed 100644 --- a/sd/definitions.go +++ b/sd/definitions.go @@ -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