-
- Dbprintf("InflateInit returned %d", res);
- Dbprintf("fpga_image_ptr pointing at %02x %02x %02x %02x", fpga_image_ptr[0], fpga_image_ptr[1], fpga_image_ptr[2], fpga_image_ptr[3]);
- Dbprintf("zstream->next_in pointing at %02x %02x %02x %02x", compressed_fpga_stream->next_in[0], compressed_fpga_stream->next_in[1], compressed_fpga_stream->next_in[2], compressed_fpga_stream->next_in[3]);
-}
-
-
-bool reset_fpga_stream(int bitstream_version, z_streamp compressed_fpga_stream, uint8_t *output_buffer)
-{
- uint8_t header[FPGA_BITSTREAM_FIXED_HEADER_SIZE];
- uint8_t *fpga_image_start;
- uint32_t fpga_image_size;
-
- if (bitstream_version == FPGA_BITSTREAM_LF) {
- fpga_image_start = &_binary_fpga_lf_bit_start;
- fpga_image_size = (uint32_t)&_binary_fpga_lf_bit_end - (uint32_t)&_binary_fpga_lf_bit_start;
- } else if (bitstream_version == FPGA_BITSTREAM_HF) {
- fpga_image_start = &_binary_fpga_hf_bit_start;
- fpga_image_size = (uint32_t)&_binary_fpga_hf_bit_end - (uint32_t)&_binary_fpga_hf_bit_start;
- } else {
- return false;
- }
-
- init_fpga_inflate(compressed_fpga_stream, fpga_image_start, fpga_image_size, output_buffer);