Create tmp/dmas/ if it doesn't exist

This commit is contained in:
Grant Miller 2022-03-08 15:53:16 -06:00
parent e977f83fe1
commit a1972e7a22

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)