annotate dhf/emit-dhfbin-efr.c @ 39:ab7c80f6f02d

ae-dec-dhf: initial generation
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 14 May 2024 08:13:01 +0000
parents 6bb1651f8c11
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
35
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This program emits a binary file containing one EFR DHF.
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 */
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 #include <stdio.h>
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #include <stdint.h>
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include <stdlib.h>
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 extern const uint8_t efr_dhf_bytes[31];
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 main(argc, argv)
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 char **argv;
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 {
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 FILE *outf;
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 if (argc != 2) {
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 fprintf(stderr, "usage: %s out-bin-file\n", argv[0]);
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 exit(1);
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 }
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 outf = fopen(argv[1], "w");
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 if (!outf) {
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 perror(argv[1]);
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 exit(1);
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 }
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 fwrite(efr_dhf_bytes, 1, 31, outf);
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 fclose(outf);
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 exit(0);
6bb1651f8c11 dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 }