ArduinoAm29F010

Changeset

11:7b4963a03d60
2015-01-20 Paul Boddie raw files shortlog changelog graph Employed a special prompt, distinguishing it from the output.
upload.py (file)
     1.1 --- a/upload.py	Tue Jan 20 01:41:12 2015 +0100
     1.2 +++ b/upload.py	Tue Jan 20 14:52:20 2015 +0100
     1.3 @@ -3,13 +3,11 @@
     1.4  from serial import Serial
     1.5  import sys
     1.6  
     1.7 -def console(initial=None):
     1.8 -    if initial:
     1.9 -        s.write(initial)
    1.10 -
    1.11 +def console():
    1.12      try:
    1.13          while 1:
    1.14 -            s.write(raw_input(s.readline()) + "\n")
    1.15 +            s.write(raw_input("> ") + "\n")
    1.16 +            print s.readline().rstrip("\r\n")
    1.17      except EOFError:
    1.18          print "Session closed."
    1.19  
    1.20 @@ -55,11 +53,11 @@
    1.21      rate = 115200
    1.22  
    1.23      s = Serial(port, rate)
    1.24 +    s.readline()
    1.25  
    1.26      if "-i" in sys.argv:
    1.27          console()
    1.28      elif len(sys.argv) > 1:
    1.29 -        s.readline()
    1.30          for sector, filename in enumerate(sys.argv[1:]):
    1.31              upload(filename, sector)
    1.32      else: