X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFET.py;h=e60c31a17c37318e0bad43f61892ca69cccce032;hp=4aec90b53142bf54b670ea6ebc9bb0ae786ad459;hb=dea6bf631cff92a6682f8898ec17315de1a305de;hpb=e4d0e38ca26f599f584062d457b9df3d1077be9b diff --git a/client/GoodFET.py b/client/GoodFET.py index 4aec90b..e60c31a 100755 --- a/client/GoodFET.py +++ b/client/GoodFET.py @@ -115,7 +115,8 @@ class GoodFET: connected=0; while connected==0: while self.verb!=0x7F or self.data!="http://goodfet.sf.net/": - #print "Resyncing."; + if attempts>2: + print "Resyncing."; self.serialport.flushInput() self.serialport.flushOutput() #Explicitly set RTS and DTR to halt board. @@ -126,6 +127,7 @@ class GoodFET: #TelosB reset, prefer software to I2C SPST Switch. if(os.environ.get("platform")=='telosb'): + #print "TelosB Reset"; self.telosBReset(); #self.serialport.write(chr(0x80)); #self.serialport.write(chr(0x80)); @@ -358,21 +360,21 @@ class GoodFET: """Execute supplied code.""" self.writecmd(0,0x31,2,#len(code), code); - def peekbyte(self,address): + def MONpeek8(self,address): """Read a byte of memory from the monitor.""" self.data=[address&0xff,address>>8]; self.writecmd(0,0x02,2,self.data); #self.readcmd(); return ord(self.data[0]); - def peekword(self,address): + def MONpeek16(self,address): """Read a word of memory from the monitor.""" - return self.peekbyte(address)+(self.peekbyte(address+1)<<8); + return self.MONpeek8(address)+(self.MONpeek8(address+1)<<8); def peek(self,address): """Read a word of memory from the monitor.""" - return self.peekbyte(address)+(self.peekbyte(address+1)<<8); + return self.MONpeek8(address)+(self.MONpeek8(address+1)<<8); def eeprompeek(self,address): """Read a word of memory from the monitor.""" - return self.peekbyte(address)+(self.peekbyte(address+1)<<8); + return self.MONpeek8(address)+(self.MONpeek8(address+1)<<8); def peekbysym(self,name): """Read a value by its symbol name.""" #TODO include memory in symbol. @@ -404,7 +406,7 @@ class GoodFET: def dumpmem(self,begin,end): i=begin; while i