Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions boards/opencm904/dist/robotis-loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def to_ord(val):


# Reading command line
#if len(sys.argv) != 3:
# exit('! Usage: robotis-loader.py <serial-port> <binary>')
#pgm, port, binary = sys.argv
# if len(sys.argv) != 3:
# exit('! Usage: robotis-loader.py <serial-port> <binary>')
# pgm, port, binary = sys.argv

pgm = sys.argv[0]
port = os.environ["PORT"]
Expand All @@ -86,13 +86,13 @@ def progressBar(percent, precision=65):
size = stat.st_size
firmware = open(binary, 'rb')
print('* Opening %s, size=%d' % (binary, size))
except:
except: # noqa: E722
exit('! Unable to open file %s' % binary)

# Opening serial port
try:
s = serial.Serial(port, baudrate=115200)
except:
except: # noqa: E722
exit('! Unable to open serial port %s' % port)

print('* Resetting the board')
Expand All @@ -102,7 +102,7 @@ def progressBar(percent, precision=65):
s.setRTS(False)
s.write(b'CM9X')
s.close()
time.sleep(1.0);
time.sleep(1.0)

print('* Connecting...')
s = serial.Serial(port, baudrate=115200)
Expand Down