Merge pull request #126 from GrantM11235/make-tmp-dmas

Create `tmp/dmas/` if it doesn't exist
This commit is contained in:
Dario Nieuwenhuis 2022-03-08 23:07:10 +01:00 committed by GitHub
commit ccc3468e62

View File

@ -7,6 +7,7 @@ import re
import json import json
import os import os
from glob import glob from glob import glob
from pathlib import Path
from stm32data import yaml, header, interrupts, memory from stm32data import yaml, header, interrupts, memory
from stm32data.util import * from stm32data.util import *
@ -1153,6 +1154,7 @@ def parse_dma():
if ch['dma'] == dma_peri_name: if ch['dma'] == dma_peri_name:
ch['channel'] -= 1 ch['channel'] -= 1
Path('tmp/dmas').mkdir(parents=True, exist_ok=True)
with open('tmp/dmas/' + ff + '.json', 'w') as f: with open('tmp/dmas/' + ff + '.json', 'w') as f:
json.dump(chip_dma, f, indent=4) json.dump(chip_dma, f, indent=4)