mirror of
https://github.com/espressif/esptool.git
synced 2025-10-16 23:06:31 +08:00
feat: add advisory port locking
Closes https://github.com/espressif/esptool/issues/946
This commit is contained in:

committed by
Radim Karniš

parent
f72b5ad13c
commit
8ad6d57ea9
@@ -256,7 +256,7 @@ def main():
|
|||||||
logging.getLogger("rfc2217").setLevel(level)
|
logging.getLogger("rfc2217").setLevel(level)
|
||||||
|
|
||||||
# connect to serial port
|
# connect to serial port
|
||||||
ser = serial.serial_for_url(args.SERIALPORT, do_not_open=True)
|
ser = serial.serial_for_url(args.SERIALPORT, do_not_open=True, exclusive=True)
|
||||||
ser.timeout = 3 # required so that the reader thread can exit
|
ser.timeout = 3 # required so that the reader thread can exit
|
||||||
# reset control line as no _remote_ "terminal" has been connected yet
|
# reset control line as no _remote_ "terminal" has been connected yet
|
||||||
ser.dtr = False
|
ser.dtr = False
|
||||||
|
@@ -300,7 +300,7 @@ class ESPLoader(object):
|
|||||||
|
|
||||||
if isinstance(port, str):
|
if isinstance(port, str):
|
||||||
try:
|
try:
|
||||||
self._port = serial.serial_for_url(port)
|
self._port = serial.serial_for_url(port, exclusive=True)
|
||||||
except serial.serialutil.SerialException as e:
|
except serial.serialutil.SerialException as e:
|
||||||
port_issues = [
|
port_issues = [
|
||||||
[ # does not exist error
|
[ # does not exist error
|
||||||
|
2
setup.py
2
setup.py
@@ -128,7 +128,7 @@ setup(
|
|||||||
"bitstring>=3.1.6",
|
"bitstring>=3.1.6",
|
||||||
"cryptography>=2.1.4",
|
"cryptography>=2.1.4",
|
||||||
"ecdsa>=0.16.0",
|
"ecdsa>=0.16.0",
|
||||||
"pyserial>=3.0",
|
"pyserial>=3.3",
|
||||||
"reedsolo>=1.5.3,<1.8",
|
"reedsolo>=1.5.3,<1.8",
|
||||||
"PyYAML>=5.1",
|
"PyYAML>=5.1",
|
||||||
"intelhex",
|
"intelhex",
|
||||||
|
Reference in New Issue
Block a user