gateware

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 4d15b93441b068dab804cf45b613d9e2a7d91aa3
parent e951bb92df1a844ffacc81d9b2d8af0abecf79b9
Author: Brian Swetland <swetland@frotz.net>
Date:   Sat, 17 Nov 2018 09:29:36 -0800

icetool: accept /blahblah to write ascii instead of hex

Diffstat:
Msrc/icetool.c | 12++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/icetool.c b/src/icetool.c @@ -102,8 +102,16 @@ int main(int argc, char **argv) { argv += 3; n = 0; while (argc > 0) { - if (n == 2048) return 1; - data[1 + n++] = strtoul(argv[0], 0, 16); + if (argv[0][0] == '/') { + char *s = argv[0] + 1; + while (*s != 0) { + if (n == 2048) return 1; + data[1 + n++] = *s++; + } + } else { + if (n == 2048) return 1; + data[1 + n++] = strtoul(argv[0], 0, 16); + } argc--; argv++; }