aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-24 07:25:22 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-24 07:25:22 +0000
commit30400ff28785c156264fb97069b127e8dbfb7491 (patch)
tree89773e26590764fd1a5639f4e6ed9593d93c7b67 /os/hal/platforms
parent02ee640478eff8c8a5091e6315d06b0e2ce0d188 (diff)
downloadChibiOS-30400ff28785c156264fb97069b127e8dbfb7491.tar.gz
ChibiOS-30400ff28785c156264fb97069b127e8dbfb7491.tar.bz2
ChibiOS-30400ff28785c156264fb97069b127e8dbfb7491.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4342 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms')
-rw-r--r--os/hal/platforms/STM32/sdc_lld.c9
-rw-r--r--os/hal/platforms/STM32/sdc_lld.h8
-rw-r--r--os/hal/platforms/STM32F1xx/stm32_isr.h6
-rw-r--r--os/hal/platforms/STM32F2xx/stm32_isr.h6
-rw-r--r--os/hal/platforms/STM32F4xx/stm32_isr.h6
5 files changed, 32 insertions, 3 deletions
diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c
index 9f56b8d59..84eb66b0b 100644
--- a/os/hal/platforms/STM32/sdc_lld.c
+++ b/os/hal/platforms/STM32/sdc_lld.c
@@ -277,6 +277,9 @@ static void sdc_lld_error_cleanup(SDCDriver *sdcp,
/* Driver interrupt handlers. */
/*===========================================================================*/
+#if !defined(STM32_SDIO_HANDLER)
+#error "STM32_SDIO_HANDLER not defined"
+#endif
/**
* @brief SDIO IRQ handler.
* @details It just wakes transaction thread. All error handling performs in
@@ -284,7 +287,7 @@ static void sdc_lld_error_cleanup(SDCDriver *sdcp,
*
* @isr
*/
-CH_IRQ_HANDLER(SDIO_IRQHandler) {
+CH_IRQ_HANDLER(STM32_SDIO_HANDLER) {
CH_IRQ_PROLOGUE();
@@ -352,7 +355,7 @@ void sdc_lld_start(SDCDriver *sdcp) {
#if (defined(STM32F4XX) || defined(STM32F2XX))
dmaStreamSetFIFO(sdcp->dma, STM32_DMA_FCR_DMDIS | STM32_DMA_FCR_FTH_FULL);
#endif
- nvicEnableVector(SDIO_IRQn,
+ nvicEnableVector(STM32_SDIO_NUMBER,
CORTEX_PRIORITY_MASK(STM32_SDC_SDIO_IRQ_PRIORITY));
rccEnableSDIO(FALSE);
}
@@ -380,7 +383,7 @@ void sdc_lld_stop(SDCDriver *sdcp) {
SDIO->DTIMER = 0;
/* Clock deactivation.*/
- nvicDisableVector(SDIO_IRQn);
+ nvicDisableVector(STM32_SDIO_NUMBER);
dmaStreamRelease(sdcp->dma);
rccDisableSDIO(FALSE);
}
diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h
index 7511bf581..79eac638a 100644
--- a/os/hal/platforms/STM32/sdc_lld.h
+++ b/os/hal/platforms/STM32/sdc_lld.h
@@ -121,6 +121,14 @@
#error "SDIO not present in the selected device"
#endif
+#if !CORTEX_IS_VALID_KERNEL_PRIORITY(STM32_SDC_SDIO_IRQ_PRIORITY)
+#error "Invalid IRQ priority assigned to SDIO"
+#endif
+
+#if !STM32_DMA_IS_VALID_PRIORITY(STM32_SDC_SDIO_DMA_PRIORITY)
+#error "Invalid DMA priority assigned to SDIO"
+#endif
+
#if !defined(STM32_DMA_REQUIRED)
#define STM32_DMA_REQUIRED
#endif
diff --git a/os/hal/platforms/STM32F1xx/stm32_isr.h b/os/hal/platforms/STM32F1xx/stm32_isr.h
index 27e837ce8..e79efd155 100644
--- a/os/hal/platforms/STM32F1xx/stm32_isr.h
+++ b/os/hal/platforms/STM32F1xx/stm32_isr.h
@@ -59,6 +59,12 @@
#define STM32_CAN2_SCE_NUMBER CAN2_SCE_IRQn
/*
+ * SDIO unit.
+ */
+#define STM32_SDIO_HANDLER SDIO_IRQHandler
+#define STM32_SDIO_NUMBER SDIO_IRQn
+
+/*
* TIM units.
*/
#if defined(STM32F10X_XL)
diff --git a/os/hal/platforms/STM32F2xx/stm32_isr.h b/os/hal/platforms/STM32F2xx/stm32_isr.h
index 480b28396..18ead99e1 100644
--- a/os/hal/platforms/STM32F2xx/stm32_isr.h
+++ b/os/hal/platforms/STM32F2xx/stm32_isr.h
@@ -59,6 +59,12 @@
#define STM32_CAN2_SCE_NUMBER CAN2_SCE_IRQn
/*
+ * SDIO unit.
+ */
+#define STM32_SDIO_HANDLER SDIO_IRQHandler
+#define STM32_SDIO_NUMBER SDIO_IRQn
+
+/*
* TIM units.
*/
#define STM32_TIM1_UP_HANDLER TIM1_UP_IRQHandler
diff --git a/os/hal/platforms/STM32F4xx/stm32_isr.h b/os/hal/platforms/STM32F4xx/stm32_isr.h
index f0b1ad14c..23f9fc19d 100644
--- a/os/hal/platforms/STM32F4xx/stm32_isr.h
+++ b/os/hal/platforms/STM32F4xx/stm32_isr.h
@@ -59,6 +59,12 @@
#define STM32_CAN2_SCE_NUMBER CAN2_SCE_IRQn
/*
+ * SDIO unit.
+ */
+#define STM32_SDIO_HANDLER SDIO_IRQHandler
+#define STM32_SDIO_NUMBER SDIO_IRQn
+
+/*
* TIM units.
*/
#define STM32_TIM1_UP_HANDLER TIM1_UP_IRQHandler