Skip to content

Commit dcefc44

Browse files
committed
Add EEPROM image generator
1 parent ad4e8c5 commit dcefc44

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

eepromgen.c

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#include <stdio.h>
2+
#include <stddef.h>
3+
#include <assert.h>
4+
5+
/* Bunnies eeprom */
6+
static const unsigned char default_eeprom[] = {
7+
0xe3, 0x1c, 0x5c, 0x23, 0x6a, 0x58, 0x68, 0x37,
8+
0xb7, 0x12, 0x26, 0x6c, 0x99, 0x11, 0x30, 0xd1,
9+
0xe2, 0x3e, 0x4d, 0x56, 0xf7, 0x73, 0x2b, 0x73,
10+
0x85, 0xfe, 0x7f, 0x0a, 0x08, 0xef, 0x15, 0x3c,
11+
0x77, 0xee, 0x6d, 0x4e, 0x93, 0x2f, 0x28, 0xee,
12+
0xf8, 0x61, 0xf7, 0x94, 0x17, 0x1f, 0xfc, 0x11,
13+
0x0b, 0x84, 0x44, 0xed, 0x31, 0x30, 0x35, 0x35,
14+
0x38, 0x31, 0x31, 0x31, 0x34, 0x30, 0x30, 0x33,
15+
0x00, 0x50, 0xf2, 0x4f, 0x65, 0x52, 0x00, 0x00,
16+
0x0a, 0x1e, 0x35, 0x33, 0x71, 0x85, 0x31, 0x4d,
17+
0x59, 0x12, 0x38, 0x48, 0x1c, 0x91, 0x53, 0x60,
18+
0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
19+
0x75, 0x61, 0x57, 0xfb, 0x2c, 0x01, 0x00, 0x00,
20+
0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00,
21+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
22+
0x0a, 0x05, 0x00, 0x02, 0x04, 0x01, 0x00, 0x02,
23+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
24+
0x00, 0x00, 0x00, 0x00, 0xc4, 0xff, 0xff, 0xff,
25+
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
26+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
27+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
28+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
29+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
30+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
31+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
32+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
33+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
34+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
35+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
36+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
37+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
38+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
39+
};
40+
41+
int main() {
42+
const char* path = "eeprom.bin";
43+
FILE* eepromFile = fopen(path, "wb");
44+
if (eepromFile) {
45+
assert(fwrite(default_eeprom, 1, 256, eepromFile) == 256);
46+
fclose(eepromFile);
47+
} else {
48+
fprintf(stderr, "Creating %s failed!\n", path);
49+
return 1;
50+
}
51+
return 0;
52+
}

0 commit comments

Comments
 (0)