X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fmxc6225xu%2Fpd.py;h=962f963fa63e137cb976872978b5f51017f58d41;hb=d011c2e1fe2e4f0144a2c8e56d7feeda8520fd81;hp=c7b083063d6d687db7e3aab27ce92b4efd13c3f5;hpb=c761524941fcb2237ceb65082e504e5e48e62a05;p=libsigrokdecode.git diff --git a/decoders/mxc6225xu/pd.py b/decoders/mxc6225xu/pd.py index c7b0830..962f963 100644 --- a/decoders/mxc6225xu/pd.py +++ b/decoders/mxc6225xu/pd.py @@ -60,7 +60,7 @@ status = { } class Decoder(srd.Decoder): - api_version = 1 + api_version = 2 id = 'mxc6225xu' name = 'MXC6225XU' longname = 'MEMSIC MXC6225XU' @@ -97,7 +97,7 @@ class Decoder(srd.Decoder): # Bits[7:7]: INT int_val = (b >> 7) & 1 s = 'unchanged and no' if (int_val == 0) else 'changed or' - ann = 'INT = %d: Orientation %s shake event occured\n' % (int_val, s) + ann = 'INT = %d: Orientation %s shake event occurred\n' % (int_val, s) # Bits[6:5]: SH[1:0] sh = (((b >> 6) & 1) << 1) | ((b >> 5) & 1) @@ -165,7 +165,6 @@ class Decoder(srd.Decoder): if cmd != 'START': return self.state = 'GET SLAVE ADDR' - self.block_start_sample = ss elif self.state == 'GET SLAVE ADDR': # Wait for an address write operation. # TODO: We should only handle packets to the slave(?) @@ -213,6 +212,3 @@ class Decoder(srd.Decoder): self.state = 'IDLE' else: pass # TODO? - else: - raise Exception('Invalid state: %s' % self.state) -