Skip to content

Commit 8862239

Browse files
committed
add ch32v2 core from openwch
1 parent 8487a30 commit 8862239

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

all_platforms.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# board: [ platform, uf2_family, manual core URL]
12
ALL_PLATFORMS={
23
# classic Arduino AVR
34
"uno" : ["arduino:avr:uno", None, None],
@@ -135,6 +136,10 @@
135136
"attiny816" : ["megaTinyCore:megaavr:atxy6:chip=816", None, None],
136137
"attiny807" : ["megaTinyCore:megaavr:atxy7:chip=807", None, None],
137138
"attiny806" : ["megaTinyCore:megaavr:atxy6:chip=806", None, None],
139+
140+
# CH32v2 (openwch)
141+
"CH32V20x_EVT": ["WCH:ch32v:CH32V20x_EVT", None, None],
142+
138143
# groupings
139144
"main_platforms" : ("uno", "leonardo", "mega2560", "zero", "qtpy_m0",
140145
"esp8266", "esp32", "metro_m4", "trinket_m0"),

build_platform.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,14 @@
6868
"https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json,"
6969
"https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json,"
7070
"https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json,"
71-
"https://drazzy.good-enough.cloud/package_drazzy.com_index.json"
71+
"https://drazzy.good-enough.cloud/package_drazzy.com_index.json,"
72+
"https://github.com/openwch/board_manager_files/raw/main/package_ch32v_index.json"
7273
)
7374

7475
# global exit code
7576
success = 0
7677

78+
7779
class ColorPrint:
7880

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

101+
99102
def manually_install_esp32_bsp(repo_info):
100103
print("Manually installing latest ESP32 BSP...")
101104
# Assemble git url
@@ -130,6 +133,7 @@ def manually_install_esp32_bsp(repo_info):
130133
print(out)
131134
print("Installed ESP32 BSP from source!")
132135

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

160+
156161
def run_or_die(cmd, error):
157162
print(cmd)
158163
attempt = 0
@@ -225,18 +230,21 @@ def install_library_deps():
225230

226231
################################ UF2 Utils.
227232

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

240+
234241
def glob1(pattern):
235242
result = glob.glob(pattern)
236243
if len(result) != 1:
237244
raise RuntimeError(f"Required pattern {pattern} to match exactly 1 file, got {result}")
238245
return result[0]
239246

247+
240248
def download_uf2_utils():
241249
"""Downloads uf2conv tools if we don't already have them
242250
"""

0 commit comments

Comments
 (0)