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)