mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Merge pull request #123 from valeros/develop
Fix mbed framework // Resolve #122
This commit is contained in:
21
examples/mbed/mbed-serial/README.rst
Normal file
21
examples/mbed/mbed-serial/README.rst
Normal 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
|
43
examples/mbed/mbed-serial/platformio.ini
Normal file
43
examples/mbed/mbed-serial/platformio.ini
Normal 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
|
10
examples/mbed/mbed-serial/src/main.cpp
Normal file
10
examples/mbed/mbed-serial/src/main.cpp
Normal 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
|
||||||
|
}
|
||||||
|
}
|
@ -125,8 +125,7 @@ for lib_path in eixdata.get("CPPPATH"):
|
|||||||
env.Append(
|
env.Append(
|
||||||
LIBPATH=[join(variant_dir, lib_path)
|
LIBPATH=[join(variant_dir, lib_path)
|
||||||
for lib_path in eixdata.get("LIBPATH", [])
|
for lib_path in eixdata.get("LIBPATH", [])
|
||||||
if lib_path.startswith("mbed")],
|
if lib_path.startswith("mbed")]
|
||||||
LIBS=["mbed"]
|
|
||||||
)
|
)
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -134,6 +133,7 @@ env.Append(
|
|||||||
#
|
#
|
||||||
|
|
||||||
libs = [l for l in eixdata.get("STDLIBS", []) if l not in env.get("LIBS")]
|
libs = [l for l in eixdata.get("STDLIBS", []) if l not in env.get("LIBS")]
|
||||||
|
libs.append("mbed")
|
||||||
|
|
||||||
libs.append(env.Library(
|
libs.append(env.Library(
|
||||||
join("$BUILD_DIR", "FrameworkMbed"),
|
join("$BUILD_DIR", "FrameworkMbed"),
|
||||||
|
Reference in New Issue
Block a user