Merge pull request #123 from valeros/develop

Fix mbed framework // Resolve #122
This commit is contained in:
Ivan Kravets
2015-03-16 12:42:06 +02:00
4 changed files with 76 additions and 2 deletions

View File

@ -0,0 +1,21 @@
How to buid PlatformIO based project
====================================
1. `Install PlatformIO <http://docs.platformio.org/en/latest/installation.html>`_
2. Download `source code with examples <https://github.com/ivankravets/platformio/archive/develop.zip>`_
3. Extract ZIP archive
4. Run these commands:
.. code-block:: bash
# Change directory to example
> cd platformio-develop/examples/mbed/mbed-serial
# Process example project
> platformio run
# Upload firmware
> platformio run --target upload
# Clean build files
> platformio run --target clean

View File

@ -0,0 +1,43 @@
#
# 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
# NXP LPC Platform
[env:lpc1768]
platform = nxplpc
framework = mbed
board = lpc1768
# Nordic nRF51 Platform
[env:nrf51_mkit]
platform = nordicnrf51
framework = mbed
board = nrf51_mkit
# Freescale FRDM Platform
[env:frdm_kl25z]
platform = freescalekinetis
framework = mbed
board = frdm_kl25z
# ST STM32 Platform
[env:nucleo_f401re]
platform = ststm32
framework = mbed
board = nucleo_f401re

View File

@ -0,0 +1,10 @@
#include "mbed.h"
Serial pc(USBTX, USBRX); // tx, rx
int main() {
pc.printf("Hello World!\n\r");
while(1) {
pc.putc(pc.getc() + 1); // echo input back to terminal
}
}

View File

@ -125,8 +125,7 @@ for lib_path in eixdata.get("CPPPATH"):
env.Append(
LIBPATH=[join(variant_dir, lib_path)
for lib_path in eixdata.get("LIBPATH", [])
if lib_path.startswith("mbed")],
LIBS=["mbed"]
if lib_path.startswith("mbed")]
)
#
@ -134,6 +133,7 @@ env.Append(
#
libs = [l for l in eixdata.get("STDLIBS", []) if l not in env.get("LIBS")]
libs.append("mbed")
libs.append(env.Library(
join("$BUILD_DIR", "FrameworkMbed"),