Skip to content

Commit 96a04be

Browse files
committed
Merge branch 'release/v2.0.0'
2 parents 394e85f + 4f4f588 commit 96a04be

File tree

55 files changed

+1011
-348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1011
-348
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: python
22
python:
33
- "2.7"
4+
- "3.6"
45

56
env:
67
- PLATFORMIO_PROJECT_DIR=examples/arduino-asyncudp

boards/d1_mini.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"esp8266-rtos-sdk",
1818
"esp8266-nonos-sdk"
1919
],
20-
"name": "WeMos D1 R2 & mini",
20+
"name": "WeMos D1 R2 and mini",
2121
"upload": {
2222
"maximum_ram_size": 81920,
2323
"maximum_size": 4194304,

boards/esp8285.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"name": "Generic ESP8285 Module",
2121
"upload": {
2222
"maximum_ram_size": 81920,
23-
"maximum_size": 434160,
23+
"maximum_size": 1048576,
2424
"require_upload_port": true,
2525
"resetmethod": "ck",
2626
"speed": 115200

boards/inventone.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"build": {
3+
"core": "esp8266",
4+
"extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_GENERIC",
5+
"f_cpu": "80000000L",
6+
"f_flash": "40000000L",
7+
"flash_mode": "dio",
8+
"ldscript": "eagle.flash.4m1m.ld",
9+
"mcu": "esp8266",
10+
"variant": "inventone"
11+
},
12+
"connectivity": [
13+
"wifi"
14+
],
15+
"frameworks": [
16+
"arduino",
17+
"simba",
18+
"esp8266-rtos-sdk",
19+
"esp8266-nonos-sdk"
20+
],
21+
"name": "Invent One",
22+
"upload": {
23+
"maximum_ram_size": 81920,
24+
"maximum_size": 4194304,
25+
"require_upload_port": true,
26+
"resetmethod": "nodemcu",
27+
"speed": 115200
28+
},
29+
"url": "https://inventone.ng/",
30+
"vendor": "Invent One"
31+
}

boards/wifi_slot.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"f_cpu": "80000000L",
66
"f_flash": "40000000L",
77
"flash_mode": "qio",
8-
"ldscript": "eagle.flash.1m0.ld",
8+
"ldscript": "eagle.flash.1m.ld",
99
"mcu": "esp8266",
1010
"variant": "wifi_slot"
1111
},

builder/main.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# pylint: disable=redefined-outer-name
1616

1717
import re
18+
import socket
1819
from os.path import join
1920

2021

@@ -183,6 +184,12 @@ def _update_max_upload_size(env):
183184
SIZECHECKCMD="$SIZETOOL -A -d $SOURCES",
184185
SIZEPRINTCMD='$SIZETOOL -B -d $SOURCES',
185186

187+
ERASEFLAGS=[
188+
"-cp", "$UPLOAD_PORT",
189+
"-cd", "$UPLOAD_RESETMETHOD"
190+
],
191+
ERASECMD='esptool $ERASEFLAGS -ce',
192+
186193
PROGSUFFIX=".elf"
187194
)
188195

@@ -261,9 +268,10 @@ def _update_max_upload_size(env):
261268
# Handle uploading via OTA
262269
ota_port = None
263270
if env.get("UPLOAD_PORT"):
264-
ota_port = re.match(
265-
r"\"?((([0-9]{1,3}\.){3}[0-9]{1,3})|[^\\/]+\.[^\\/]+)\"?$",
266-
env.get("UPLOAD_PORT"))
271+
try:
272+
ota_port = socket.gethostbyname(env.get("UPLOAD_PORT"))
273+
except socket.error:
274+
pass
267275
if ota_port:
268276
env.Replace(UPLOADCMD="$UPLOADOTACMD")
269277

@@ -374,6 +382,17 @@ def _update_max_upload_size(env):
374382
env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")])
375383
env.AlwaysBuild(target_upload)
376384

385+
#
386+
# Target: Erase Flash
387+
#
388+
389+
AlwaysBuild(
390+
env.Alias("erase", None, [
391+
env.VerboseAction(env.AutodetectUploadPort,
392+
"Looking for serial port..."),
393+
env.VerboseAction("$ERASECMD", "Ready for erasing")
394+
]))
395+
377396

378397
#
379398
# Default targets

examples/arduino-asyncudp/.gitignore

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

examples/arduino-asyncudp/.travis.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Continuous Integration (CI) is the practice, in software
22
# engineering, of merging all developer working copies with a shared mainline
3-
# several times a day < http://docs.platformio.org/page/ci/index.html >
3+
# several times a day < https://docs.platformio.org/page/ci/index.html >
44
#
55
# Documentation:
66
#
77
# * Travis CI Embedded Builds with PlatformIO
88
# < https://docs.travis-ci.com/user/integration/platformio/ >
99
#
1010
# * PlatformIO integration with Travis CI
11-
# < http://docs.platformio.org/page/ci/travis.html >
11+
# < https://docs.platformio.org/page/ci/travis.html >
1212
#
1313
# * User Guide for `platformio ci` command
14-
# < http://docs.platformio.org/page/userguide/cmd_ci.html >
14+
# < https://docs.platformio.org/page/userguide/cmd_ci.html >
1515
#
1616
#
1717
# Please choose one of the following templates (proposed below) and uncomment
@@ -35,13 +35,14 @@
3535
#
3636
# install:
3737
# - pip install -U platformio
38+
# - platformio update
3839
#
3940
# script:
4041
# - platformio run
4142

4243

4344
#
44-
# Template #2: The project is intended to by used as a library with examples
45+
# Template #2: The project is intended to be used as a library with examples.
4546
#
4647

4748
# language: python
@@ -60,6 +61,7 @@
6061
#
6162
# install:
6263
# - pip install -U platformio
64+
# - platformio update
6365
#
6466
# script:
6567
# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
This directory is intended for project header files.
3+
4+
A header file is a file containing C declarations and macro definitions
5+
to be shared between several project source files. You request the use of a
6+
header file in your project source file (C, C++, etc) located in `src` folder
7+
by including it, with the C preprocessing directive `#include'.
8+
9+
```src/main.c
10+
11+
#include "header.h"
12+
13+
int main (void)
14+
{
15+
...
16+
}
17+
```
18+
19+
Including a header file produces the same results as copying the header file
20+
into each source file that needs it. Such copying would be time-consuming
21+
and error-prone. With a header file, the related declarations appear
22+
in only one place. If they need to be changed, they can be changed in one
23+
place, and programs that include the header file will automatically use the
24+
new version when next recompiled. The header file eliminates the labor of
25+
finding and changing all the copies as well as the risk that a failure to
26+
find one copy will result in inconsistencies within a program.
27+
28+
In C, the usual convention is to give header files names that end with `.h'.
29+
It is most portable to use only letters, digits, dashes, and underscores in
30+
header file names, and at most one dot.
31+
32+
Read more about using header files in official GCC documentation:
33+
34+
* Include Syntax
35+
* Include Operation
36+
* Once-Only Headers
37+
* Computed Includes
38+
39+
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html

examples/arduino-asyncudp/lib/README

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
This directory is intended for project specific (private) libraries.
3+
PlatformIO will compile them to static libraries and link into executable file.
4+
5+
The source code of each library should be placed in a an own separate directory
6+
("lib/your_library_name/[here are source files]").
7+
8+
For example, see a structure of the following two libraries `Foo` and `Bar`:
9+
10+
|--lib
11+
| |
12+
| |--Bar
13+
| | |--docs
14+
| | |--examples
15+
| | |--src
16+
| | |- Bar.c
17+
| | |- Bar.h
18+
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
19+
| |
20+
| |--Foo
21+
| | |- Foo.c
22+
| | |- Foo.h
23+
| |
24+
| |- README --> THIS FILE
25+
|
26+
|- platformio.ini
27+
|--src
28+
|- main.c
29+
30+
and a contents of `src/main.c`:
31+
```
32+
#include <Foo.h>
33+
#include <Bar.h>
34+
35+
int main (void)
36+
{
37+
...
38+
}
39+
40+
```
41+
42+
PlatformIO Library Dependency Finder will find automatically dependent
43+
libraries scanning project source files.
44+
45+
More information about PlatformIO Library Dependency Finder
46+
- https://docs.platformio.org/page/librarymanager/ldf.html

0 commit comments

Comments
 (0)