[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:
parent
5ff42d9979
commit
c7e2944ab9
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue