Added missing file.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13234 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
356563fda7
commit
0b80fa4bcb
|
@ -0,0 +1,104 @@
|
||||||
|
/*
|
||||||
|
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file EXTIv1/stm32_exti19-21.inc
|
||||||
|
* @brief Shared EXTI19-21 handler.
|
||||||
|
*
|
||||||
|
* @addtogroup STM32_EXTI1921_HANDLER
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* Driver local definitions. */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* Derived constants and error checks. */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/* Priority settings checks.*/
|
||||||
|
#if !defined(STM32_IRQ_EXTI1921_PRIORITY)
|
||||||
|
#error "STM32_IRQ_EXTI1921_PRIORITY not defined in mcuconf.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !OSAL_IRQ_IS_VALID_PRIORITY(STM32_IRQ_EXTI1921_PRIORITY)
|
||||||
|
#error "Invalid IRQ priority assigned to STM32_IRQ_EXTI1921_PRIORITY"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* Driver exported variables. */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* Driver local variables. */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* Driver local functions. */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
static inline void exti19_exti21_irq_init(void) {
|
||||||
|
#if defined(STM32_EXTI19_IS_USED) || defined(STM32_EXTI21_IS_USED)
|
||||||
|
nvicEnableVector(STM32_EXTI1921_NUMBER, STM32_IRQ_EXTI1921_PRIORITY);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void exti19_exti21_irq_deinit(void) {
|
||||||
|
#if defined(STM32_EXTI19_IS_USED) || defined(STM32_EXTI21_IS_USED)
|
||||||
|
nvicDisableVector(STM32_EXTI1921_NUMBER);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* Driver interrupt handlers. */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
#if defined(STM32_EXTI19_IS_USED) || defined(STM32_EXTI21_IS_USED) || \
|
||||||
|
defined(__DOXYGEN__)
|
||||||
|
#if !defined(STM32_DISABLE_EXTI1921_HANDLER)
|
||||||
|
/**
|
||||||
|
* @brief EXTI[0], EXTI[1] interrupt handler.
|
||||||
|
*
|
||||||
|
* @isr
|
||||||
|
*/
|
||||||
|
OSAL_IRQ_HANDLER(STM32_EXTI1921_HANDLER) {
|
||||||
|
uint32_t pr;
|
||||||
|
|
||||||
|
OSAL_IRQ_PROLOGUE();
|
||||||
|
|
||||||
|
extiGetAndClearGroup1((1U << 19) | (1U << 21), pr);
|
||||||
|
|
||||||
|
/* Could be unused.*/
|
||||||
|
(void)pr;
|
||||||
|
|
||||||
|
#if defined(STM32_EXTI19_ISR)
|
||||||
|
STM32_EXTI16_ISR(pr, 19);
|
||||||
|
#endif
|
||||||
|
#if defined(STM32_EXTI21_ISR)
|
||||||
|
STM32_EXTI16_ISR(pr, 21);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
OSAL_IRQ_EPILOGUE();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* Driver exported functions. */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/** @} */
|
Loading…
Reference in New Issue