Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
435 B

  1. #!/bin/python
  2. import binascii
  3. import string
  4. source = 'espurna/data/index.html.gz'
  5. destination = 'espurna/config/data.h'
  6. with open(source, 'rb') as f:
  7. content = f.read()
  8. array = map(lambda x: '0x%02x' % ord(x), content)
  9. with open(destination, 'w') as f:
  10. f.write("#define index_html_gz_len %d\n" % len(array))
  11. f.write("const uint8_t index_html_gz[] PROGMEM = {")
  12. f.write(string.join(array, ','))
  13. f.write("};\n")