From bad08ec595fddbb0364e7f310eae0cb310704996 Mon Sep 17 00:00:00 2001 From: Niels Moseley Date: Mon, 12 Feb 2018 15:53:02 +0100 Subject: [PATCH] Fixed ise_hexer to filter out more rubbish characters. Fixed S3E starterkit toplevel (ROM/RAM parameters) --- .../webpack_ise/Apple-One.gise | 163 +++++++++++++++++- tools/ise_hexer/main.c | 22 ++- 2 files changed, 183 insertions(+), 2 deletions(-) diff --git a/boards/spartan3e_starterkit/webpack_ise/Apple-One.gise b/boards/spartan3e_starterkit/webpack_ise/Apple-One.gise index 622e1ab..19662ab 100644 --- a/boards/spartan3e_starterkit/webpack_ise/Apple-One.gise +++ b/boards/spartan3e_starterkit/webpack_ise/Apple-One.gise @@ -22,9 +22,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ise_hexer/main.c b/tools/ise_hexer/main.c index 30f551c..878f122 100644 --- a/tools/ise_hexer/main.c +++ b/tools/ise_hexer/main.c @@ -18,6 +18,23 @@ uint8_t isWhiteSpace(char c) return 0; } +uint8_t isHex(char c) +{ + if ((c>='0') && (c<='9')) + { + return 1; + } + if ((c>='a') && (c<='f')) + { + return 1; + } + if ((c>='A') && (c<='F')) + { + return 1; + } + return 0; +} + uint8_t convert(const char *infilename, const char *outfilename) { FILE *fin = fopen(infilename,"rt"); @@ -48,7 +65,10 @@ uint8_t convert(const char *infilename, const char *outfilename) } else { - fprintf(fout,"%c", c); + if ((isHex(c)) || (c==10) || (c==13)) + { + fprintf(fout,"%c", c); + } } } else