diff --git a/bitread.py b/bitread.py index edd6458..4a57f33 100644 --- a/bitread.py +++ b/bitread.py @@ -145,16 +145,37 @@ def find_config_packet(bitfile): if bits_to_int(parse_word(bitfile)) == SYNC_WORD: sync_word_found = True - in_config_data = False + in_config_data = False + type_2_fdri_write = False + packet_2_length = None + # Search for the start of the type 2 packet, which is where the configuration frames are while not in_config_data: - word = parse_word(bitfile) + word = parse_word(bitfile) # If type 2 packet header found, leave loop - if word[-3:] == [0, 1, 0]: + if word[-3:] == [0, 1, 0] and type_2_fdri_write: + packet_2_length = sum([b<