]> sigrok.org Git - libsigrokdecode.git/commitdiff
sdcard_spi: Fix some abbreviations and names to match the spec.
authorUwe Hermann <redacted>
Mon, 15 Apr 2019 16:50:12 +0000 (18:50 +0200)
committerUwe Hermann <redacted>
Mon, 15 Apr 2019 17:14:02 +0000 (19:14 +0200)
The official abbreviation for CMD24 in the spec is "WRITE_BLOCK", as
opposed to "WRITE_MULTIPLE_BLOCK" for CMD25 (chapter 4.7.4,
"Detailed Command Description", table 4-24).

The byte preceeding e.g. the CMD24 block data is called "Start Block" token
(chapter 7.3.3.2, "Start Block Tokens and Stop Tran Token"). We don't
include the "token" itself for consistency, since the decoder doesn't do
that for any other tokens either.

decoders/sdcard_spi/pd.py

index 6b5486d32b492ca425831e20717b9b9e1f476374..5054d9e9d0f2adf4dd4c0eca2e1444cd249e72e8 100644 (file)
@@ -227,7 +227,7 @@ class Decoder(srd.Decoder):
         self.state = 'GET RESPONSE R1'
 
     def handle_cmd24(self):
         self.state = 'GET RESPONSE R1'
 
     def handle_cmd24(self):
-        # CMD24: WRITE_SINGLE_BLOCK
+        # CMD24: WRITE_BLOCK
         self.putc(24, 'Write a block to address 0x%04x' % self.arg)
         self.is_cmd24 = True
         self.state = 'GET RESPONSE R1'
         self.putc(24, 'Write a block to address 0x%04x' % self.arg)
         self.is_cmd24 = True
         self.state = 'GET RESPONSE R1'
@@ -378,7 +378,7 @@ class Decoder(srd.Decoder):
             self.read_buf = []
             self.state = 'DATA RESPONSE'
         elif mosi == 0xfe:
             self.read_buf = []
             self.state = 'DATA RESPONSE'
         elif mosi == 0xfe:
-            self.put(self.ss, self.es, self.out_ann, [24, ['Data Start Token']])
+            self.put(self.ss, self.es, self.out_ann, [24, ['Start Block']])
             self.cmd24_start_token_found = True
 
     def handle_data_response(self, miso):
             self.cmd24_start_token_found = True
 
     def handle_data_response(self, miso):