From c7e2944ab9bcdea381e9326d1b90f9c4af59bd52 Mon Sep 17 00:00:00 2001 From: Omar SAKET Date: Thu, 20 Apr 2023 14:31:42 +0100 Subject: [PATCH] [PRJ] Change I2C interrupt priority to be lower than DMA priority in 'I2C EEPROM' and 'I2C EEPROM FM+' examples so that DMA interrupt can be serviced if it fires while the CPU is servicing the I2C interrupt --- .../Examples/I2C/I2C_EEPROM/Src/stm32f7xx_hal_msp.c | 4 ++-- .../Examples/I2C/I2C_EEPROM_FM+/Src/stm32f7xx_hal_msp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Projects/STM32756G_EVAL/Examples/I2C/I2C_EEPROM/Src/stm32f7xx_hal_msp.c b/Projects/STM32756G_EVAL/Examples/I2C/I2C_EEPROM/Src/stm32f7xx_hal_msp.c index 520bfe85..3f8f2853 100644 --- a/Projects/STM32756G_EVAL/Examples/I2C/I2C_EEPROM/Src/stm32f7xx_hal_msp.c +++ b/Projects/STM32756G_EVAL/Examples/I2C/I2C_EEPROM/Src/stm32f7xx_hal_msp.c @@ -134,9 +134,9 @@ void HAL_I2C_MspInit(I2C_HandleTypeDef *hi2c) HAL_NVIC_EnableIRQ(I2Cx_DMA_RX_IRQn); /* NVIC for I2Cx */ - HAL_NVIC_SetPriority(I2Cx_ER_IRQn, 0, 1); + HAL_NVIC_SetPriority(I2Cx_ER_IRQn, 1, 0); HAL_NVIC_EnableIRQ(I2Cx_ER_IRQn); - HAL_NVIC_SetPriority(I2Cx_EV_IRQn, 0, 2); + HAL_NVIC_SetPriority(I2Cx_EV_IRQn, 2, 0); HAL_NVIC_EnableIRQ(I2Cx_EV_IRQn); } diff --git a/Projects/STM32F769I_EVAL/Examples/I2C/I2C_EEPROM_FM+/Src/stm32f7xx_hal_msp.c b/Projects/STM32F769I_EVAL/Examples/I2C/I2C_EEPROM_FM+/Src/stm32f7xx_hal_msp.c index 3555266d..f6a655e7 100644 --- a/Projects/STM32F769I_EVAL/Examples/I2C/I2C_EEPROM_FM+/Src/stm32f7xx_hal_msp.c +++ b/Projects/STM32F769I_EVAL/Examples/I2C/I2C_EEPROM_FM+/Src/stm32f7xx_hal_msp.c @@ -134,9 +134,9 @@ void HAL_I2C_MspInit(I2C_HandleTypeDef *hi2c) HAL_NVIC_EnableIRQ(I2Cx_DMA_RX_IRQn); /* NVIC for I2Cx */ - HAL_NVIC_SetPriority(I2Cx_ER_IRQn, 0, 1); + HAL_NVIC_SetPriority(I2Cx_ER_IRQn, 1, 0); HAL_NVIC_EnableIRQ(I2Cx_ER_IRQn); - HAL_NVIC_SetPriority(I2Cx_EV_IRQn, 0, 2); + HAL_NVIC_SetPriority(I2Cx_EV_IRQn, 2, 0); HAL_NVIC_EnableIRQ(I2Cx_EV_IRQn); }