Skip to content

Commit 152ffb3

Browse files
committed
Merge branch 'release/v1.12.0'
2 parents ae69ea9 + 0cf0114 commit 152ffb3

File tree

286 files changed

+28397
-18856
lines changed

Some content is hidden

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

286 files changed

+28397
-18856
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@ python:
55

66
env:
77
- PLATFORMIO_PROJECT_DIR=examples/arduino-blink
8+
- PLATFORMIO_PROJECT_DIR=examples/arduino-briki-internal-libs
89
- PLATFORMIO_PROJECT_DIR=examples/arduino-wifiscan
910
- PLATFORMIO_PROJECT_DIR=examples/espidf-arduino-blink
1011
- PLATFORMIO_PROJECT_DIR=examples/espidf-arduino-wifiscan
1112
- PLATFORMIO_PROJECT_DIR=examples/espidf-aws-iot
12-
- PLATFORMIO_PROJECT_DIR=examples/espidf-ble-adv
13+
- PLATFORMIO_PROJECT_DIR=examples/espidf-ble-eddystone
1314
- PLATFORMIO_PROJECT_DIR=examples/espidf-coap-server
1415
- PLATFORMIO_PROJECT_DIR=examples/espidf-exceptions
1516
- PLATFORMIO_PROJECT_DIR=examples/espidf-hello-world
1617
- PLATFORMIO_PROJECT_DIR=examples/espidf-http-request
1718
- PLATFORMIO_PROJECT_DIR=examples/espidf-peripherals-uart
1819
- PLATFORMIO_PROJECT_DIR=examples/espidf-storage-sdcard
20+
- PLATFORMIO_PROJECT_DIR=examples/espidf-ulp-adc
21+
- PLATFORMIO_PROJECT_DIR=examples/espidf-ulp-pulse
1922
- PLATFORMIO_PROJECT_DIR=examples/pumbaa-blink
2023
- PLATFORMIO_PROJECT_DIR=examples/simba-blink
2124

appveyor.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,29 @@ environment:
33

44
matrix:
55
- PLATFORMIO_PROJECT_DIR: "examples/arduino-blink"
6+
- PLATFORMIO_PROJECT_DIR: "examples/arduino-briki-internal-libs"
67
- PLATFORMIO_PROJECT_DIR: "examples/arduino-wifiscan"
78
- PLATFORMIO_PROJECT_DIR: "examples/espidf-arduino-blink"
89
- PLATFORMIO_PROJECT_DIR: "examples/espidf-arduino-wifiscan"
910
- PLATFORMIO_PROJECT_DIR: "examples/espidf-aws-iot"
10-
- PLATFORMIO_PROJECT_DIR: "examples/espidf-ble-adv"
11+
- PLATFORMIO_PROJECT_DIR: "examples/espidf-ble-eddystone"
1112
- PLATFORMIO_PROJECT_DIR: "examples/espidf-coap-server"
1213
- PLATFORMIO_PROJECT_DIR: "examples/espidf-exceptions"
1314
- PLATFORMIO_PROJECT_DIR: "examples/espidf-hello-world"
1415
- PLATFORMIO_PROJECT_DIR: "examples/espidf-http-request"
1516
- PLATFORMIO_PROJECT_DIR: "examples/espidf-peripherals-uart"
1617
- PLATFORMIO_PROJECT_DIR: "examples/espidf-storage-sdcard"
18+
- PLATFORMIO_PROJECT_DIR: "examples/espidf-ulp-adc"
19+
- PLATFORMIO_PROJECT_DIR: "examples/espidf-ulp-pulse"
1720
- PLATFORMIO_PROJECT_DIR: "examples/pumbaa-blink"
1821
- PLATFORMIO_PROJECT_DIR: "examples/simba-blink"
1922

23+
platform:
24+
- x64
25+
2026
install:
2127
- cmd: git submodule update --init --recursive
22-
- cmd: SET PATH=C:\Python36\Scripts;%PATH%
28+
- cmd: SET PATH=C:\Python36-x64;C:\Python36-x64\Scripts;%PATH%
2329
- cmd: pip3 install -U https://github.com/platformio/platformio/archive/develop.zip
2430
- cmd: platformio platform install file://.
2531

boards/briki_abc_esp32.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"build": {
3+
"arduino":{
4+
"ldscript": "esp32_out.ld"
5+
},
6+
"core": "mbcwb",
7+
"extra_flags": "-DBRIKI_MBC_WB_ESP -DBRIKI_ABC -w",
8+
"f_cpu": "240000000L",
9+
"f_flash": "80000000L",
10+
"flash_mode": "dio",
11+
"mcu": "esp32",
12+
"variant": "briki_mbcwb_esp32",
13+
"partitions": "8MB_ffat.csv"
14+
},
15+
"connectivity": [
16+
"wifi",
17+
"bluetooth",
18+
"ethernet",
19+
"can"
20+
],
21+
"debug": {
22+
"openocd_board": "esp-wroom-32.cfg"
23+
},
24+
"frameworks": [
25+
"arduino"
26+
],
27+
"name": "Briki ABC (MBC-WB) - ESP32",
28+
"upload": {
29+
"protocol": "mbctool",
30+
"flash_size": "8MB",
31+
"maximum_ram_size": 327680,
32+
"maximum_size": 3407872,
33+
"require_upload_port": true,
34+
"speed": 1500000
35+
},
36+
"url": "https://briki.org",
37+
"vendor": "meteca"
38+
}

boards/briki_mbc-wb_esp32.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"build": {
3+
"arduino":{
4+
"ldscript": "esp32_out.ld"
5+
},
6+
"core": "mbcwb",
7+
"extra_flags": "-DBRIKI_MBC_WB_ESP -DBRIKI_MBC_WB -w",
8+
"f_cpu": "240000000L",
9+
"f_flash": "80000000L",
10+
"flash_mode": "dio",
11+
"mcu": "esp32",
12+
"variant": "briki_mbcwb_esp32",
13+
"partitions": "8MB_ffat.csv"
14+
},
15+
"connectivity": [
16+
"wifi",
17+
"bluetooth",
18+
"ethernet",
19+
"can"
20+
],
21+
"debug": {
22+
"openocd_board": "esp-wroom-32.cfg"
23+
},
24+
"frameworks": [
25+
"arduino"
26+
],
27+
"name": "Briki MBC-WB - ESP32",
28+
"upload": {
29+
"protocol": "mbctool",
30+
"flash_size": "8MB",
31+
"maximum_ram_size": 327680,
32+
"maximum_size": 3407872,
33+
"require_upload_port": true,
34+
"speed": 1500000
35+
},
36+
"url": "https://briki.org",
37+
"vendor": "meteca"
38+
}

boards/sg-o_airMon.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"build": {
3+
"arduino":{
4+
"ldscript": "esp32_out.ld"
5+
},
6+
"core": "esp32",
7+
"extra_flags": "-DARDUINO_SG_O_AIRMON_ESP32",
8+
"f_cpu": "240000000L",
9+
"f_flash": "40000000L",
10+
"flash_mode": "dio",
11+
"mcu": "esp32",
12+
"variant": "esp32"
13+
},
14+
"connectivity": [
15+
"wifi",
16+
"bluetooth",
17+
"ethernet",
18+
"can"
19+
],
20+
"debug": {
21+
"openocd_board": "esp-wroom-32.cfg"
22+
},
23+
"frameworks": [
24+
"arduino",
25+
"espidf"
26+
],
27+
"platforms": [
28+
"espressif32"
29+
],
30+
"name": "SG-O AirMon",
31+
"upload": {
32+
"flash_size": "4MB",
33+
"maximum_ram_size": 327680,
34+
"maximum_size": 4194304,
35+
"require_upload_port": true,
36+
"speed": 460800
37+
},
38+
"url": "https://github.com/SG-O/airMon",
39+
"vendor": "SG-O"
40+
}

boards/ttgo-lora32-v2.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"build": {
3+
"arduino":{
4+
"ldscript": "esp32_out.ld"
5+
},
6+
"core": "esp32",
7+
"extra_flags": "-DARDUINO_TTGO_LoRa32_V2",
8+
"f_cpu": "240000000L",
9+
"f_flash": "40000000L",
10+
"flash_mode": "dio",
11+
"mcu": "esp32",
12+
"variant": "ttgo-lora32-v2"
13+
},
14+
"connectivity": [
15+
"wifi",
16+
"bluetooth",
17+
"ethernet",
18+
"can"
19+
],
20+
"debug": {
21+
"openocd_board": "esp-wroom-32.cfg"
22+
},
23+
"frameworks": [
24+
"arduino",
25+
"espidf"
26+
],
27+
"name": "TTGO LoRa32-OLED V2",
28+
"upload": {
29+
"flash_size": "4MB",
30+
"maximum_ram_size": 327680,
31+
"maximum_size": 4194304,
32+
"require_upload_port": true,
33+
"speed": 460800
34+
},
35+
"url": "https://github.com/LilyGO/TTGO-LORA32-V2.0",
36+
"vendor": "TTGO"
37+
}

builder/frameworks/_embed_files.py

Lines changed: 76 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
from SCons.Script import Builder
2020

21-
from platformio.util import cd
22-
2321
Import("env")
2422

2523
board = env.BoardConfig()
@@ -28,12 +26,17 @@
2826
# Embedded files helpers
2927
#
3028

29+
3130
def extract_files(cppdefines, files_type):
3231
files = []
3332
if "build." + files_type in board:
3433
files.extend(
35-
[join("$PROJECT_DIR", f) for f in board.get(
36-
"build." + files_type, "").split() if f])
34+
[
35+
join("$PROJECT_DIR", f)
36+
for f in board.get("build." + files_type, "").split()
37+
if f
38+
]
39+
)
3740
else:
3841
files_define = "COMPONENT_" + files_type.upper()
3942
for define in cppdefines:
@@ -46,18 +49,20 @@ def extract_files(cppdefines, files_type):
4649
return []
4750

4851
if not isinstance(value, str):
49-
print("Warning! %s macro must contain "
50-
"a list of files separated by ':'" % files_define)
52+
print(
53+
"Warning! %s macro must contain "
54+
"a list of files separated by ':'" % files_define
55+
)
5156
return []
5257

53-
for f in value.split(':'):
58+
for f in value.split(":"):
5459
if not f:
5560
continue
5661
files.append(join("$PROJECT_DIR", f))
5762

5863
for f in files:
5964
if not isfile(env.subst(f)):
60-
print("Warning! Could not find file \"%s\"" % basename(f))
65+
print('Warning! Could not find file "%s"' % basename(f))
6166

6267
return files
6368

@@ -75,9 +80,9 @@ def prepare_file(source, target, env):
7580

7681
with open(filepath, "rb+") as fp:
7782
fp.seek(-1, SEEK_END)
78-
if fp.read(1) != '\0':
83+
if fp.read(1) != "\0":
7984
fp.seek(0, SEEK_CUR)
80-
fp.write(b'\0')
85+
fp.write(b"\0")
8186

8287

8388
def revert_original_file(source, target, env):
@@ -97,26 +102,74 @@ def embed_files(files, files_type):
97102
env.AppendUnique(PIOBUILDFILES=[env.File(join("$BUILD_DIR", filename))])
98103

99104

105+
def transform_to_asm(target, source, env):
106+
return [join("$BUILD_DIR", s.name + ".S") for s in source], source
107+
100108
env.Append(
101109
BUILDERS=dict(
102110
TxtToBin=Builder(
103-
action=env.VerboseAction(" ".join([
104-
"xtensa-esp32-elf-objcopy",
105-
"--input-target", "binary",
106-
"--output-target", "elf32-xtensa-le",
107-
"--binary-architecture", "xtensa",
108-
"--rename-section", ".data=.rodata.embedded",
109-
"$SOURCE", "$TARGET"
110-
]), "Converting $TARGET"),
111-
suffix=".txt.o"))
111+
action=env.VerboseAction(
112+
" ".join(
113+
[
114+
"xtensa-esp32-elf-objcopy",
115+
"--input-target",
116+
"binary",
117+
"--output-target",
118+
"elf32-xtensa-le",
119+
"--binary-architecture",
120+
"xtensa",
121+
"--rename-section",
122+
".data=.rodata.embedded",
123+
"$SOURCE",
124+
"$TARGET",
125+
]
126+
),
127+
"Converting $TARGET",
128+
),
129+
suffix=".txt.o",
130+
),
131+
TxtToAsm=Builder(
132+
action=env.VerboseAction(
133+
" ".join(
134+
[
135+
join(
136+
env.PioPlatform().get_package_dir("tool-cmake") or "",
137+
"bin",
138+
"cmake",
139+
),
140+
"-DDATA_FILE=$SOURCE",
141+
"-DSOURCE_FILE=$TARGET",
142+
"-DFILE_TYPE=TEXT",
143+
"-P",
144+
join(
145+
env.PioPlatform().get_package_dir("framework-espidf") or "",
146+
"tools",
147+
"cmake",
148+
"scripts",
149+
"data_file_embed_asm.cmake",
150+
),
151+
]
152+
),
153+
"Generating assembly for $TARGET",
154+
),
155+
emitter=transform_to_asm,
156+
single_source=True
157+
),
158+
)
112159
)
113160

161+
114162
flags = env.get("CPPDEFINES")
115163
for files_type in ("embed_txtfiles", "embed_files"):
116-
if "COMPONENT_" + files_type.upper() not in env.Flatten(
117-
flags) and "build." + files_type not in board:
164+
if (
165+
"COMPONENT_" + files_type.upper() not in env.Flatten(flags)
166+
and "build." + files_type not in board
167+
):
118168
continue
119169

120170
files = extract_files(flags, files_type)
121-
embed_files(files, files_type)
122-
remove_config_define(flags, files_type)
171+
if "espidf" in env.subst("$PIOFRAMEWORK"):
172+
env.Requires(join("$BUILD_DIR", "${PROGNAME}.elf"), env.TxtToAsm(files))
173+
else:
174+
embed_files(files, files_type)
175+
remove_config_define(flags, files_type)

builder/frameworks/arduino.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,17 @@
2727
from SCons.Script import DefaultEnvironment, SConscript
2828

2929
env = DefaultEnvironment()
30+
board = env.BoardConfig()
31+
build_core = board.get("build.core", "").lower()
3032

3133
SConscript("_embed_files.py", exports="env")
3234

33-
if "espidf" not in env.subst("$PIOFRAMEWORK"):
35+
if build_core == "mbcwb":
36+
SConscript(
37+
join(DefaultEnvironment().PioPlatform().get_package_dir(
38+
"framework-arduino-mbcwb"), "tools", "platformio-esp-build.py"))
39+
40+
elif "espidf" not in env.subst("$PIOFRAMEWORK"):
3441
SConscript(
3542
join(DefaultEnvironment().PioPlatform().get_package_dir(
3643
"framework-arduinoespressif32"), "tools", "platformio-build.py"))

0 commit comments

Comments
 (0)