Skip to content

Commit

Permalink
Add workaround for OpenOCD version while not registry not approved
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgerhardt committed Feb 13, 2024
1 parent 13eceef commit 188074b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import os
import sys
from platformio.public import PlatformBase
from platformio import util

IS_WINDOWS = sys.platform.startswith("win")
IS_LINUX = sys.platform.startswith("linux")
Expand Down Expand Up @@ -71,6 +72,17 @@ def configure_default_packages(self, variables, targets):
self.packages["tool-minichlink"]["version"] = "https://github.com/Community-PIO-CH32V/tool-minichlink.git#linux"
elif IS_MAC:
self.packages["tool-minichlink"]["version"] = "https://github.com/Community-PIO-CH32V/tool-minichlink.git#mac"
elif variables.get("upload_protocol", default_protocol) == "wch-link":
sys_type = util.get_systype()
if IS_WINDOWS:
self.packages["tool-openocd-riscv-wch"]["version"] = "https://github.com/Community-PIO-CH32V/tool-openocd-riscv-wch.git#main"
elif IS_LINUX:
self.packages["tool-openocd-riscv-wch"]["version"] = "https://github.com/Community-PIO-CH32V/tool-openocd-riscv-wch.git#linux"
else:
if sys_type == "darwin_arm64":
self.packages["tool-openocd-riscv-wch"]["version"] = "https://github.com/Community-PIO-CH32V/tool-openocd-riscv-wch.git#darwin_arm"
else:
self.packages["tool-openocd-riscv-wch"]["version"] = "https://github.com/Community-PIO-CH32V/tool-openocd-riscv-wch.git#darwin_x64"
frameworks = variables.get("pioframework", [])
build_core = variables.get("board_build.core", board_config.get("build.core", "arduino"))
if "arduino" in frameworks:
Expand Down

0 comments on commit 188074b

Please sign in to comment.