Skip to content

Commit 9920da0

Browse files
committed
Add pacakge definitions, skeletons for builder script
1 parent 3c6cc84 commit 9920da0

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# ToDo: readout core and call correct builder script (e.g., mbed-core/arduino-core-mbed.py)

platform.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"frameworks": {
2323
"arduino": {
2424
"package": "framework-arduino-mbed",
25-
"script": "builder/frameworks/arduino/mbed-core/arduino-core-mbed.py"
25+
"script": "builder/frameworks/arduino/arduino.py"
2626
}
2727
},
2828
"packages": {
@@ -37,6 +37,12 @@
3737
"owner": "platformio",
3838
"version": "~2.1.0"
3939
},
40+
"framework-arduino-pico-earlephilhower": {
41+
"type": "framework",
42+
"optional": true,
43+
"owner": "maxgerhardt",
44+
"version": "~1.10902.0"
45+
},
4046
"tool-rp2040tools": {
4147
"type": "uploader",
4248
"owner": "platformio",

platform.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import sys
1516
import copy
1617
import platform
1718

@@ -24,6 +25,24 @@ def is_embedded(self):
2425
return True
2526

2627
def configure_default_packages(self, variables, targets):
28+
# configure arduino core package.
29+
# select the right one based on the build.core, disable other one.
30+
board = variables.get("board")
31+
board_config = self.board_config(board)
32+
build_core = variables.get(
33+
"board_build.core", board_config.get("build.core", "arduino"))
34+
35+
frameworks = variables.get("pioframework", [])
36+
if "arduino" in frameworks:
37+
if build_core == "arduino":
38+
self.frameworks["arduino"]["package"] = "framework-arduino-mbed"
39+
self.packages["framework-arduino-pico-earlephilhower"]["optional"] = True
40+
elif build_core == "earlephilhower":
41+
self.frameworks["arduino"]["package"] = "framework-arduino-pico-earlephilhower"
42+
self.packages["framework-arduino-mbed"]["optional"] = True
43+
else:
44+
sys.stderr.write("Error! Unknown build.core value '%s'. Don't know which Arduino core package to use." % build_core)
45+
2746
# configure J-LINK tool
2847
jlink_conds = [
2948
"jlink" in variables.get(option, "")

0 commit comments

Comments
 (0)