mirror of https://github.com/ArduPilot/ardupilot
ChibiOS: disable DMA on I2C on F7 and H7 by default
this was already done on many (most?) boards, and greatly reduces DMA sharing which improves performance of UARTs. This changes the default to no DMA on I2C
This commit is contained in:
parent
171e09d28c
commit
64cd58c21a
|
@ -580,3 +580,10 @@
|
||||||
|
|
||||||
// limit ISR count per byte
|
// limit ISR count per byte
|
||||||
#define STM32_I2C_ISR_LIMIT 6
|
#define STM32_I2C_ISR_LIMIT 6
|
||||||
|
|
||||||
|
#if defined(STM32F7xx_MCUCONF)
|
||||||
|
// disable DMA on I2C by default on F7
|
||||||
|
#ifndef STM32_I2C_USE_DMA
|
||||||
|
#define STM32_I2C_USE_DMA FALSE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
|
@ -635,3 +635,7 @@
|
||||||
#define STM32_SPI_SPI6_TX_BDMA_STREAM 5
|
#define STM32_SPI_SPI6_TX_BDMA_STREAM 5
|
||||||
#define STM32_ADC_ADC3_BDMA_STREAM 7
|
#define STM32_ADC_ADC3_BDMA_STREAM 7
|
||||||
|
|
||||||
|
// disable DMA on I2C by default on H7
|
||||||
|
#ifndef STM32_I2C_USE_DMA
|
||||||
|
#define STM32_I2C_USE_DMA FALSE
|
||||||
|
#endif
|
||||||
|
|
|
@ -151,7 +151,7 @@ def get_mcu_lib(mcu):
|
||||||
|
|
||||||
def setup_mcu_type_defaults():
|
def setup_mcu_type_defaults():
|
||||||
'''setup defaults for given mcu type'''
|
'''setup defaults for given mcu type'''
|
||||||
global pincount, ports, portmap, vtypes, mcu_type
|
global pincount, ports, portmap, vtypes, mcu_type, dma_exclude_pattern
|
||||||
lib = get_mcu_lib(mcu_type)
|
lib = get_mcu_lib(mcu_type)
|
||||||
if hasattr(lib, 'pincount'):
|
if hasattr(lib, 'pincount'):
|
||||||
pincount = lib.pincount
|
pincount = lib.pincount
|
||||||
|
@ -166,6 +166,9 @@ def setup_mcu_type_defaults():
|
||||||
for pin in range(pincount[port]):
|
for pin in range(pincount[port]):
|
||||||
portmap[port].append(generic_pin(port, pin, None, default_gpio[0], default_gpio[1:]))
|
portmap[port].append(generic_pin(port, pin, None, default_gpio[0], default_gpio[1:]))
|
||||||
|
|
||||||
|
if mcu_series.startswith("STM32H7") or mcu_series.startswith("STM32F7"):
|
||||||
|
# default DMA off on I2C for H7, we're much better off reducing DMA sharing
|
||||||
|
dma_exclude_pattern = ['I2C*']
|
||||||
|
|
||||||
def get_alt_function(mcu, pin, function):
|
def get_alt_function(mcu, pin, function):
|
||||||
'''return alternative function number for a pin'''
|
'''return alternative function number for a pin'''
|
||||||
|
|
Loading…
Reference in New Issue