Improved AIC to work with both secure and non secure mode.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10621 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
65874b21bd
commit
11e716fc01
|
@ -82,7 +82,17 @@
|
|||
*/
|
||||
void aicInit(void) {
|
||||
|
||||
#if SAMA_HAL_IS_SECURE
|
||||
Aic *aic = SAIC;
|
||||
/* Redirect interrupts */
|
||||
uint32_t aicredir = SFR_AICREDIR_AICREDIRKEY(AIC_REDIR_KEY);
|
||||
SFR->SFR_AICREDIR = (aicredir ^ SFR->SFR_SN1);
|
||||
#else
|
||||
Aic *aic = AIC;
|
||||
/* Redirect interrupts */
|
||||
uint32_t aicredir = SFR_AICREDIR_AICREDIRKEY(AIC_REDIR_KEY);
|
||||
SFR->SFR_AICREDIR = (aicredir ^ SFR->SFR_SN1) | SFR_AICREDIR_NSAIC;
|
||||
#endif
|
||||
|
||||
unsigned i;
|
||||
/* Disable all interrupts */
|
||||
|
|
|
@ -29,6 +29,11 @@
|
|||
/* Driver constants. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief AIC unique redirect key.
|
||||
*/
|
||||
#define AIC_REDIR_KEY 0x5B6C0E26U
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Driver pre-compile time settings. */
|
||||
/*===========================================================================*/
|
||||
|
@ -47,10 +52,9 @@
|
|||
|
||||
/**
|
||||
* @brief Acknowledge the current interrupt.
|
||||
*
|
||||
*/
|
||||
#define aicAckInt() { \
|
||||
SAIC->AIC_EOICR = AIC_EOICR_ENDIT; \
|
||||
#define aicAckInt() { \
|
||||
SAIC->AIC_EOICR = AIC_EOICR_ENDIT; \
|
||||
}
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
Loading…
Reference in New Issue