Skip to content

Commit

Permalink
Configure Arduino to use SDCC v3.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
valeros committed Mar 23, 2021
1 parent a3a5164 commit 447fd0a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
"toolchain-sdcc": {
"type": "toolchain",
"owner": "platformio",
"version": "~1.40100.0"
"version": "~1.40100.0",
"optionalVersions": [
"~1.30901.0"
]
},
"framework-arduinoststm8": {
"type": "framework",
Expand Down
7 changes: 7 additions & 0 deletions platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@

class Ststm8Platform(PlatformBase):

def configure_default_packages(self, variables, targets):
if "arduino" in variables.get("pioframework", []):
self.packages["toolchain-sdcc"]["version"] = "~1.30901.0"
return PlatformBase.configure_default_packages(self, variables, targets)

def get_boards(self, id_=None):
result = PlatformBase.get_boards(self, id_)
if not result:
Expand All @@ -38,6 +43,8 @@ def _add_default_debug_tools(self, board):
# Configure OpenOCD debugging.
# Only via ST-Link for now
for link in ("stlink",):
if link not in upload_protocols or link in debug["tools"]:
continue
if link == "stlink":
server_args = ["-s", "$PACKAGE_DIR/scripts"]
if debug.get("openocd_board"):
Expand Down

0 comments on commit 447fd0a

Please sign in to comment.