Skip to content

Commit 3188d0b

Browse files
committed
Support both tasmota/espressif arduino-esp32
1 parent a0bba8b commit 3188d0b

File tree

3 files changed

+51
-4
lines changed

3 files changed

+51
-4
lines changed

configs/pio_start1.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
"""
16+
Arduino
17+
18+
Arduino Wiring-based Framework allows writing cross-platform software to
19+
control devices attached to a wide range of Arduino boards to create all
20+
kinds of creative coding, interactive objects, spaces or physical experiences.
21+
22+
http://arduino.cc/en/Reference/HomePage
23+
"""
24+
25+
# Extends: https://github.com/platformio/platform-espressif32/blob/develop/builder/main.py
26+
27+
from os.path import basename, join
28+
29+
from SCons.Script import DefaultEnvironment
30+
31+
env = DefaultEnvironment()
32+
33+
FRAMEWORK_DIR = env.PioPlatform().get_package_dir("framework-arduinoespressif32")
34+
FRAMEWORK_SDK_DIR = join(FRAMEWORK_DIR, "tools", "esp32-arduino-libs")
35+
36+
37+
board_config = env.BoardConfig()
38+
39+
env.Append(

tools/config.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
# Owner of the target ESP32 Arduino repository
4+
export AR_USER="tasmota"
35

46
if [ -z $IDF_PATH ]; then
57
export IDF_PATH="$PWD/esp-idf"
@@ -11,7 +13,11 @@ fi
1113

1214
# Arduino branch to use
1315
if [ -z $AR_PR_TARGET_BRANCH ]; then
14-
AR_PR_TARGET_BRANCH="master"
16+
if [ "$AR_USER" == "tasmota" ]; then
17+
AR_PR_TARGET_BRANCH="main"
18+
else
19+
AR_PR_TARGET_BRANCH="master"
20+
fi
1521
fi
1622

1723
if [ -z $IDF_TARGET ]; then
@@ -25,8 +31,6 @@ if [ -z $IDF_TARGET ]; then
2531
fi
2632
fi
2733

28-
# Owner of the target ESP32 Arduino repository
29-
export AR_USER="tasmota"
3034

3135
# IDF commit to use
3236
#IDF_COMMIT=""

tools/copy-libs.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,11 @@ mkdir -p "$AR_SDK"
290290

291291
# start generation of platformio-build.py
292292
AR_PLATFORMIO_PY="$AR_SDK/platformio-build.py"
293-
cat configs/pio_start.txt > "$AR_PLATFORMIO_PY"
293+
if [ $AR_USER == "espressif" ]; then
294+
cat configs/pio_start.txt > "$AR_PLATFORMIO_PY"
295+
else
296+
cat configs/pio_start1.txt > "$AR_PLATFORMIO_PY"
297+
fi
294298

295299
echo " ASFLAGS=[" >> "$AR_PLATFORMIO_PY"
296300
if [ "$IS_XTENSA" = "y" ]; then

0 commit comments

Comments
 (0)