diff --git a/tests/psoc6/hw_ext/multi_blocking/i2s_rx.py b/tests/psoc6/hw_ext/multi_blocking/i2s_rx.py index 554617a1f8c09..75c40a5a6fed0 100644 --- a/tests/psoc6/hw_ext/multi_blocking/i2s_rx.py +++ b/tests/psoc6/hw_ext/multi_blocking/i2s_rx.py @@ -104,7 +104,30 @@ def print_i2s_format(raw_buf, bits): print(s_tuple) -print_i2s_format(rx_buf, 16) +# print_i2s_format(rx_buf, 16) + + +def make_expected_sequence(): + len = 0xFF + expected_frame = bytearray(len) + for i in range(len): + expected_frame[i] = i + + return expected_frame + + +def find_sublist_in_list(full_list, sublist): + for i in range(len(full_list) - len(sublist) - 1): + if full_list[i : i + len(sublist)] == sublist: + return True + + return False + + +exp_seq = make_expected_sequence() + +print("Frame sequence detected : ", find_sublist_in_list(rx_buf, exp_seq)) + # rx_ascii = binascii.hexlify(rx_buf) # print(f'rx_buf = {rx_ascii}')