More of a console, approaching standard commandset for Chipcon port.
[goodfet] / client / goodfet
1 #!/usr/bin/env python
2 # GoodFET Debugger
3
4 # (C) 2009 Travis Goodspeed <travis at radiantmachines.com>
5 #
6 # This code is being rewritten and refactored.  You've been warned!
7
8 import sys, os, readline, code, binascii;
9 import rlcompleter;
10
11 from GoodFETConsole import GoodFETConsole;
12 from GoodFETCC import GoodFETCC;
13 from GoodFETMSP430 import GoodFETMSP430;
14 from GoodFET import GoodFET;
15
16 from intelhex import IntelHex;
17
18 if(len(sys.argv)==1):
19     print "Usage: %s driver\n" % sys.argv[0];
20     print "driver:= GoodFETCC GoodFETMSP430";
21     print;
22     print "This is an unfinished client.  You probably want goodfet.$chip instead.";
23     sys.exit(1);
24
25 driver=sys.argv[1];
26 print "Using driver %s" % driver;
27 client=eval("%s()" % driver);
28 console=GoodFETConsole(client);
29
30 while 1:
31     sys.stdout.write("gf% ");
32     sys.stdout.flush();
33     cmd=sys.stdin.readline();
34     console.handle(cmd);
35
36 sys.exit(0);