Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ch32v2 core from openwch #185

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/githubci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Github Arduino Library CI

on: [push]
on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
Expand Down
5 changes: 5 additions & 0 deletions all_platforms.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# board: [ platform, uf2_family, manual core URL]
ALL_PLATFORMS={
# classic Arduino AVR
"uno" : ["arduino:avr:uno", None, None],
Expand Down Expand Up @@ -135,6 +136,10 @@
"attiny816" : ["megaTinyCore:megaavr:atxy6:chip=816", None, None],
"attiny807" : ["megaTinyCore:megaavr:atxy7:chip=807", None, None],
"attiny806" : ["megaTinyCore:megaavr:atxy6:chip=806", None, None],

# CH32v2 (openwch)
"CH32V20x_EVT": ["WCH:ch32v:CH32V20x_EVT", None, None],

# groupings
"main_platforms" : ("uno", "leonardo", "mega2560", "zero", "qtpy_m0",
"esp8266", "esp32", "metro_m4", "trinket_m0"),
Expand Down
10 changes: 9 additions & 1 deletion build_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@
"https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json,"
"https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json,"
"https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json,"
"https://drazzy.good-enough.cloud/package_drazzy.com_index.json"
"https://drazzy.good-enough.cloud/package_drazzy.com_index.json,"
"https://github.com/openwch/board_manager_files/raw/main/package_ch32v_index.json"
)

# global exit code
success = 0


class ColorPrint:

@staticmethod
Expand All @@ -96,6 +98,7 @@ def print_info(message, end = '\n'):
def print_bold(message, end = '\n'):
sys.stdout.write('\x1b[1;37m' + message.strip() + '\x1b[0m' + end)


def manually_install_esp32_bsp(repo_info):
print("Manually installing latest ESP32 BSP...")
# Assemble git url
Expand Down Expand Up @@ -130,6 +133,7 @@ def manually_install_esp32_bsp(repo_info):
print(out)
print("Installed ESP32 BSP from source!")


def install_platform(fqbn, full_platform_name=None):
if os.path.exists("/home/runner/.arduino15/package_drazzy.json"):
print("Moving drazzy.json")
Expand All @@ -153,6 +157,7 @@ def install_platform(fqbn, full_platform_name=None):
# print installed core version
print(os.popen('arduino-cli core list | grep {}'.format(fqbn)).read(), end='')


def run_or_die(cmd, error):
print(cmd)
attempt = 0
Expand Down Expand Up @@ -225,18 +230,21 @@ def install_library_deps():

################################ UF2 Utils.


def glob01(pattern):
result = glob.glob(pattern)
if len(result) > 1:
raise RuntimeError(f"Required pattern {pattern} to match at most 1 file, got {result}")
return result[0] if result else None


def glob1(pattern):
result = glob.glob(pattern)
if len(result) != 1:
raise RuntimeError(f"Required pattern {pattern} to match exactly 1 file, got {result}")
return result[0]


def download_uf2_utils():
"""Downloads uf2conv tools if we don't already have them
"""
Expand Down