mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Fix firmware uploading for Arduino Leonardo under Unix
This commit is contained in:
@ -2,14 +2,13 @@
|
|||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
from os.path import join
|
from os.path import join
|
||||||
from platform import system
|
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
from SCons.Script import Exit
|
from SCons.Script import Exit
|
||||||
from serial import Serial
|
from serial import Serial
|
||||||
|
|
||||||
from platformio.util import get_logicaldisks, get_serialports
|
from platformio.util import get_logicaldisks, get_serialports, get_systype
|
||||||
|
|
||||||
|
|
||||||
def FlushSerialBuffer(env, port):
|
def FlushSerialBuffer(env, port):
|
||||||
@ -24,7 +23,7 @@ def FlushSerialBuffer(env, port):
|
|||||||
|
|
||||||
|
|
||||||
def TouchSerialPort(env, port, baudrate):
|
def TouchSerialPort(env, port, baudrate):
|
||||||
if system() == "Linux":
|
if "windows" not in get_systype():
|
||||||
try:
|
try:
|
||||||
s = Serial(env.subst(port))
|
s = Serial(env.subst(port))
|
||||||
s.close()
|
s.close()
|
||||||
|
Reference in New Issue
Block a user