Merge branch 'release/v1.5.0'

This commit is contained in:
Ivan Kravets
2015-05-15 13:00:51 +02:00
35 changed files with 548 additions and 45 deletions

View File

@ -1,6 +1,29 @@
Release History
===============
1.5.0 (2015-05-15)
------------------
* Added support of `Framework mbed <http://platformio.org/#!/frameworks/mbed>`_
for Teensy 3.1
(`issue #183 <https://github.com/platformio/platformio/issues/183>`_)
* Added GDB as alternative uploader to `ststm32 <http://docs.platformio.org/en/latest/platforms/ststm32.html>`__ platform
(`issue #175 <https://github.com/platformio/platformio/issues/174>`_)
* Added `examples <https://github.com/platformio/platformio/tree/develop/examples>`__
with preconfigured IDE projects
(`issue #154 <https://github.com/platformio/platformio/issues/154>`_)
* Fixed firmware uploading under Linux OS for Arduino Leonardo board
(`issue #178 <https://github.com/platformio/platformio/issues/178>`_)
* Fixed invalid "mbed" firmware for Nucleo F411RE
(`issue #185 <https://github.com/platformio/platformio/issues/185>`_)
* Fixed parsing of includes for PlatformIO Library Dependency Finder
(`issue #189 <https://github.com/platformio/platformio/issues/189>`_)
* Fixed handling symbolic links within source code directory
(`issue #190 <https://github.com/platformio/platformio/issues/190>`_)
* Fixed cancelling any previous definition of name, either built in or provided
with a ``-D`` option
(`issue #191 <https://github.com/platformio/platformio/issues/191>`_)
1.4.0 (2015-04-11)
------------------

View File

@ -6,9 +6,9 @@ PlatformIO
:alt: Travis.CI Build Status
.. image:: https://ci.appveyor.com/api/projects/status/ee26e58de798rctd/branch/develop?svg=true
:target: https://ci.appveyor.com/project/ivankravets/platformio
:alt: AppVeyor.CI Build Status
.. image:: https://gemnasium.com/ivankravets/platformio.png
:target: https://gemnasium.com/ivankravets/platformio
:alt: AppVeyor.CI Build Status
.. image:: https://gemnasium.com/platformio/platformio.png
:target: https://gemnasium.com/platformio/platformio
:alt: Dependency Status
.. image:: https://pypip.in/version/platformio/badge.png?style=flat
:target: https://pypi.python.org/pypi/platformio/
@ -19,6 +19,9 @@ PlatformIO
.. image:: https://pypip.in/license/platformio/badge.png?style=flat
:target: https://pypi.python.org/pypi/platformio/
:alt: License
.. image:: https://badges.gitter.im/Join%20Chat.svg
:alt: Join the chat at https://gitter.im/platformio/platformio
:target: https://gitter.im/platformio/platformio
`Website + Library Search <http://platformio.org>`_ |
`Documentation <http://docs.platformio.org>`_ |
@ -27,8 +30,8 @@ PlatformIO
`Reddit <http://www.reddit.com/r/platformio/>`_ |
`Twitter <https://twitter.com/PlatformIO_Org>`_
*Atmel AVR & SAM, Freescale Kinetis, Nordic nRF51, NXP LPC, ST STM32,
TI MSP430 & Tiva, Teensy, Arduino, mbed, libOpenCM3, etc.*
*Atmel AVR & SAM, Espressif, Freescale Kinetis, Nordic nRF51, NXP LPC,
ST STM32, TI MSP430 & Tiva, Teensy, Arduino, mbed, libOpenCM3, etc.*
.. image:: https://raw.githubusercontent.com/platformio/platformio/develop/docs/_static/platformio-logo.png
:target: http://platformio.org
@ -127,6 +130,7 @@ It has support for the most popular embedded platforms:
* `Atmel AVR <http://platformio.org/#!/platforms/atmelavr>`_
* `Atmel SAM <http://platformio.org/#!/platforms/atmelsam>`_
* `Espressif <http://platformio.org/#!/platforms/espressif>`_
* `Freescale Kinetis <http://platformio.org/#!/platforms/freescalekinetis>`_
* `Nordic nRF51 <http://platformio.org/#!/platforms/nordicnrf51>`_
* `NXP LPC. <http://platformio.org/#!/platforms/nxplpc>`_

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

View File

@ -9,8 +9,9 @@ Articles about us
Here are recent articles about PlatformIO:
* April 17, 2015 - **Michael Ball** - `PlatformIO - A Cross-Platform Code Builder and Missing Library Manager <http://arduino-pi.blogspot.com.es/2015/04/platformio-cross-platform-code-builder.html>`_
* March 23, 2015 - **Atmel** - `Cross-board and cross-vendor embedded development with PlatformIO <http://blog.atmel.com/2015/03/23/cross-board-and-cross-vendor-embedded-development-with-platformio/>`_
* March 22, 2015 - **Mark VandeWettering** - `Discovered a new tool for embedded development: PlatformIO <http://brainwagon.org/2015/03/22/discovered-a-new-tool-for-embedded-development-platformio/>`_
* October 7, 2014 - **Ivan Kravets** - `Integration of PlatformIO library manager to Arduino and Energia IDEs <http://www.ikravets.com/computer-life/platformio/2014/10/07/integration-of-platformio-library-manager-to-arduino-and-energia-ides>`_
* June 20, 2014 - **Ivan Kravets** - `Building and debugging Atmel AVR (Arduino-based) project using Eclipse IDE+PlatformIO <http://www.ikravets.com/computer-life/programming/2014/06/20/building-and-debugging-atmel-avr-arduino-based-project-using-eclipse-ideplatformio>`_
* June 17, 2014 - **Ivan Kravets** - `How was PlatformIO born or why I love Python World <http://www.ikravets.com/computer-life/programming/2014/06/17/how-was-platformio-born-or-why-i-love-python-world>`_
* June 17, 2014 - **Ivan Kravets** - `How was PlatformIO born or why I love Python World <http://www.ikravets.com/computer-life/programming/2014/06/17/how-was-platformio-born-or-why-i-love-python-world>`_

View File

@ -86,8 +86,8 @@ Serial does not work with panStampAVR board
Answered in `issue #144 <https://github.com/platformio/platformio/issues/144#issuecomment-87388038>`_.
An error ``pkg_resources.DistributionNotFound``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PlatformIO: command not found || An error ``pkg_resources.DistributionNotFound``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please upgrade *SetupTools* package:

View File

@ -9,6 +9,7 @@ IDE Integration
ide/arduino
ide/eclipse
ide/energia
ide/qtcreator
ide/sublimetext
ide/vim
ide/visualstudio

113
docs/ide/qtcreator.rst Normal file
View File

@ -0,0 +1,113 @@
.. _ide_qtcreator:
Qt Creator
==========
The `Qt Creator <https://github.com/qtproject/qt-creator>`_ is an open source cross-platform integrated development environment. The editor includes such features as syntax highlighting for various languages, project manager, integrated version control systems, rapid code navigation tools and code autocompletion.
This software can be used with:
* all availalbe :ref:`platforms`
* all availalbe :ref:`frameworks`
Refer to the `Sublime Text Documentation <http://doc.qt.io/qtcreator/>`_
page for more detailed information.
.. contents::
Integration
-----------
Setup New Project
^^^^^^^^^^^^^^^^^
First of all, let's create new project from Qt Creator Start Page: ``New Project`` or using ``Menu: File → New File or Project``, then select project with ``Empty Qt Project`` type (``Other Project → Empty Qt Project``), fill ``Name``, ``Create in``.
.. image:: ../_static/ide-platformio-qtcreator-1.png
On the next steps select any available kit and click Finish button.
.. image:: ../_static/ide-platformio-qtcreator-2.png
Secondly, we need to configure project with PlatformIO source code builder (click on Projects label on left menu or ``Ctrl+5`` shortcut):
.. image:: ../_static/ide-platformio-qtcreator-3.png
Thirdly, we need to add directories with header files using project file. Please fill this file with the next contents:
.. code-block:: none
win32 {
HOMEDIR += $$(USERPROFILE)
}
else {
HOMEDIR += $$(PWD)
}
INCLUDEPATH += "$$HOMEDIR/.platformio/packages/framework-arduinoavr/cores/arduino"
INCLUDEPATH += "$$HOMEDIR/.platformio/packages/toolchain-atmelavr/avr/include"
win32:INCLUDEPATH ~= s,/,\\,g
.. image:: ../_static/ide-platformio-qtcreator-4.png
First program in Qt Creator
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Simple "Blink" project will consist from two files:
1. Main "C" source file named ``main.c`` must be located in the ``src`` directory.
Let's create new text file named ``main.c`` using ``Menu: New File or Project → General → Text File``:
.. image:: ../_static/ide-platformio-qtcreator-5.png
Copy the source code which is described below to file ``main.c``.
.. code-block:: c
#include "Arduino.h"
#define WLED 13 // Most Arduino boards already have an LED attached to pin 13 on the board itself
void setup()
{
pinMode(WLED, OUTPUT); // set pin as output
}
void loop()
{
digitalWrite(WLED, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(WLED, LOW); // set the LED off
delay(1000); // wait for a second
}
2. Project Configuration File named ``platformio.ini`` must be located in the project root directory.
.. image:: ../_static/ide-platformio-qtcreator-6.png
Copy the source code which is described below to it.
.. code-block:: none
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
[env:arduino_uno]
platform = atmelavr
framework = arduino
board = uno
Conclusion
----------
Taking everything into account, we can build project with shortcut ``Ctrl+Shift+B`` or using ``Menu: Build → Build All``:
.. image:: ../_static/ide-platformio-qtcreator-7.png

View File

@ -0,0 +1,23 @@
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
# Simple and base environment
# [env:mybaseenv]
# platform = %INSTALLED_PLATFORM_NAME_HERE%
# framework =
# board =
#
# Automatic targets - enable auto-uploading
# targets = upload
[env:arduino_uno]
platform = atmelavr
framework = arduino
board = uno

View File

@ -0,0 +1,19 @@
win32 {
HOMEDIR += $$(USERPROFILE)
}
else {
HOMEDIR += $$(PWD)
}
INCLUDEPATH += "$$HOMEDIR/.platformio/packages/framework-arduinoavr/cores/arduino"
INCLUDEPATH += "$$HOMEDIR/.platformio/packages/toolchain-atmelavr/avr/include"
win32:INCLUDEPATH ~= s,/,\\,g
# DEFINES += __AVR_ATmega328__
OTHER_FILES += \
platformio.ini
SOURCES += \
src/main.c

View File

@ -0,0 +1,25 @@
#include "Arduino.h"
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
int led = 1; // blink 'digital' pin 1 - AKA the built in red LED
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}

View File

@ -0,0 +1,23 @@
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
# Simple and base environment
# [env:mybaseenv]
# platform = %INSTALLED_PLATFORM_NAME_HERE%
# framework =
# board =
#
# Automatic targets - enable auto-uploading
# targets = upload
[env:flora8]
platform = atmelavr
framework = arduino
board = flora8

View File

@ -0,0 +1,43 @@
{
"build_systems":
[
{
"cmd":
[
"platformio",
"run"
],
"name": "PlatformIO",
"variants":
[
{
"cmd":
[
"platformio",
"run",
"-t",
"clean"
],
"name": "Clean"
},
{
"cmd":
[
"platformio",
"run",
"-t",
"upload"
],
"name": "Upload"
}
],
"working_dir": "${project_path:${folder}}"
}
],
"folders":
[
{
"path": "."
}
]
}

View File

@ -0,0 +1,24 @@
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
int led = 1; // blink 'digital' pin 1 - AKA the built in red LED
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{0FA9C3A8-452B-41EF-A418-9102B170F49F}</ProjectGuid>
<Keyword>MakeFileProj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<NMakeBuildCommandLine>platformio run</NMakeBuildCommandLine>
<NMakeCleanCommandLine>platformio run -t clean</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>WIN32;_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<NMakeIncludeSearchPath>$(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\toolchain-atmelavr\avr\include;$(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\framework-arduinoavr\cores\arduino;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<NMakeBuildCommandLine>platformio run</NMakeBuildCommandLine>
<NMakeCleanCommandLine>platformio run -t clean</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<NMakeIncludeSearchPath>$(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\toolchain-atmelavr\avr\include;$(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\framework-arduinoavr\cores\arduino;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
</PropertyGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="readme.txt" />
</ItemGroup>
<ItemGroup>
<None Include="platformio.ini" />
<None Include="src\blink.pde" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Source Files\src">
<UniqueIdentifier>{cad450ef-1a84-42d4-a5b5-a1736b8833d3}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<Text Include="readme.txt" />
</ItemGroup>
<ItemGroup>
<None Include="platformio.ini" />
<None Include="src\blink.pde">
<Filter>Source Files\src</Filter>
</None>
</ItemGroup>
</Project>

View File

@ -0,0 +1,23 @@
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
# Simple and base environment
# [env:mybaseenv]
# platform = %INSTALLED_PLATFORM_NAME_HERE%
# framework =
# board =
#
# Automatic targets - enable auto-uploading
# targets = upload
[env:arduino_uno]
platform = atmelavr
framework = arduino
board = uno

View File

@ -0,0 +1,24 @@
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
int led = 1; // blink 'digital' pin 1 - AKA the built in red LED
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}

View File

@ -41,3 +41,9 @@ board = frdm_kl25z
platform = ststm32
framework = mbed
board = nucleo_f401re
# Teensy Platform
[env:teensy31]
platform = teensy
framework = mbed
board = teensy31

View File

@ -1,12 +1,12 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
VERSION = (1, 4, 0)
VERSION = (1, 5, 0)
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio"
__description__ = ("A cross-platform code builder and the missing library "
"manager (Atmel AVR & SAM, Freescale Kinetis, "
"manager (Atmel AVR & SAM, Espressif, Freescale Kinetis, "
"Nordic nRF51, NXP LPC, ST STM32, TI MSP430 & Tiva, "
"Teensy, Arduino, mbed, libOpenCM3, etc.)")
__url__ = "http://platformio.org"

View File

@ -62,7 +62,7 @@
"mcu": "mk20dx256",
"cpu": "cortex-m4"
},
"frameworks": ["arduino"],
"frameworks": ["arduino", "mbed"],
"name": "Teensy 3.1",
"platform": "teensy",
"upload": {

View File

@ -53,7 +53,8 @@ MBED_VARIANTS = {
"frdm_k64f": "K64F",
"frdm_kl05z": "KL05Z",
"frdm_k20d50m": "K20D50M",
"frdm_k22f": "K22F"
"frdm_k22f": "K22F",
"teensy31": "TEENSY3_1"
}
MBED_LIBS_MAP = {
@ -177,6 +178,20 @@ def get_build_flags(data):
return flags
def _mbed_whole_archive_hook(flags):
if (not isinstance(flags, list) or
env.get("BOARD_OPTIONS", {}).get("platform") != "ststm32"):
return flags
for pos, flag in enumerate(flags[:]):
if isinstance(flag, basestring):
continue
flags.insert(pos, "-Wl,-whole-archive")
flags.insert(pos + 2, "-Wl,-no-whole-archive")
return flags
board_type = env.subst("$BOARD")
variant = MBED_VARIANTS[
board_type] if board_type in MBED_VARIANTS else board_type.upper()
@ -187,6 +202,8 @@ build_flags = get_build_flags(eixdata)
variant_dir = join("$PLATFORMFW_DIR", "variant", variant)
env.Replace(
_mbed_whole_archive_hook=_mbed_whole_archive_hook,
_LIBFLAGS="${_mbed_whole_archive_hook(%s)}" % env.get("_LIBFLAGS")[2:-1],
CPPFLAGS=build_flags.get("CPPFLAGS", []),
CFLAGS=build_flags.get("CFLAGS", []),
CXXFLAGS=build_flags.get("CXXFLAGS", []),

View File

@ -6,25 +6,46 @@
"""
import platform
from os.path import join
from os.path import isfile, join
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default,
DefaultEnvironment, SConscript)
DefaultEnvironment, Exit, SConscript)
env = DefaultEnvironment()
SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py")))
env.Replace(
UPLOADER=join("$PIOPACKAGES_DIR", "tool-stlink", "st-flash"),
UPLOADERFLAGS=[
"write", # write in flash
"$SOURCES", # firmware path to flash
"0x08000000" # flash start adress
],
if env['UPLOAD_PROTOCOL'] == "gdb":
if not isfile(join(env.subst("$PROJECT_DIR"), "upload.gdb")):
Exit(
"You are using GDB as firmware uploader. "
"Please specify upload commands in upload.gdb "
"file in project directory!"
)
env.Replace(
UPLOADER=join(
"$PIOPACKAGES_DIR", "toolchain-gccarmnoneeabi",
"bin", "arm-none-eabi-gdb"
),
UPLOADERFLAGS=[
join("$BUILD_DIR", "firmware.elf"),
"-batch",
"-x", join("$PROJECT_DIR", "upload.gdb")
],
UPLOADCMD="$UPLOADER $UPLOADERFLAGS"
)
UPLOADCMD="$UPLOADER $UPLOADERFLAGS"
)
else:
env.Replace(
UPLOADER=join("$PIOPACKAGES_DIR", "tool-stlink", "st-flash"),
UPLOADERFLAGS=[
"write", # write in flash
"$SOURCES", # firmware path to flash
"0x08000000" # flash start adress
],
UPLOADCMD="$UPLOADER $UPLOADERFLAGS"
)
env.Append(

View File

@ -40,6 +40,7 @@ if isfile(env.subst(join(
UPLOADERFLAGS=[
"-mmcu=$BOARD_MCU",
"-w", # wait for device to apear
"-s", # soft reboot if device not online
"-v" # verbose output
],
UPLOADHEXCMD='"$UPLOADER" $UPLOADERFLAGS $SOURCES'

View File

@ -2,6 +2,7 @@
# See LICENSE for details.
from os.path import join
from platform import system
from shutil import copyfile
from time import sleep
@ -23,6 +24,12 @@ def FlushSerialBuffer(env, port):
def TouchSerialPort(env, port, baudrate):
if system() == "Linux":
try:
s = Serial(env.subst(port))
s.close()
except: # pylint: disable=W0702
pass
s = Serial(port=env.subst(port), baudrate=baudrate)
s.setDTR(False)
s.close()

View File

@ -15,18 +15,13 @@ from platformio.util import pioversion_to_intstr
def BuildFirmware(env):
# fix ASM handling under non-casitive OS
if not case_sensitive_suffixes('.s', '.S'):
if not case_sensitive_suffixes(".s", ".S"):
env.Replace(
AS="$CC",
ASCOM="$ASPPCOM"
)
if "extra_flags" in env.get("BOARD_OPTIONS", {}).get("build", {}):
env.MergeFlags(env.subst("${BOARD_OPTIONS['build']['extra_flags']}"))
if "BUILD_FLAGS" in env:
env.MergeFlags(env['BUILD_FLAGS'])
env.ProcessFlags()
env.BuildFramework()
firmenv = env.Clone()
@ -69,6 +64,22 @@ def BuildFirmware(env):
)
def ProcessFlags(env):
if "extra_flags" in env.get("BOARD_OPTIONS", {}).get("build", {}):
env.MergeFlags(env.subst("${BOARD_OPTIONS['build']['extra_flags']}"))
if "BUILD_FLAGS" in env:
env.MergeFlags(env['BUILD_FLAGS'])
# Cancel any previous definition of name, either built in or
# provided with a -D option // Issue #191
undefines = [f for f in env.get("CCFLAGS", []) if f.startswith("-U")]
if undefines:
for undef in undefines:
env['CCFLAGS'].remove(undef)
env.Append(_CPPDEFFLAGS=" %s" % " ".join(undefines))
def GlobCXXFiles(env, path):
files = []
for suff in ["*.c", "*.cpp", "*.S"]:
@ -84,7 +95,7 @@ def VariantDirRecursive(env, variant_dir, src_dir, duplicate=True,
ignore_pattern = (".git", ".svn")
variants = []
src_dir = env.subst(src_dir)
for root, _, _ in walk(src_dir):
for root, _, _ in walk(src_dir, followlinks=True):
_src_dir = root
_var_dir = variant_dir + root.replace(src_dir, "")
if any([s in _var_dir.lower() for s in ignore_pattern]):
@ -213,22 +224,17 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
return result
def _process_src_dir(state, src_dir):
for root, _, _ in walk(src_dir):
for root, _, _ in walk(src_dir, followlinks=True):
for node in (env.GlobCXXFiles(root) +
env.Glob(join(root, "*.h"))):
state = _parse_includes(state, node)
return state
def _parse_includes(state, node):
if node.path in state['paths']:
return state
else:
state['paths'].add(node.path)
skip_includes = ("arduino.h", "energia.h")
matches = INCLUDES_RE.findall(node.get_text_contents())
for (inc_type, inc_name) in matches:
base_dir = dirname(node.path)
base_dir = dirname(node.get_abspath())
if inc_name.lower() in skip_includes:
continue
if join(base_dir, inc_name) in state['paths']:
@ -378,6 +384,7 @@ def exists(_):
def generate(env):
env.AddMethod(BuildFirmware)
env.AddMethod(ProcessFlags)
env.AddMethod(GlobCXXFiles)
env.AddMethod(VariantDirRecursive)
env.AddMethod(BuildFramework)

View File

@ -40,7 +40,7 @@ def cli(query, json_output):
for item in data:
click.secho(item['type'], fg="cyan", nl=False)
click.echo(" (available packages: %s)" % ", ".join(
p.get_packages().keys()))
item.get("packages").keys()))
click.secho("-" * len(item['type']), fg="cyan")
click.echo(item['description'])
click.echo()

View File

@ -1,5 +1,5 @@
click==3.3
click==4.0
colorama==0.3.3
pyserial==2.7
requests==2.6.0
requests==2.7.0
scons==2.3.0

View File

@ -42,7 +42,7 @@ setup(
"Topic :: Software Development :: Build Tools",
"Topic :: Software Development :: Compilers"
],
keywords=("builder library manager atmel avr sam freescale kinetis nordic "
"nrf51 nxp lpc st stm32 ti msp430 tiva teensy arduino mbed "
"libopencm3")
keywords=("builder library manager atmel avr sam espressif esp freescale "
"kinetis nordic nrf51 nxp lpc st stm32 ti msp430 tiva teensy "
"arduino mbed libopencm3")
)

View File

@ -21,7 +21,14 @@ deps =
commands =
sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
sphinx-build -W -b latex -d {envtmpdir}/doctrees docs docs/_build/latex
/bin/bash -c "if [[ $CI != 'true' ]]; then sphinx-build -W -b linkcheck docs docs/_build/html; fi"
[testenv:docslinkcheck]
basepython = python2.7
deps =
sphinx
sphinx_rtd_theme
commands =
sphinx-build -W -b linkcheck docs docs/_build/html
[testenv:lint]
basepython = python2.7