diff options
| author | Simon John <git@the-jedi.co.uk> | 2020-08-04 23:19:49 +0100 |
|---|---|---|
| committer | Simon John <git@the-jedi.co.uk> | 2020-08-04 23:19:49 +0100 |
| commit | 207253abc6ec81112abf0a64a8bf68e227528d64 (patch) | |
| tree | b289b1a3ad4d2793e38e5072353b9f5484f98a7b /bin/ard-reset-arduino | |
| parent | 6f786a96b0acfb0c9b2d2f4e39911d2803088729 (diff) | |
Rebased python3 branch with some changes from tuna-f1sh@87d5241
Diffstat (limited to 'bin/ard-reset-arduino')
| -rwxr-xr-x | bin/ard-reset-arduino | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/bin/ard-reset-arduino b/bin/ard-reset-arduino index d6f974f..f03bf66 100755 --- a/bin/ard-reset-arduino +++ b/bin/ard-reset-arduino @@ -1,18 +1,11 @@ #!/usr/bin/env python -from __future__ import print_function import serial import serial.tools.list_ports import os.path import argparse from time import sleep -pyserial_version = None -try: - pyserial_version = int(serial.VERSION[0]) -except: - pyserial_version = 2 # less than 2.3 - parser = argparse.ArgumentParser(description='Reset an Arduino') parser.add_argument('--zero', action='store_true', help='Reset Arduino Zero or similar Native USB to enter bootloader') parser.add_argument('--caterina', action='store_true', help='Reset a Leonardo, Micro, Robot or LilyPadUSB.') @@ -65,11 +58,7 @@ if args.zero: ser = serial.Serial(args.port[0], 57600) ser.close() - - if pyserial_version < 3: - ser.setBaudrate(1200) - else: - ser.baudrate = 1200 + ser.baudrate = 1200 # do the open/close at 1200 BAUD ser.open() |
