@@ -53,7 +53,7 @@ def __init__(self, spi, cs, baudrate=1320000, crc16_function=None):
53
53
self .cs = cs
54
54
55
55
self .cmdbuf = bytearray (6 )
56
- self .cmdbuf5 = memoryview (self .cmdbuf )[:5 ] # for crc7 generation
56
+ self .cmdbuf5 = memoryview (self .cmdbuf )[:5 ] # for crc7 generation
57
57
self .tokenbuf = bytearray (1 )
58
58
self .crcbuf = bytearray (2 )
59
59
self .crc16 = None # during init
@@ -63,9 +63,7 @@ def __init__(self, spi, cs, baudrate=1320000, crc16_function=None):
63
63
64
64
def check_crcs (self , crc16_function ):
65
65
self .crc16 = crc16_function
66
- result = self .cmd (
67
- 59 , 1 if crc16_function else 0 , None , release = True
68
- ) # send CRC enable/disable command
66
+ result = self .cmd (59 , 1 if crc16_function else 0 , None , release = True ) # send CRC enable/disable command
69
67
70
68
def init_spi (self , baudrate ):
71
69
try :
@@ -125,9 +123,7 @@ def init_card(self, baudrate):
125
123
raise OSError (EIO , "no CSD response" )
126
124
csd = bytearray (16 )
127
125
self .readinto (csd )
128
- self .CSD = csd_int = int .from_bytes (
129
- csd , "big"
130
- ) # convert 16-byte CSD to a giant integer for bit extraction
126
+ self .CSD = csd_int = int .from_bytes (csd , "big" ) # convert 16-byte CSD to a giant integer for bit extraction
131
127
gb = self .gb # just for shorter code
132
128
# use bit numbers from SD card spec v9.0.0, table 5.3.2
133
129
vers = gb (csd_int , 126 , 127 )
0 commit comments