mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-14 16:03:41 +00:00
tools/gen-device-svd: show better error messages
Show an error message when input .svd files cannot be found.
This commit is contained in:
@@ -372,9 +372,16 @@ Default_Handler:
|
|||||||
out.write(' IRQ {name}_IRQHandler\n'.format(**intr))
|
out.write(' IRQ {name}_IRQHandler\n'.format(**intr))
|
||||||
|
|
||||||
def generate(indir, outdir, sourceURL):
|
def generate(indir, outdir, sourceURL):
|
||||||
|
if not os.path.isdir(indir):
|
||||||
|
print('cannot find input directory:', indir, file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
if not os.path.isdir(outdir):
|
if not os.path.isdir(outdir):
|
||||||
os.mkdir(outdir)
|
os.mkdir(outdir)
|
||||||
for filepath in sorted(glob(indir + '/*.svd')):
|
infiles = glob(indir + '/*.svd')
|
||||||
|
if not infiles:
|
||||||
|
print('no .svd files found:', indir, file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
for filepath in sorted(infiles):
|
||||||
print(filepath)
|
print(filepath)
|
||||||
device = readSVD(filepath, sourceURL)
|
device = readSVD(filepath, sourceURL)
|
||||||
writeGo(outdir, device)
|
writeGo(outdir, device)
|
||||||
|
|||||||
Reference in New Issue
Block a user