FreeCalypso > hg > vband-misc
diff dhf/emit-dhfbin-efr.c @ 35:6bb1651f8c11
dhf: generate binary form of EFR DHF
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 14 May 2024 03:46:12 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dhf/emit-dhfbin-efr.c Tue May 14 03:46:12 2024 +0000 @@ -0,0 +1,28 @@ +/* + * This program emits a binary file containing one EFR DHF. + */ + +#include <stdio.h> +#include <stdint.h> +#include <stdlib.h> + +extern const uint8_t efr_dhf_bytes[31]; + +main(argc, argv) + char **argv; +{ + FILE *outf; + + if (argc != 2) { + fprintf(stderr, "usage: %s out-bin-file\n", argv[0]); + exit(1); + } + outf = fopen(argv[1], "w"); + if (!outf) { + perror(argv[1]); + exit(1); + } + fwrite(efr_dhf_bytes, 1, 31, outf); + fclose(outf); + exit(0); +}