diff --git a/src/main/build/build_config.h b/src/main/build/build_config.h index b6a561fecd..ae4eb1a3a4 100644 --- a/src/main/build/build_config.h +++ b/src/main/build/build_config.h @@ -51,5 +51,11 @@ #define EXTENDED_FASTRAM #endif +#ifdef STM32H7 +#define DMA_RAM __attribute__ ((section(".DMA_RAM"))) +#else +#define DMA_RAM +#endif + #define STATIC_FASTRAM static FASTRAM #define STATIC_FASTRAM_UNIT_TESTED STATIC_UNIT_TESTED FASTRAM diff --git a/src/main/drivers/adc_impl.h b/src/main/drivers/adc_impl.h index 290a9ef583..3a1783a04d 100644 --- a/src/main/drivers/adc_impl.h +++ b/src/main/drivers/adc_impl.h @@ -31,7 +31,7 @@ #endif #if defined(STM32H7) -#define ADC_VALUES_ALIGNMENT(def) __attribute__ ((section(".DMA_RAM"))) def __attribute__ ((aligned (32))) +#define ADC_VALUES_ALIGNMENT(def) DMA_RAM def __attribute__ ((aligned (32))) #else #define ADC_VALUES_ALIGNMENT(def) def #endif diff --git a/src/main/drivers/pwm_output.c b/src/main/drivers/pwm_output.c index 48f7a10d5c..620c25a22a 100644 --- a/src/main/drivers/pwm_output.c +++ b/src/main/drivers/pwm_output.c @@ -91,7 +91,7 @@ typedef struct { bool requestTelemetry; } pwmOutputMotor_t; -static pwmOutputPort_t pwmOutputPorts[MAX_PWM_OUTPUT_PORTS]; +static DMA_RAM pwmOutputPort_t pwmOutputPorts[MAX_PWM_OUTPUT_PORTS]; static pwmOutputMotor_t motors[MAX_MOTORS]; static motorPwmProtocolTypes_e initMotorProtocol;