mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Fix handling of upload port when board option is not specified in platformio.ini // Resolve #313
This commit is contained in:
@ -12,6 +12,9 @@ PlatformIO 2.0
|
|||||||
(`issue #309 <https://github.com/platformio/platformio/issues/309>`_)
|
(`issue #309 <https://github.com/platformio/platformio/issues/309>`_)
|
||||||
* Added support for Espressif ESP8266 ESP-12E board (NodeMCU)
|
* Added support for Espressif ESP8266 ESP-12E board (NodeMCU)
|
||||||
(`issue #310 <https://github.com/platformio/platformio/issues/310>`_)
|
(`issue #310 <https://github.com/platformio/platformio/issues/310>`_)
|
||||||
|
* Fixed handling of upload port when ``board`` option is not specified in
|
||||||
|
`platformio.ini <http://docs.platformio.org/en/latest/projectconf.html>`__
|
||||||
|
(`issue #313 <https://github.com/platformio/platformio/issues/313>`_)
|
||||||
|
|
||||||
|
|
||||||
2.3.4 (2015-10-13)
|
2.3.4 (2015-10-13)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
VERSION = (2, 4, "0.dev0")
|
VERSION = (2, 4, "0.dev1")
|
||||||
__version__ = ".".join([str(s) for s in VERSION])
|
__version__ = ".".join([str(s) for s in VERSION])
|
||||||
|
|
||||||
__title__ = "platformio"
|
__title__ = "platformio"
|
||||||
|
@ -16,10 +16,6 @@ from platformio.util import get_serialports
|
|||||||
|
|
||||||
def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
|
def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
|
||||||
|
|
||||||
def _rpi_sysgpio(path, value):
|
|
||||||
with open(path, "w") as f:
|
|
||||||
f.write(str(value))
|
|
||||||
|
|
||||||
if "micronucleus" in env['UPLOADER']:
|
if "micronucleus" in env['UPLOADER']:
|
||||||
print "Please unplug/plug device ..."
|
print "Please unplug/plug device ..."
|
||||||
|
|
||||||
@ -35,13 +31,18 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
|
|||||||
"-D"
|
"-D"
|
||||||
])
|
])
|
||||||
|
|
||||||
if not upload_options.get("require_upload_port", False):
|
if upload_options and not upload_options.get("require_upload_port", False):
|
||||||
return
|
return
|
||||||
|
|
||||||
env.AutodetectUploadPort()
|
env.AutodetectUploadPort()
|
||||||
env.Append(UPLOADERFLAGS=["-P", "$UPLOAD_PORT"])
|
env.Append(UPLOADERFLAGS=["-P", "$UPLOAD_PORT"])
|
||||||
|
|
||||||
if env.subst("$BOARD") == "raspduino":
|
if env.subst("$BOARD") == "raspduino":
|
||||||
|
|
||||||
|
def _rpi_sysgpio(path, value):
|
||||||
|
with open(path, "w") as f:
|
||||||
|
f.write(str(value))
|
||||||
|
|
||||||
_rpi_sysgpio("/sys/class/gpio/export", 18)
|
_rpi_sysgpio("/sys/class/gpio/export", 18)
|
||||||
_rpi_sysgpio("/sys/class/gpio/gpio18/direction", "out")
|
_rpi_sysgpio("/sys/class/gpio/gpio18/direction", "out")
|
||||||
_rpi_sysgpio("/sys/class/gpio/gpio18/value", 1)
|
_rpi_sysgpio("/sys/class/gpio/gpio18/value", 1)
|
||||||
|
Reference in New Issue
Block a user