MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / handle_data_byte

Method handle_data_byte

libsigrokdecode4DSL/decoders/sle44xx/pd.py:331–367  ·  view source on GitHub ↗

Accumulate CMD or OUT data bytes.

(self, ss, es, data, bits)

Source from the content-addressed store, hash-verified

329 self.proc_state['io1'] = True
330
331 def handle_data_byte(self, ss, es, data, bits):
332 '''Accumulate CMD or OUT data bytes.'''
333
334 if self.state == 'ATR':
335 if not self.atr_bytes:
336 self.atr_bytes = []
337 self.atr_bytes.append([data, ss, es, bits,])
338 if len(self.atr_bytes) == 4:
339 self.flush_queued()
340 return
341
342 if self.state == 'CMD':
343 if not self.cmd_bytes:
344 self.cmd_bytes = []
345 self.cmd_bytes.append([data, ss, es, bits,])
346 if len(self.cmd_bytes) == 3:
347 ctrl, addr, data = [c[0] for c in self.cmd_bytes]
348 texts, length, proc = self.command_check(ctrl, addr, data)
349 # Immediately emit the annotation to not lose the text,
350 # and to support zoom levels for this specific case.
351 ss, es = self.cmd_bytes[0][1], self.cmd_bytes[-1][2]
352 cls = Ann.CMD_DATA
353 self.putx(ss, es, cls, texts)
354 self.cmd_bytes = []
355 # Prepare to continue either at OUT or PROC after CMD.
356 self.out_len = length
357 self.cmd_proc = bool(proc)
358 self.state = None
359 return
360
361 if self.state == 'OUT':
362 if not self.out_bytes:
363 self.out_bytes = []
364 self.out_bytes.append([data, ss, es, bits,])
365 if self.out_len is not None and len(self.out_bytes) == self.out_len:
366 self.flush_queued()
367 return
368
369 def handle_data_bit(self, ss, es, bit):
370 '''Gather 8 bits of data (or track processing progress).'''

Callers 1

handle_data_bitMethod · 0.95

Calls 3

flush_queuedMethod · 0.95
command_checkMethod · 0.95
putxMethod · 0.95

Tested by

no test coverage detected