diff options
author | isiora <none@example.com> | 2018-02-21 18:51:32 +0000 |
---|---|---|
committer | isiora <none@example.com> | 2018-02-21 18:51:32 +0000 |
commit | 482d67200ab9bf0ff6f324b1ec74b7ab3cfbb518 (patch) | |
tree | e524a0a99e4f6d704e64f9b7a01b9f885bafef14 | |
parent | 92d73d9799af401843c9616228370cfcf12ff0b1 (diff) | |
download | ChibiOS-482d67200ab9bf0ff6f324b1ec74b7ab3cfbb518.tar.gz ChibiOS-482d67200ab9bf0ff6f324b1ec74b7ab3cfbb518.tar.bz2 ChibiOS-482d67200ab9bf0ff6f324b1ec74b7ab3cfbb518.zip |
Added default handlers.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11528 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/ports/SAMA/SAMA5D2x/aic.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/os/hal/ports/SAMA/SAMA5D2x/aic.c b/os/hal/ports/SAMA/SAMA5D2x/aic.c index ff66cceb9..e207e579d 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/aic.c +++ b/os/hal/ports/SAMA/SAMA5D2x/aic.c @@ -84,6 +84,18 @@ /* 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.
* @note Better reset everything in the AIC.
@@ -99,6 +111,11 @@ void aicInit(void) { #endif
aicDisableWP(aic);
+
+ aic->AIC_SPU = (uint32_t)aicSpuriousHandler;
+ aic->AIC_SSR = 0;
+ aic->AIC_SVR = (uint32_t)aicUnexpectedHandler;
+
unsigned i;
/* Disable all interrupts */
for (i = 1; i < ID_PERIPH_COUNT; i++) {
@@ -106,16 +123,16 @@ void aicInit(void) { aic->AIC_IDCR = AIC_IDCR_INTD;
/* Changes type */
- aic->AIC_SSR = i;
aic->AIC_SMR = AIC_SMR_SRCTYPE(EXT_NEGATIVE_EDGE);
/* Clear pending interrupt */
- aic->AIC_SSR = i;
aic->AIC_ICCR = AIC_ICCR_INTCLR;
/* Changes type */
- aic->AIC_SSR = i;
aic->AIC_SMR = AIC_SMR_SRCTYPE(INT_LEVEL_SENSITIVE);
+
+ /* Default handler */
+ aic->AIC_SVR = (uint32_t)aicUnexpectedHandler;
}
aicEnableWP(aic);
}
|