forked from platformio/platformio-core
Fix issue with detecting media disk when mbed upload protocol is specified
This commit is contained in:
@ -142,14 +142,6 @@ def PrintSystemInfo(env):
|
|||||||
print "Debug: %s" % " ".join(data)
|
print "Debug: %s" % " ".join(data)
|
||||||
|
|
||||||
|
|
||||||
def PrintUploadInfo(env):
|
|
||||||
selected = env.subst("$UPLOAD_PROTOCOL")
|
|
||||||
available = env.BoardConfig().get("upload", {}).get(
|
|
||||||
"protocols", [selected])
|
|
||||||
print "Available: %s" % ", ".join(available)
|
|
||||||
print "Selected: %s" % selected
|
|
||||||
|
|
||||||
|
|
||||||
def exists(_):
|
def exists(_):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -160,5 +152,4 @@ def generate(env):
|
|||||||
env.AddMethod(GetFrameworkScript)
|
env.AddMethod(GetFrameworkScript)
|
||||||
env.AddMethod(LoadPioPlatform)
|
env.AddMethod(LoadPioPlatform)
|
||||||
env.AddMethod(PrintSystemInfo)
|
env.AddMethod(PrintSystemInfo)
|
||||||
env.AddMethod(PrintUploadInfo)
|
|
||||||
return env
|
return env
|
||||||
|
@ -144,8 +144,9 @@ def AutodetectUploadPort(*args, **kwargs): # pylint: disable=unused-argument
|
|||||||
print env.subst("Use manually specified: $UPLOAD_PORT")
|
print env.subst("Use manually specified: $UPLOAD_PORT")
|
||||||
return
|
return
|
||||||
|
|
||||||
if "mbed" in env.subst("$PIOFRAMEWORK") \
|
if (env.subst("$UPLOAD_PROTOCOL") == "mbed"
|
||||||
and not env.subst("$UPLOAD_PROTOCOL"):
|
or ("mbed" in env.subst("$PIOFRAMEWORK")
|
||||||
|
and not env.subst("$UPLOAD_PROTOCOL"))):
|
||||||
env.Replace(UPLOAD_PORT=_look_for_mbed_disk())
|
env.Replace(UPLOAD_PORT=_look_for_mbed_disk())
|
||||||
else:
|
else:
|
||||||
if ("linux" in util.get_systype() and not any([
|
if ("linux" in util.get_systype() and not any([
|
||||||
@ -212,6 +213,14 @@ def CheckUploadSize(_, target, source, env): # pylint: disable=W0613,W0621
|
|||||||
env.Exit(1)
|
env.Exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def PrintUploadInfo(env):
|
||||||
|
selected = env.subst("$UPLOAD_PROTOCOL")
|
||||||
|
available = env.BoardConfig().get("upload", {}).get(
|
||||||
|
"protocols", [selected])
|
||||||
|
print "Available: %s" % ", ".join(available)
|
||||||
|
print "Selected: %s" % selected
|
||||||
|
|
||||||
|
|
||||||
def exists(_):
|
def exists(_):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -223,4 +232,5 @@ def generate(env):
|
|||||||
env.AddMethod(AutodetectUploadPort)
|
env.AddMethod(AutodetectUploadPort)
|
||||||
env.AddMethod(UploadToDisk)
|
env.AddMethod(UploadToDisk)
|
||||||
env.AddMethod(CheckUploadSize)
|
env.AddMethod(CheckUploadSize)
|
||||||
|
env.AddMethod(PrintUploadInfo)
|
||||||
return env
|
return env
|
||||||
|
Reference in New Issue
Block a user