mirror of
https://github.com/travisgoodspeed/goodwatch
synced 2024-11-21 23:58:31 +00:00
LCD monitor command. #55
This commit is contained in:
parent
d917393b70
commit
37088f8731
@ -111,14 +111,19 @@ class GoodWatch:
|
||||
"""Peeks a 16-bit word from memory."""
|
||||
s=self.transact("\x01\x00"+chr16(adr));
|
||||
return ord16(s[2:4]);
|
||||
def lcdstring(self,string):
|
||||
"""Writes an 8-letter string to the LCD."""
|
||||
self.transact("\x03"+string+"\x00");
|
||||
return;
|
||||
|
||||
if __name__=='__main__':
|
||||
parser = argparse.ArgumentParser(description='GoodWatch Client')
|
||||
parser.add_argument('-p','--port',
|
||||
help='Serial Port',default='/dev/ttyUSB0');
|
||||
parser.add_argument('-r','--peek',
|
||||
help='Serial Port');
|
||||
|
||||
help='Peek');
|
||||
parser.add_argument('-l','--lcd',
|
||||
help='Write a string the LCD.');
|
||||
parser.add_argument('-d','--dump',
|
||||
help='Produce a core dump.',action='count');
|
||||
parser.add_argument('-D','--dmesg',
|
||||
@ -141,6 +146,10 @@ if __name__=='__main__':
|
||||
adr=int(args.peek,16);
|
||||
val=goodwatch.peek(adr);
|
||||
print "0x%04x: %04x\n" % (adr,val);
|
||||
|
||||
if args.lcd!=None:
|
||||
goodwatch.lcdstring(args.lcd);
|
||||
|
||||
#Exit turbomode when we're done.
|
||||
#goodwatch.turbomode(0);
|
||||
|
||||
|
@ -16,7 +16,7 @@ enum {
|
||||
SETTURBOMODE = 0x00,
|
||||
PEEK = 0x01,
|
||||
POKE = 0x02,
|
||||
LCD = 0x03,
|
||||
LCDSTRING = 0x03,
|
||||
DMESG = 0x04
|
||||
} monitor_verb;
|
||||
|
||||
@ -50,6 +50,11 @@ int monitor_handle(uint8_t *buffer, int len){
|
||||
}
|
||||
break;
|
||||
|
||||
case LCDSTRING:
|
||||
lcd_zero();
|
||||
lcd_string((char*) buffer+1);
|
||||
break;
|
||||
|
||||
case DMESG:
|
||||
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user