A simple way to do ".h" file is xxd
It's my 2h.sh
Code: Select all
#!/bin/bash
xxd -i $1 |\
sed "s/unsigned/const/"|\
sed "s/\[\] \=/[] PROGMEM =/"
Code: Select all
2h.sh dist/minipage.html
Code: Select all
const char dist_minipage_html[] PROGMEM = {
0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x20,
0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x76, 0x69, 0x65, 0x77, 0x70, 0x6f,
0x72, 0x74, 0x22, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x3d,
...
0x32, 0x5d, 0x29, 0x3b, 0x3c, 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x3e
};
const int dist_minipage_html_len = 5137;
!!! There is a feature. In the end of the const char dist_minipage_html [] no 0x00.