GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / cfe / build / chipimages / bcm4707 / romtool / bin2hex.pl
blob14b1d3370914a637dbd2981beeb274c0e582305c
1 #! /usr/bin/perl -w
3 ($in, $out) = @ARGV;
4 die "Missing input file name.\n" unless $in;
5 die "Missing output file name.\n" unless $out;
6 $byteCount = 0;
7 open(IN, "< $in");
8 binmode(IN);
9 open(OUT, "> tmp.hex");
10 while (read(IN,$b,1)) {
11 $n = length($b);
12 $byteCount += $n;
13 $s = 2*$n;
14 print (OUT unpack("H$s", $b), "\n");
17 close(IN);
18 close(OUT);
19 print "Number of bytes converted = $byteCount\n";
22 open(IN, "< tmp.hex");
23 open(OUT, "> $out");
24 $addr = 0x0;
25 printf OUT ("\$INSTANCE qt_serial_flash.mem\n");
26 printf OUT ("\$RADIX HEX\n");
27 printf OUT ("\$ADDRESS 0 7ff\n");
28 while (<IN>) {
29 printf OUT ("%x $_",$addr);
30 $addr++;
33 system("rm tmp.hex");