forked from platformio/platformio-core
Merge branch 'develop' into feature/platformio-30
* develop: Update docs for Teensy USB Features // Issue #722 Implement Teensy 2.0 USB functionality (HID, SERIAL_HID, DISK, MIDI, etc.) // Resolve #722 Add support for Pinoccio Scout board // Resolve #52 Fix broken LD Script for Element14 chipKIT Pi board // Resolve #725 Resolve #726 Fix USB flags processing for teensy platform // Issue #722 Add Pinoccio board // Issue #52 Minor improvements for CLion docs Improved docs for integration with CLion IDE Version bump to 2.11.1 (issues #472, #629, #710, #711, #712, #713, #718) Typo fix Add "udev" rules for OpenOCD CMSIS-DAP adapters // Resolve #718 Update history Ignore "[platformio]" section from custom project configuration CI Bump to 2.11.1b1 Add Arduino M0 Pro and Tian to the examples // Issue #472 Fix issue when `pioenvs` folder doesn't exist Add more info about `.pioenvs` directory Improve CMSIS selection for SAMD21 boards Improve support for SAMD21 based boards Add contributing guidelines
This commit is contained in:
commit
1029233ec7
14 files changed
+238
-34
No files matched your search
@@ -39,15 +39,12 @@ def FlushSerialBuffer(env, port):
|
||||
def TouchSerialPort(env, port, baudrate):
|
||||
port = env.subst(port)
|
||||
print "Forcing reset using %dbps open/close on port %s" % (baudrate, port)
|
||||
if system() != "Windows":
|
||||
try:
|
||||
s = Serial(port)
|
||||
s.close()
|
||||
except: # pylint: disable=W0702
|
||||
pass
|
||||
s = Serial(port=port, baudrate=baudrate)
|
||||
s.setDTR(False)
|
||||
s.close()
|
||||
try:
|
||||
s = Serial(port=port, baudrate=baudrate)
|
||||
s.setDTR(False)
|
||||
s.close()
|
||||
except: # pylint: disable=W0702
|
||||
pass
|
||||
sleep(0.4)
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,12 @@ from platformio.commands.init import validate_boards
|
||||
from platformio.commands.run import cli as cmd_run
|
||||
from platformio.exception import CIBuildEnvsEmpty
|
||||
|
||||
# pylint: disable=wrong-import-order
|
||||
try:
|
||||
from configparser import ConfigParser
|
||||
except ImportError:
|
||||
from ConfigParser import ConfigParser
|
||||
|
||||
|
||||
def validate_path(ctx, param, value): # pylint: disable=W0613
|
||||
invalid_path = None
|
||||
@@ -81,7 +87,7 @@ def cli(ctx, src, lib, exclude, board, # pylint: disable=R0913
|
||||
_copy_contents(join(build_dir, dir_name), contents)
|
||||
|
||||
if project_conf and isfile(project_conf):
|
||||
copyfile(project_conf, join(build_dir, "platformio.ini"))
|
||||
_copy_project_conf(build_dir, project_conf)
|
||||
elif not board:
|
||||
raise CIBuildEnvsEmpty()
|
||||
|
||||
@@ -147,3 +153,12 @@ def _exclude_contents(dst_dir, patterns):
|
||||
rmtree(path)
|
||||
elif isfile(path):
|
||||
remove(path)
|
||||
|
||||
|
||||
def _copy_project_conf(build_dir, project_conf):
|
||||
cp = ConfigParser()
|
||||
cp.read(project_conf)
|
||||
if cp.has_section("platformio"):
|
||||
cp.remove_section("platformio")
|
||||
with open(join(build_dir, "platformio.ini"), "w") as fp:
|
||||
cp.write(fp)
|
||||
+11
-1
@@ -220,10 +220,20 @@ def get_projectlib_dir():
|
||||
|
||||
|
||||
def get_pioenvs_dir():
|
||||
return _get_projconf_option_dir(
|
||||
path = _get_projconf_option_dir(
|
||||
"envs_dir",
|
||||
join(get_project_dir(), ".pioenvs")
|
||||
)
|
||||
if not isdir(path):
|
||||
os.makedirs(path)
|
||||
dontmod_path = join(path, "do-not-modify-files-here.url")
|
||||
if not isfile(dontmod_path):
|
||||
with open(dontmod_path, "w") as fp:
|
||||
fp.write("""
|
||||
[InternetShortcut]
|
||||
URL=http://docs.platformio.org/en/latest/projectconf.html#envs-dir
|
||||
""")
|
||||
return path
|
||||
|
||||
|
||||
def get_projectdata_dir():
|
||||
|
||||
Reference in new issue
Block a user