]> sigrok.org Git - libsigrokdecode.git/commitdiff
Fix bugs in "Invalid state" printing/exceptions.
authorUwe Hermann <redacted>
Wed, 21 Nov 2012 21:51:31 +0000 (22:51 +0100)
committerUwe Hermann <redacted>
Sat, 24 Nov 2012 19:21:20 +0000 (20:21 +0100)
decoders/dcf77/pd.py
decoders/i2c/pd.py
decoders/mlx90614/pd.py
decoders/mxc6225xu/pd.py
decoders/rtc8564/pd.py
decoders/uart/pd.py

index c4132e956689b24c98ff77cac5152f3732ff19ed..9b7c931b2ea41022458ce341fb3e24c819484696 100644 (file)
@@ -282,7 +282,7 @@ class Decoder(srd.Decoder):
                 self.state = 'WAIT FOR RISING EDGE'
 
             else:
-                raise Exception('Invalid state: %d' % self.state)
+                raise Exception('Invalid state: %s' % self.state)
 
             self.oldval = val
 
index 53321eb02c401525e78fc3bd59774117a1078589..40baf44e572e47f7fe8b1c5db66fdcec93da5d99 100644 (file)
@@ -232,7 +232,7 @@ class Decoder(srd.Decoder):
                 if self.is_data_bit(scl, sda):
                     self.get_ack(scl, sda)
             else:
-                raise Exception('Invalid state %d' % self.STATE)
+                raise Exception('Invalid state: %s' % self.state)
 
             # Save current SDA/SCL values for the next round.
             self.oldscl = scl
index 1ee88d78509bad088f36254e1c4ab5b778beb350..329f2b6a47c4d2701e0da90240c392852c38d6e7 100644 (file)
@@ -83,5 +83,5 @@ class Decoder(srd.Decoder):
                 self.state = 'IGNORE START REPEAT'
                 self.data = []
         else:
-            raise Exception('Invalid state: %d' % self.state)
+            raise Exception('Invalid state: %s' % self.state)
 
index 39564a957f1e4d0ea4557c9316f82060d2eae704..c139918d0654ab6d226ef783328853d648b15f47 100644 (file)
@@ -225,5 +225,5 @@ class Decoder(srd.Decoder):
             else:
                 pass # TODO?
         else:
-            raise Exception('Invalid state: %d' % self.state)
+            raise Exception('Invalid state: %s' % self.state)
 
index bf5d4b6c731bce2afc7cb3b58df858fd32401a9d..a2d8a1a2e601b29baf2c7c0581295f4a3117f5a5 100644 (file)
@@ -212,5 +212,5 @@ class Decoder(srd.Decoder):
             else:
                 pass # TODO?
         else:
-            raise Exception('Invalid state: %d' % self.state)
+            raise Exception('Invalid state: %s' % self.state)
 
index 24551da6d03e177854e289178173512fa8704b98..83552cee72c5766541372d06dd05fdbe610677c7 100644 (file)
@@ -297,7 +297,7 @@ class Decoder(srd.Decoder):
                 elif self.state[rxtx] == 'GET STOP BITS':
                     self.get_stop_bits(rxtx, signal)
                 else:
-                    raise Exception('Invalid state: %d' % self.state[rxtx])
+                    raise Exception('Invalid state: %s' % self.state[rxtx])
 
                 # Save current RX/TX values for the next round.
                 self.oldbit[rxtx] = signal