Skip to content

Commit f71f397

Browse files
committed
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
1 parent 4997a09 commit f71f397

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

extras/Readme

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
ehg.c (ehg.exe): Tool to generate C-code array from file' bytes
2-
Based on https://github.com/TheLivingOne/bin2array/ and compiled on TynyCC
2+
Based on https://github.com/TheLivingOne/bin2array/ and compiled with TynyCC
33

4-
rehg.c (rehg.exe): Tool to generate C-code array from file' bytes
5-
Based on https://github.com/birkett/cbintools/tree/master/bin2c and compiled on TynyCC
4+
rehg.c (rehg.exe): Tool to reverse C-code array generated by ehg.exe back to a file
5+
Based on https://github.com/birkett/cbintools/tree/master/c2bin and compiled with TynyCC
66

77
Tools used (on Win 10):
88

extras/rehg.c

+3-6
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424

2525
/*
2626
* rehg.c (rehg.exe): Tool to reverse C-code array to file converted by ehg.exe
27-
* Based on https://github.com/birkett/cbintools/tree/master/bin2c
27+
* Based on https://github.com/birkett/cbintools/tree/master/c2bin
2828
* and compiled with TynyCC https://bellard.org/tcc/
2929
*/
3030

3131
#include <stdio.h>
3232
#include <stdlib.h>
3333
#include <string.h>
3434

35-
#define BUFFER_SIZE 80
35+
#define BUFFER_SIZE 500
3636

3737
int main(int argc, char *argv[])
3838
{
@@ -92,10 +92,7 @@ int main(int argc, char *argv[])
9292
pch = strtok(sBuffer, ",");
9393
while (pch != NULL)
9494
{
95-
// Use atoi() to convert from decimal to a char.
96-
//fprintf(outputFile, "%c", atoi(pch)); // decimal
97-
fprintf(outputFile, "%c", strtol(pch, NULL, 16)); // hex
98-
//printf("%s\n", pch);
95+
fprintf(outputFile, "%c", strtol(pch, NULL, 0)); // autodetect
9996
pch = strtok(NULL, ",");
10097
}
10198
}

extras/rehg.exe

0 Bytes
Binary file not shown.

src/edit.htm.gz.h

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

0 commit comments

Comments
 (0)