Added default handlers.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11528 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
92d73d9799
commit
482d67200a
|
@ -84,6 +84,18 @@
|
||||||
/* Driver exported functions. */
|
/* Driver exported functions. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
static OSAL_IRQ_HANDLER(aicSpuriousHandler) {
|
||||||
|
OSAL_IRQ_PROLOGUE();
|
||||||
|
(void)osalSysHalt("Spurious interrupt");
|
||||||
|
OSAL_IRQ_EPILOGUE();
|
||||||
|
}
|
||||||
|
|
||||||
|
static OSAL_IRQ_HANDLER(aicUnexpectedHandler) {
|
||||||
|
OSAL_IRQ_PROLOGUE();
|
||||||
|
osalSysHalt("Unexpected interrupt");
|
||||||
|
OSAL_IRQ_EPILOGUE();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief AIC Initialization.
|
* @brief AIC Initialization.
|
||||||
* @note Better reset everything in the AIC.
|
* @note Better reset everything in the AIC.
|
||||||
|
@ -99,6 +111,11 @@ void aicInit(void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
aicDisableWP(aic);
|
aicDisableWP(aic);
|
||||||
|
|
||||||
|
aic->AIC_SPU = (uint32_t)aicSpuriousHandler;
|
||||||
|
aic->AIC_SSR = 0;
|
||||||
|
aic->AIC_SVR = (uint32_t)aicUnexpectedHandler;
|
||||||
|
|
||||||
unsigned i;
|
unsigned i;
|
||||||
/* Disable all interrupts */
|
/* Disable all interrupts */
|
||||||
for (i = 1; i < ID_PERIPH_COUNT; i++) {
|
for (i = 1; i < ID_PERIPH_COUNT; i++) {
|
||||||
|
@ -106,16 +123,16 @@ void aicInit(void) {
|
||||||
aic->AIC_IDCR = AIC_IDCR_INTD;
|
aic->AIC_IDCR = AIC_IDCR_INTD;
|
||||||
|
|
||||||
/* Changes type */
|
/* Changes type */
|
||||||
aic->AIC_SSR = i;
|
|
||||||
aic->AIC_SMR = AIC_SMR_SRCTYPE(EXT_NEGATIVE_EDGE);
|
aic->AIC_SMR = AIC_SMR_SRCTYPE(EXT_NEGATIVE_EDGE);
|
||||||
|
|
||||||
/* Clear pending interrupt */
|
/* Clear pending interrupt */
|
||||||
aic->AIC_SSR = i;
|
|
||||||
aic->AIC_ICCR = AIC_ICCR_INTCLR;
|
aic->AIC_ICCR = AIC_ICCR_INTCLR;
|
||||||
|
|
||||||
/* Changes type */
|
/* Changes type */
|
||||||
aic->AIC_SSR = i;
|
|
||||||
aic->AIC_SMR = AIC_SMR_SRCTYPE(INT_LEVEL_SENSITIVE);
|
aic->AIC_SMR = AIC_SMR_SRCTYPE(INT_LEVEL_SENSITIVE);
|
||||||
|
|
||||||
|
/* Default handler */
|
||||||
|
aic->AIC_SVR = (uint32_t)aicUnexpectedHandler;
|
||||||
}
|
}
|
||||||
aicEnableWP(aic);
|
aicEnableWP(aic);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue