[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

This commit is contained in:
Omar SAKET 2023-04-20 14:31:42 +01:00 committed by Ali Labbene
parent 5ff42d9979
commit c7e2944ab9
2 changed files with 4 additions and 4 deletions

View File

@ -134,9 +134,9 @@ void HAL_I2C_MspInit(I2C_HandleTypeDef *hi2c)
HAL_NVIC_EnableIRQ(I2Cx_DMA_RX_IRQn); HAL_NVIC_EnableIRQ(I2Cx_DMA_RX_IRQn);
/* NVIC for I2Cx */ /* 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_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); HAL_NVIC_EnableIRQ(I2Cx_EV_IRQn);
} }

View File

@ -134,9 +134,9 @@ void HAL_I2C_MspInit(I2C_HandleTypeDef *hi2c)
HAL_NVIC_EnableIRQ(I2Cx_DMA_RX_IRQn); HAL_NVIC_EnableIRQ(I2Cx_DMA_RX_IRQn);
/* NVIC for I2Cx */ /* 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_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); HAL_NVIC_EnableIRQ(I2Cx_EV_IRQn);
} }