mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
HAL_ChibiOS: added NODMA option
this allows a peripheral to be configured without DMA (for low-use UARTs)
This commit is contained in:
parent
74f4d5a3c9
commit
ad5a04fc89
@ -699,6 +699,16 @@ def write_peripheral_enable(f):
|
||||
if type.startswith('I2C'):
|
||||
f.write('#define STM32_I2C_USE_%s TRUE\n' % type)
|
||||
|
||||
def get_dma_exclude(periph_list):
|
||||
'''return list of DMA devices to exclude from DMA'''
|
||||
dma_exclude = []
|
||||
for periph in periph_list:
|
||||
if periph not in bylabel:
|
||||
continue
|
||||
p = bylabel[periph]
|
||||
if p.has_extra('NODMA'):
|
||||
dma_exclude.append(periph)
|
||||
return dma_exclude
|
||||
|
||||
def write_hwdef_header(outfilename):
|
||||
'''write hwdef header file'''
|
||||
@ -724,7 +734,7 @@ def write_hwdef_header(outfilename):
|
||||
write_peripheral_enable(f)
|
||||
write_prototype_file()
|
||||
|
||||
dma_resolver.write_dma_header(f, periph_list, mcu_type)
|
||||
dma_resolver.write_dma_header(f, periph_list, mcu_type, dma_exclude=get_dma_exclude(periph_list))
|
||||
|
||||
write_UART_config(f)
|
||||
|
||||
@ -900,3 +910,4 @@ write_hwdef_header(os.path.join(outdir, "hwdef.h"))
|
||||
|
||||
# write out ldscript.ld
|
||||
write_ldscript(os.path.join(outdir, "ldscript.ld"))
|
||||
|
||||
|
@ -68,7 +68,7 @@ def chibios_dma_define_name(key):
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def write_dma_header(f, peripheral_list, mcu_type):
|
||||
def write_dma_header(f, peripheral_list, mcu_type, dma_exclude=[]):
|
||||
'''write out a DMA resolver header file'''
|
||||
global dma_map
|
||||
try:
|
||||
@ -83,6 +83,8 @@ def write_dma_header(f, peripheral_list, mcu_type):
|
||||
curr_dict = {}
|
||||
|
||||
for periph in peripheral_list:
|
||||
if periph in dma_exclude:
|
||||
continue
|
||||
assigned = False
|
||||
check_list = []
|
||||
if not periph in dma_map:
|
||||
@ -195,3 +197,4 @@ if __name__ == '__main__':
|
||||
|
||||
f = open("dma.h", "w")
|
||||
write_dma_header(f, plist, mcu_type)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user