Added tool to help embedding htm file to code with one click

See in /extras
+ improvement of rehg.c / exe and typo corrections in Readme
This commit is contained in:
lorol
2020-04-01 12:33:56 -04:00
parent f0987eb9ae
commit 525a0f1e50
4 changed files with 7 additions and 10 deletions

View File

@@ -1,8 +1,8 @@
ehg.c (ehg.exe): Tool to generate C-code array from file' bytes
Based on https://github.com/TheLivingOne/bin2array/ and compiled on TynyCC
Based on https://github.com/TheLivingOne/bin2array/ and compiled with TynyCC
rehg.c (rehg.exe): Tool to generate C-code array from file' bytes
Based on https://github.com/birkett/cbintools/tree/master/bin2c and compiled on TynyCC
rehg.c (rehg.exe): Tool to reverse C-code array generated by ehg.exe back to a file
Based on https://github.com/birkett/cbintools/tree/master/c2bin and compiled with TynyCC
Tools used (on Win 10):

View File

@@ -24,7 +24,7 @@
/*
* rehg.c (rehg.exe): Tool to reverse C-code array to file converted by ehg.exe
* Based on https://github.com/birkett/cbintools/tree/master/bin2c
* Based on https://github.com/birkett/cbintools/tree/master/c2bin
* and compiled with TynyCC https://bellard.org/tcc/
*/
@@ -32,7 +32,7 @@
#include <stdlib.h>
#include <string.h>
#define BUFFER_SIZE 80
#define BUFFER_SIZE 500
int main(int argc, char *argv[])
{
@@ -92,10 +92,7 @@ int main(int argc, char *argv[])
pch = strtok(sBuffer, ",");
while (pch != NULL)
{
// Use atoi() to convert from decimal to a char.
//fprintf(outputFile, "%c", atoi(pch)); // decimal
fprintf(outputFile, "%c", strtol(pch, NULL, 16)); // hex
//printf("%s\n", pch);
fprintf(outputFile, "%c", strtol(pch, NULL, 0)); // autodetect
pch = strtok(NULL, ",");
}
}

Binary file not shown.

View File

@@ -1,6 +1,6 @@
#define edit_htm_gz_len 4314
const uint8_t edit_htm_gz[] PROGMEM = {
0x1F,0x8B,0x08,0x08,0x4B,0x0B,0x84,0x5E,0x02,0x00,0x65,0x64,0x69,0x74,0x2E,0x68,0x74,0x6D,0x00,0xB5,
0x1F,0x8B,0x08,0x08,0x30,0xC1,0x84,0x5E,0x02,0x00,0x65,0x64,0x69,0x74,0x2E,0x68,0x74,0x6D,0x00,0xB5,
0x1A,0x0B,0x5B,0xDB,0x36,0xF0,0xAF,0x18,0x6F,0x63,0xF6,0xE2,0x38,0x0E,0x50,0xD6,0x39,0x18,0x16,0x1E,
0x2B,0x7D,0x01,0x25,0x49,0x3B,0xCA,0xD8,0x3E,0xC5,0x56,0x12,0x15,0x5B,0xF6,0x2C,0x99,0x40,0xB3,0xFC,
0xF7,0x9D,0x24,0x3F,0x43,0xE8,0x1E,0xDF,0xD6,0x07,0x91,0x74,0xBA,0xD3,0xDD,0xE9,0x9E,0x0A,0x7B,0x1B,