/* uzlib_inflate does a stream inflate on an RFC 1951 encoded data stream. It uses three application-specific CBs passed in the call to do the work: */
static uint8_t get_byte(void)
/* uzlib_inflate does a stream inflate on an RFC 1951 encoded data stream. It uses three application-specific CBs passed in the call to do the work: */
static uint8_t get_byte(void)
{
    int remaining = in->len - in->bytesRead;
    int wanted    = remaining >= READ_BLOCKSIZE ? READ_BLOCKSIZE : remaining;
    if (vfs_read(in->fd, in->block, wanted) != wanted)
      flash_error("read error on LFS image file");
    system_soft_wdt_feed();
    in->bytesRead += wanted;
    in->inPtr      = in->block;
    in->left       = wanted-1;
  }
  return *in->inPtr++;
}