Skip to content

Commit c1fe7a8

Browse files
committed
Merge branch 'release/v1.6.0'
2 parents 6276295 + 5e4d449 commit c1fe7a8

File tree

9 files changed

+177
-9
lines changed

9 files changed

+177
-9
lines changed

builder/frameworks/mbed

Submodule mbed updated 1 file

builder/main.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,12 @@
176176
ASFLAGS=env.get("CCFLAGS", [])[:]
177177
)
178178

179-
if isfile(
180-
join(
181-
platform.get_package_dir("tool-teensy") or "",
182-
"teensy_loader_cli")):
179+
if any([
180+
isfile(
181+
join(
182+
platform.get_package_dir("tool-teensy") or "",
183+
"teensy_loader_cli%s" % b)) for b in ("", ".exe")
184+
]):
183185
env.Append(
184186
UPLOADER="teensy_loader_cli",
185187
UPLOADERFLAGS=[
@@ -194,8 +196,8 @@
194196
REBOOTER="teensy_reboot",
195197
UPLOADER="teensy_post_compile",
196198
UPLOADERFLAGS=[
197-
"-file=firmware", '-path="$BUILD_DIR"',
198-
'-tools="%s"' % (platform.get_package_dir("tool-teensy") or "")
199+
"-file=firmware", '-path=$BUILD_DIR',
200+
'-tools=%s' % (platform.get_package_dir("tool-teensy") or "")
199201
],
200202
UPLOADHEXCMD='$UPLOADER $UPLOADERFLAGS')
201203

examples/mbed-events/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.pioenvs
2+
.clang_complete
3+
.gcc-flags.json

examples/mbed-events/.travis.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Continuous Integration (CI) is the practice, in software
2+
# engineering, of merging all developer working copies with a shared mainline
3+
# several times a day < http://docs.platformio.org/en/stable/ci/index.html >
4+
#
5+
# Documentation:
6+
#
7+
# * Travis CI Embedded Builds with PlatformIO
8+
# < https://docs.travis-ci.com/user/integration/platformio/ >
9+
#
10+
# * PlatformIO integration with Travis CI
11+
# < http://docs.platformio.org/en/stable/ci/travis.html >
12+
#
13+
# * User Guide for `platformio ci` command
14+
# < http://docs.platformio.org/en/stable/userguide/cmd_ci.html >
15+
#
16+
#
17+
# Please choose one of the following templates (proposed below) and uncomment
18+
# it (remove "# " before each line) or use own configuration according to the
19+
# Travis CI documentation (see above).
20+
#
21+
22+
23+
#
24+
# Template #1: General project. Test it using existing `platformio.ini`.
25+
#
26+
27+
# language: python
28+
# python:
29+
# - "2.7"
30+
#
31+
# sudo: false
32+
# cache:
33+
# directories:
34+
# - "~/.platformio"
35+
#
36+
# install:
37+
# - pip install -U platformio
38+
#
39+
# script:
40+
# - platformio run
41+
42+
43+
#
44+
# Template #2: The project is intended to by used as a library with examples
45+
#
46+
47+
# language: python
48+
# python:
49+
# - "2.7"
50+
#
51+
# sudo: false
52+
# cache:
53+
# directories:
54+
# - "~/.platformio"
55+
#
56+
# env:
57+
# - PLATFORMIO_CI_SRC=path/to/test/file.c
58+
# - PLATFORMIO_CI_SRC=examples/file.ino
59+
# - PLATFORMIO_CI_SRC=path/to/test/directory
60+
#
61+
# install:
62+
# - pip install -U platformio
63+
#
64+
# script:
65+
# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N

examples/mbed-events/README.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.. Copyright 2014-present PlatformIO <[email protected]>
2+
Licensed under the Apache License, Version 2.0 (the "License");
3+
you may not use this file except in compliance with the License.
4+
You may obtain a copy of the License at
5+
http://www.apache.org/licenses/LICENSE-2.0
6+
Unless required by applicable law or agreed to in writing, software
7+
distributed under the License is distributed on an "AS IS" BASIS,
8+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
See the License for the specific language governing permissions and
10+
limitations under the License.
11+
12+
How to build PlatformIO based project
13+
=====================================
14+
15+
1. `Install PlatformIO <http://docs.platformio.org/en/stable/installation.html>`_
16+
2. Download `development platform with examples <https://github.com/platformio/platform-teensy/archive/develop.zip>`_
17+
3. Extract ZIP archive
18+
4. Run these commands:
19+
20+
.. code-block:: bash
21+
22+
# Change directory to example
23+
> cd platform-teensy/examples/mbed-events
24+
25+
# Build project
26+
> platformio run
27+
28+
# Upload firmware
29+
> platformio run --target upload
30+
31+
# Clean build files
32+
> platformio run --target clean

examples/mbed-events/lib/readme.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
This directory is intended for the project specific (private) libraries.
3+
PlatformIO will compile them to static libraries and link to executable file.
4+
5+
The source code of each library should be placed in separate directory, like
6+
"lib/private_lib/[here are source files]".
7+
8+
For example, see how can be organized `Foo` and `Bar` libraries:
9+
10+
|--lib
11+
| |--Bar
12+
| | |--docs
13+
| | |--examples
14+
| | |--src
15+
| | |- Bar.c
16+
| | |- Bar.h
17+
| |--Foo
18+
| | |- Foo.c
19+
| | |- Foo.h
20+
| |- readme.txt --> THIS FILE
21+
|- platformio.ini
22+
|--src
23+
|- main.c
24+
25+
Then in `src/main.c` you should use:
26+
27+
#include <Foo.h>
28+
#include <Bar.h>
29+
30+
// rest H/C/CPP code
31+
32+
PlatformIO will find your libraries automatically, configure preprocessor's
33+
include paths and build them.
34+
35+
See additional options for PlatformIO Library Dependency Finder `lib_*`:
36+
37+
http://docs.platformio.org/en/stable/projectconf.html#lib-install
38+

examples/mbed-events/platformio.ini

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
; PlatformIO Project Configuration File
2+
;
3+
; Build options: build flags, source filter, extra scripting
4+
; Upload options: custom port, speed and extra flags
5+
; Library options: dependencies, extra library storages
6+
;
7+
; Please visit documentation for the other options and examples
8+
; http://docs.platformio.org/en/stable/projectconf.html
9+
10+
[env:teensy31]
11+
platform = teensy
12+
framework = mbed
13+
board = teensy31

examples/mbed-events/src/main.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include "mbed_events.h"
2+
#include <stdio.h>
3+
4+
int main() {
5+
// creates a queue with the default size
6+
EventQueue queue;
7+
8+
// events are simple callbacks
9+
queue.call(printf, "called immediately\n");
10+
queue.call_in(2000, printf, "called in 2 seconds\n");
11+
queue.call_every(1000, printf, "called every 1 seconds\n");
12+
13+
// events are executed by the dispatch method
14+
queue.dispatch();
15+
}

platform.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"type": "git",
1313
"url": "https://github.com/platformio/platform-teensy.git"
1414
},
15-
"version": "1.5.0",
15+
"version": "1.6.0",
1616
"packageRepositories": [
1717
"https://dl.bintray.com/platformio/dl-packages/manifest.json",
1818
"https://sourceforge.net/projects/platformio-storage/files/packages/manifest.json/download",
@@ -42,7 +42,7 @@
4242
"framework-arduinoteensy": {
4343
"type": "framework",
4444
"optional": true,
45-
"version": "~1.131.0"
45+
"version": "~1.135.0"
4646
},
4747
"framework-mbed": {
4848
"type": "framework",

0 commit comments

Comments
 (0)