## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+## along with this program; if not, see <http://www.gnu.org/licenses/>.
##
import sigrokdecode as srd
op_ma = ((rdo >> 10) & 0x3ff) * 10
max_ma = (rdo & 0x3ff) * 10
flags = ''
- for f in RDO_FLAGS.keys():
+ for f in sorted(RDO_FLAGS.keys(), reverse = True):
if rdo & f:
flags += ' ' + RDO_FLAGS[f]
return '[%d]%d/%d mA%s' % (pos, op_ma, max_ma, flags)
else:
p = ''
flags = ''
- for f in PDO_FLAGS.keys():
+ for f in sorted(PDO_FLAGS.keys(), reverse = True):
if pdo & f:
flags += ' ' + PDO_FLAGS[f]
return '%s%s%s' % (PDO_TYPE[t], p, flags)
else:
p = ''
flags = ''
- for f in PDO_FLAGS.keys():
+ for f in sorted(PDO_FLAGS.keys(), reverse = True):
if pdo & f:
flags += ' ' + PDO_FLAGS[f]
return '%s%s%s' % (PDO_TYPE[t], p, flags)
for i in range(len(self.bits) - 19):
k = (self.get_sym(i, rec=False), self.get_sym(i+5, rec=False),
self.get_sym(i+10, rec=False), self.get_sym(i+15, rec=False))
- sym = START_OF_PACKETS[k] if k in START_OF_PACKETS else None
+ sym = START_OF_PACKETS.get(k, None)
if not sym:
sym = self.find_corrupted_sop(k)
# We have an interesting symbol sequence
return -1 # No Start Of Packet
def __init__(self):
+ self.reset()
+
+ def reset(self):
self.samplerate = None
self.idx = 0
self.packet_seq = 0