Skip to content

Commit 9357ef8

Browse files
committed
Merge branch 'release/v0.4.0'
2 parents bf0df40 + 3b28b45 commit 9357ef8

File tree

12 files changed

+289
-3
lines changed

12 files changed

+289
-3
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ python:
55
env:
66
- PLATFORMIO_PROJECT_DIR=examples/arduino-blink
77
- PLATFORMIO_PROJECT_DIR=examples/arduino-wifiscan
8+
- PLATFORMIO_PROJECT_DIR=examples/espidf-hello-world
89
- PLATFORMIO_PROJECT_DIR=examples/espidf-http-request
910
- PLATFORMIO_PROJECT_DIR=examples/simba-blink
11+
- PLATFORMIO_PROJECT_DIR=examples/pumbaa-blink
1012

1113
install:
1214
- pip install -U https://github.com/platformio/platformio/archive/develop.zip

appveyor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ environment:
44
matrix:
55
- PLATFORMIO_PROJECT_DIR: "examples/arduino-blink"
66
- PLATFORMIO_PROJECT_DIR: "examples/arduino-wifiscan"
7+
- PLATFORMIO_PROJECT_DIR: "examples/espidf-hello-world"
78
- PLATFORMIO_PROJECT_DIR: "examples/espidf-http-request"
9+
- PLATFORMIO_PROJECT_DIR: "examples/simba-blink"
10+
- PLATFORMIO_PROJECT_DIR: "examples/pumbaa-blink"
811

912
install:
1013
- cmd: git submodule update --init --recursive

boards/nano32.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"frameworks": [
1313
"arduino",
1414
"espidf",
15-
"simba"
15+
"simba",
16+
"pumbaa"
1617
],
1718
"name": "MakerAsia Nano32",
1819
"upload": {

builder/frameworks/pumbaa.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Copyright 2014-present PlatformIO <[email protected]>
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Pumbaa
16+
17+
Pumbaa is Python on top of Simba.
18+
19+
The implementation is a port of MicroPython, designed for embedded
20+
devices with limited amount of RAM and code memory.
21+
22+
http://pumbaa.readthedocs.org
23+
24+
"""
25+
26+
from os.path import join, sep
27+
28+
from SCons.Script import DefaultEnvironment, SConscript
29+
30+
from platformio.builder.tools import platformio as platformio_tool
31+
32+
#
33+
# Backward compatibility with PlatformIO 2.0
34+
#
35+
platformio_tool.SRC_DEFAULT_FILTER = " ".join([
36+
"+<*>", "-<.git%s>" % sep, "-<svn%s>" % sep,
37+
"-<example%s>" % sep, "-<examples%s>" % sep,
38+
"-<test%s>" % sep, "-<tests%s>" % sep
39+
])
40+
41+
42+
def LookupSources(env, variant_dir, src_dir, duplicate=True, src_filter=None):
43+
return env.CollectBuildFiles(variant_dir, src_dir, src_filter, duplicate)
44+
45+
46+
def VariantDirWrap(env, variant_dir, src_dir, duplicate=False):
47+
env.VariantDir(variant_dir, src_dir, duplicate)
48+
49+
50+
env = DefaultEnvironment()
51+
52+
env.AddMethod(LookupSources)
53+
env.AddMethod(VariantDirWrap)
54+
55+
env.Replace(
56+
PLATFORMFW_DIR=env.PioPlatform().get_package_dir("framework-pumbaa")
57+
)
58+
59+
SConscript(
60+
[env.subst(join("$PLATFORMFW_DIR", "make", "platformio.sconscript"))])

examples/pumbaa-blink/.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/pumbaa-blink/.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 choice 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/pumbaa-blink/README.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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-espressif32/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-espressif32/examples/pumbaa-blink
24+
25+
# Process example project
26+
> platformio run
27+
28+
# Upload firmware
29+
> platformio run --target upload

examples/pumbaa-blink/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 organised `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/pumbaa-blink/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:nano32]
11+
platform = espressif32
12+
framework = pumbaa
13+
board = nano32

examples/pumbaa-blink/src/main.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* @file main.c
3+
*
4+
* @section License
5+
* Copyright (C) 2015-2016, Erik Moqvist
6+
*
7+
* This library is free software; you can redistribute it and/or
8+
* modify it under the terms of the GNU Lesser General Public
9+
* License as published by the Free Software Foundation; either
10+
* version 2.1 of the License, or (at your option) any later version.
11+
*
12+
* This library is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* This file is part of the Pumbaa project.
18+
*/
19+
20+
/*
21+
* This file is required by PlatformIO, but is unused in Pumbaa.
22+
*/

examples/pumbaa-blink/src/main.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#
2+
# @section License
3+
#
4+
# The MIT License (MIT)
5+
#
6+
# Copyright (c) 2016, Erik Moqvist
7+
#
8+
# Permission is hereby granted, free of charge, to any person
9+
# obtaining a copy of this software and associated documentation
10+
# files (the "Software"), to deal in the Software without
11+
# restriction, including without limitation the rights to use, copy,
12+
# modify, merge, publish, distribute, sublicense, and/or sell copies
13+
# of the Software, and to permit persons to whom the Software is
14+
# furnished to do so, subject to the following conditions:
15+
#
16+
# The above copyright notice and this permission notice shall be
17+
# included in all copies or substantial portions of the Software.
18+
#
19+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
23+
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24+
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26+
# SOFTWARE.
27+
#
28+
# This file is part of the Pumbaa project.
29+
#
30+
31+
32+
import time
33+
import board
34+
from drivers import Pin
35+
36+
LED = Pin(board.PIN_LED, Pin.OUTPUT)
37+
38+
while True:
39+
LED.toggle()
40+
time.sleep(0.5)

platform.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
"type": "git",
1313
"url": "https://github.com/platformio/platform-espressif32.git"
1414
},
15-
"version": "0.3.0",
15+
"version": "0.4.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",
1919
"http://dl.platformio.org/packages/manifest.json",
20-
"https://raw.githubusercontent.com/eerimoq/simba/master/make/platformio/manifest.json"
20+
"https://raw.githubusercontent.com/eerimoq/simba/master/make/platformio/manifest.json",
21+
"https://raw.githubusercontent.com/eerimoq/pumbaa/master/make/platformio/manifest.json"
2122
],
2223
"frameworks": {
2324
"arduino": {
@@ -31,6 +32,10 @@
3132
"simba": {
3233
"package": "framework-simba",
3334
"script": "builder/frameworks/simba.py"
35+
},
36+
"pumbaa": {
37+
"package": "framework-pumbaa",
38+
"script": "builder/frameworks/pumbaa.py"
3439
}
3540
},
3641
"packages": {
@@ -53,6 +58,11 @@
5358
"optional": true,
5459
"version": ">=12.2.0"
5560
},
61+
"framework-pumbaa": {
62+
"type": "framework",
63+
"optional": true,
64+
"version": ">=2.3.0"
65+
},
5666
"tool-esptoolpy": {
5767
"type": "uploader",
5868
"version": "~1.0.0"

0 commit comments

Comments
 (0)