|
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | | - |
15 | 14 | """ |
16 | 15 | Arduino |
17 | 16 |
|
|
22 | 21 | http://arduino.cc/en/Reference/HomePage |
23 | 22 | """ |
24 | 23 |
|
25 | | -from os.path import isdir, join |
26 | | - |
27 | | -from SCons.Script import DefaultEnvironment |
28 | | - |
29 | | -env = DefaultEnvironment() |
30 | | -platform = env.PioPlatform() |
31 | | - |
32 | | -FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32") |
33 | | -assert isdir(FRAMEWORK_DIR) |
34 | | - |
35 | | -env.Prepend( |
36 | | - CPPDEFINES=[ |
37 | | - ("ARDUINO", 10610), |
38 | | - "ARDUINO_ARCH_ESP32" |
39 | | - ], |
40 | | - |
41 | | - CPPPATH=[ |
42 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "config"), |
43 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "bt"), |
44 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "driver"), |
45 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "esp32"), |
46 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "ethernet"), |
47 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "freertos"), |
48 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "log"), |
49 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "lwip"), |
50 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "newlib"), |
51 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "nvs_flash"), |
52 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "spi_flash"), |
53 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "tcpip_adapter"), |
54 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "vfs"), |
55 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "expat"), |
56 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "json"), |
57 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "mbedtls"), |
58 | | - join(FRAMEWORK_DIR, "tools", "sdk", "include", "nghttp"), |
59 | | - join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")) |
60 | | - ], |
61 | | - LIBPATH=[ |
62 | | - join(FRAMEWORK_DIR, "tools", "sdk", "lib"), |
63 | | - join(FRAMEWORK_DIR, "tools", "sdk", "ld"), |
64 | | - ], |
65 | | - LIBS=[ |
66 | | - "app_update", "bt", "btdm_app", "c", "coexist", "core", "driver", |
67 | | - "esp32", "ethernet", "expat", "freertos", "g", "hal", "json", "log", |
68 | | - "lwip", "m", "mbedtls", "net80211", "newlib", "nghttp", "nvs_flash", |
69 | | - "openssl", "phy", "pp", "rtc", "smartconfig", "spi_flash", |
70 | | - "tcpip_adapter", "ulp", "vfs", "wpa", "wpa2", "wpa_supplicant", "wps", |
71 | | - "xtensa-debug-module" |
72 | | - ] |
73 | | -) |
74 | | - |
75 | | -env.Append( |
76 | | - LIBSOURCE_DIRS=[ |
77 | | - join(FRAMEWORK_DIR, "libraries") |
78 | | - ], |
79 | | - |
80 | | - LINKFLAGS=[ |
81 | | - "-T", "esp32.common.ld", |
82 | | - "-T", "esp32.rom.ld", |
83 | | - "-T", "esp32.peripherals.ld" |
84 | | - ] |
85 | | -) |
86 | | - |
87 | | -# |
88 | | -# Target: Build Core Library |
89 | | -# |
90 | | - |
91 | | -libs = [] |
92 | | - |
93 | | -if "build.variant" in env.BoardConfig(): |
94 | | - env.Append( |
95 | | - CPPPATH=[ |
96 | | - join(FRAMEWORK_DIR, "variants", |
97 | | - env.BoardConfig().get("build.variant")) |
98 | | - ] |
99 | | - ) |
100 | | - libs.append(env.BuildLibrary( |
101 | | - join("$BUILD_DIR", "FrameworkArduinoVariant"), |
102 | | - join(FRAMEWORK_DIR, "variants", env.BoardConfig().get("build.variant")) |
103 | | - )) |
104 | | - |
105 | | -envsafe = env.Clone() |
| 24 | +from os.path import join |
106 | 25 |
|
107 | | -libs.append(envsafe.BuildLibrary( |
108 | | - join("$BUILD_DIR", "FrameworkArduino"), |
109 | | - join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")) |
110 | | -)) |
| 26 | +from SCons.Script import DefaultEnvironment, SConscript |
111 | 27 |
|
112 | | -env.Prepend(LIBS=libs) |
| 28 | +SConscript( |
| 29 | + join(DefaultEnvironment().PioPlatform().get_package_dir( |
| 30 | + "framework-arduinoespressif32"), "tools", "platformio-build.py")) |
0 commit comments