#!/usr/bin/env python. # Copyright (c) 2022 Espressif Systems (Shanghai) PTE LTD. # Distributed under the terms of Apache License v2.0 found in the top-level LICENSE file. import argparse import sys def bin2c_array(data, var_name='esp32_net_fw_array'): out = [] out.append('const unsigned char {var_name}[] = {{'.format(var_name=var_name)) l = [ data[i:i+12] for i in range(0, len(data), 12) ] for i, x in enumerate(l): line = ', '.join([ '0x{val:02x}'.format(val=c) for c in x ]) out.append(' {line}{end_comma}'.format(line=line, end_comma=',' if i