mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-04 06:57:48 +00:00
fix examples/sd/main.go
This commit is contained in:
+1
-2
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user