tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
15.49k stars 913 forks source link

Update cmsis-svd library, and fix incompatiblitiy with gen-device-svd #4625

Open cibomahto opened 12 hours ago

cibomahto commented 12 hours ago

This pull request addresses #4608 , and also updates the cmsis-svd library to bring in the rp2350 svd file for #4452. I've grouped them together because the offending condition only seems to be present in the updated cmsis-svd library.

I wrote a python script to check that all of the generated .go files are syntactically correct, however i have not managed to check the .s files.

import pathlib
import subprocess
import sys

def check_go_files(target_dir):
    issues = []

    src = pathlib.Path(target_dir)
    for go_file in list(src.rglob('*.go')):
        command = f'gofmt -e {go_file}'

        output = subprocess.run(command.split(), capture_output=True)
        if output.returncode != 0:
            issues.append(go_file)

    return issues

target_dir = 'tinygo/src/device'

issues = []
issues.extend(check_go_files(target_dir))

if len(issues) > 0:
    print("the folling files have issues:", file=sys.stderr)
    for issue in issues:
        print(issue.as_posix())
    exit(1)