mirror of
https://github.com/travisgoodspeed/goodwatch
synced 2024-11-21 15:48:02 +00:00
Setting the baud rate now works. There will be trouble above 38400 baud.
This commit is contained in:
parent
85d3575a89
commit
d79cc6cef6
@ -85,6 +85,9 @@ class BSL:
|
||||
if len(reply)!=1:
|
||||
print "Error, missing reply.";
|
||||
sys.exit(1);
|
||||
elif msg[0]=='\x52':
|
||||
#Change baud rate command has a briefer reply.
|
||||
pass;
|
||||
elif ord(reply[0])==0x00:
|
||||
#Success
|
||||
eighty=ord(self.serial.read(1));
|
||||
@ -200,10 +203,15 @@ class BSL:
|
||||
ratebyte='\x05';
|
||||
elif rate==115200:
|
||||
ratebyte='\x06';
|
||||
resp=self.transact("\x17"+ratebyte);
|
||||
|
||||
|
||||
resp=self.transact("\x52"+ratebyte);
|
||||
#self.serial.write("\x80\x52\x06");
|
||||
#print self.serial.read().encode('hex');
|
||||
|
||||
#Then we jump the port to the new rate.
|
||||
self.serial.setBaudrate(rate);
|
||||
#self.serial.setBaudrate(rate); #Old convention.
|
||||
self.serial.baudrate=rate; #New convention.
|
||||
|
||||
MAXLEN=256; #Maximum bytes per read request.
|
||||
def readbulk(self,adr,length):
|
||||
|
Loading…
Reference in New Issue
Block a user