]> sigrok.org Git - libsigrokdecode.git/commitdiff
usb_power_delivery: Drop problematic exception in us2samples().
authorUwe Hermann <redacted>
Fri, 26 Aug 2016 06:59:07 +0000 (08:59 +0200)
committerUwe Hermann <redacted>
Fri, 26 Aug 2016 13:03:45 +0000 (15:03 +0200)
This causes an issue when running the sigrok-test test-cases, so drop
it for now (the same check already exists in decode()).

This fixes bug #758.

decoders/usb_power_delivery/pd.py

index c908e53e36f1351626b8158e6534bda4663fd5a9..48db41b1a2155741b2d13aa662f1039e9d1db568 100644 (file)
@@ -471,8 +471,6 @@ class Decoder(srd.Decoder):
         )
 
     def us2samples(self, us):
-        if not self.samplerate:
-            raise SamplerateError('Need the samplerate.')
         return int(us * self.samplerate / 1000000)
 
     def decode_packet(self):