summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--decoders/timing/pd.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/decoders/timing/pd.py b/decoders/timing/pd.py
index 19836b0..01e3b01 100644
--- a/decoders/timing/pd.py
+++ b/decoders/timing/pd.py
@@ -116,8 +116,9 @@ class Decoder(srd.Decoder):
# Report the timing normalized.
self.put(self.last_samplenum, self.samplenum, self.out_ann,
[0, [normalize_time(t)]])
- self.put(self.last_samplenum, self.samplenum, self.out_ann,
- [1, [normalize_time(sum(self.last_n) / len(self.last_n))]])
+ if self.options['avg_period'] > 0:
+ self.put(self.last_samplenum, self.samplenum, self.out_ann,
+ [1, [normalize_time(sum(self.last_n) / len(self.last_n))]])
# Store data for next round.
self.last_samplenum = self.samplenum