summaryrefslogtreecommitdiff
path: root/decoders/onewire_network
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2014-10-13 17:05:07 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2014-10-13 17:07:14 +0200
commit486b19ce017c6663be6574dacd0c823304903bca (patch)
tree3c447933be4e4793cc0c26993cf294f3575ef4cd /decoders/onewire_network
parent95d11271b46a46788d497481d03177e883c8554e (diff)
downloadlibsigrokdecode-486b19ce017c6663be6574dacd0c823304903bca.tar.gz
libsigrokdecode-486b19ce017c6663be6574dacd0c823304903bca.zip
All PDs: More consistent names for ss/es variables.
Use self.ss/self.es, or if there's a need to differentiate them a bit more, use self.ss_<suffix>/self.es_<suffix> consistently. Also, drop some unused variables.
Diffstat (limited to 'decoders/onewire_network')
-rw-r--r--decoders/onewire_network/pd.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/decoders/onewire_network/pd.py b/decoders/onewire_network/pd.py
index 5c836c2..bddc4a8 100644
--- a/decoders/onewire_network/pd.py
+++ b/decoders/onewire_network/pd.py
@@ -46,8 +46,8 @@ class Decoder(srd.Decoder):
)
def __init__(self, **kwargs):
- self.beg = 0
- self.end = 0
+ self.ss_block = 0
+ self.es_block = 0
self.state = 'COMMAND'
self.bit_cnt = 0
self.search = 'P'
@@ -62,11 +62,11 @@ class Decoder(srd.Decoder):
def putx(self, data):
# Helper function for most annotations.
- self.put(self.beg, self.end, self.out_ann, data)
+ self.put(self.ss_block, self.es_block, self.out_ann, data)
def puty(self, data):
# Helper function for most protocol packets.
- self.put(self.beg, self.end, self.out_python, data)
+ self.put(self.ss_block, self.es_block, self.out_python, data)
def decode(self, ss, es, data):
code, val = data
@@ -131,13 +131,13 @@ class Decoder(srd.Decoder):
def onewire_collect(self, length, val, ss, es):
# Storing the sample this sequence begins with.
if self.bit_cnt == 1:
- self.beg = ss
+ self.ss_block = ss
self.data = self.data & ~(1 << self.bit_cnt) | (val << self.bit_cnt)
self.bit_cnt += 1
# Storing the sample this sequence ends with.
# In case the full length of the sequence is received, return 1.
if self.bit_cnt == length:
- self.end = es
+ self.es_block = es
self.data = self.data & ((1 << length) - 1)
self.bit_cnt = 0
return 1
@@ -148,7 +148,7 @@ class Decoder(srd.Decoder):
def onewire_search(self, length, val, ss, es):
# Storing the sample this sequence begins with.
if (self.bit_cnt == 0) and (self.search == 'P'):
- self.beg = ss
+ self.ss_block = ss
if self.search == 'P':
# Master receives an original address bit.
@@ -169,7 +169,7 @@ class Decoder(srd.Decoder):
# Storing the sample this sequence ends with.
# In case the full length of the sequence is received, return 1.
if self.bit_cnt == length:
- self.end = es
+ self.es_block = es
self.data_p = self.data_p & ((1 << length) - 1)
self.data_n = self.data_n & ((1 << length) - 1)
self.data = self.data & ((1 << length) - 1)