fix: lin protocol can't output

This commit is contained in:
dreamsourcelabTAI 2022-06-17 15:02:25 +08:00
parent b26c5cfeee
commit b0d811604b

View File

@ -90,6 +90,7 @@ class Decoder(srd.Decoder):
self.out_ann = None
self.ss_block = None
self.es_block = None
self.done_break = False
def start(self):
self.out_ann = self.register(srd.OUTPUT_ANN)
@ -124,7 +125,7 @@ class Decoder(srd.Decoder):
self.fsm.reset()
self.fsm.transit(LinFsm.State.Sync)
self.done_break = True
self.putx([1, ['Break condition', 'Break', 'Brk', 'B']])
def handle_sync(self, value):
@ -211,6 +212,10 @@ class Decoder(srd.Decoder):
return (p0 << 0) | (p1 << 1)
def end(self):
if self.done_break and len(self.lin_rsp):
self.handle_checksum();
def decode(self, ss, es, data):
ptype, rxtx, pdata = data