Skip to content

Commit 8b8c083

Browse files
committed
drivers/sdcard: Change driver to use new block-device protocol.
1 parent 34b2f6b commit 8b8c083

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/sdcard/sdcard.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,6 @@ def write_token(self, token):
223223
self.cs(1)
224224
self.spi.write(b'\xff')
225225

226-
def count(self):
227-
return self.sectors
228-
229226
def readblocks(self, block_num, buf):
230227
nblocks = len(buf) // 512
231228
assert nblocks and not len(buf) % 512, 'Buffer length is invalid'
@@ -270,3 +267,8 @@ def writeblocks(self, block_num, buf):
270267
offset += 512
271268
nblocks -= 1
272269
self.write_token(_TOKEN_STOP_TRAN)
270+
271+
def ioctl(self, op, arg):
272+
print('ioctl', op, arg)
273+
if op == 4: # get number of blocks
274+
return self.sectors

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy