123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668 |
- /******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
- * File Name : stm32f10x_it.c
- * Author : MCD Application Team
- * Version : V1.1.2
- * Date : 09/22/2008
- * Description : Main Interrupt Service Routines.
- * This file provides template for all exceptions handler
- * and peripherals interrupt service routine.
- ********************************************************************************
- * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
- * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
- * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
- * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
- * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
- * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
- *******************************************************************************/
- /* Includes ------------------------------------------------------------------*/
- #include <rtthread.h>
- #include <serial.h>
- #include "board.h"
- /* Private typedef -----------------------------------------------------------*/
- /* Private define ------------------------------------------------------------*/
- /* Private macro -------------------------------------------------------------*/
- /* Private variables ---------------------------------------------------------*/
- /* Private function prototypes -----------------------------------------------*/
- /* Private functions ---------------------------------------------------------*/
- extern void rt_hw_timer_handler(void);
- extern void rt_hw_interrupt_thread_switch(void);
- /*******************************************************************************
- * Function Name : NMIException
- * Description : This function handles NMI exception.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void NMIException(void)
- {
- }
- /*******************************************************************************
- * Function Name : HardFaultException
- * Description : This function handles Hard Fault exception.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void HardFaultException(void)
- {
- /* Go to infinite loop when Hard Fault exception occurs */
- rt_kprintf("hard fault exception\n");
- while (1)
- {
- }
- }
- /*******************************************************************************
- * Function Name : MemManageException
- * Description : This function handles Memory Manage exception.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void MemManageException(void)
- {
- /* Go to infinite loop when Memory Manage exception occurs */
- rt_kprintf("memory manage exception\n");
- while (1)
- {
- }
- }
- /*******************************************************************************
- * Function Name : BusFaultException
- * Description : This function handles Bus Fault exception.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void BusFaultException(void)
- {
- /* Go to infinite loop when Bus Fault exception occurs */
- rt_kprintf("bus fault exception\n");
- while (1)
- {
- }
- }
- /*******************************************************************************
- * Function Name : UsageFaultException
- * Description : This function handles Usage Fault exception.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void UsageFaultException(void)
- {
- /* Go to infinite loop when Usage Fault exception occurs */
- rt_kprintf("usage fault exception\n");
- while (1)
- {
- }
- }
- /*******************************************************************************
- * Function Name : DebugMonitor
- * Description : This function handles Debug Monitor exception.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void DebugMonitor(void)
- {
- }
- /*******************************************************************************
- * Function Name : SVCHandler
- * Description : This function handles SVCall exception.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void SVCHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : SysTickHandler
- * Description : This function handles SysTick Handler.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void SysTickHandler(void)
- {
- /* handle os tick */
- rt_hw_timer_handler();
- }
- /*******************************************************************************
- * Function Name : WWDG_IRQHandler
- * Description : This function handles WWDG interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void WWDG_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : PVD_IRQHandler
- * Description : This function handles PVD interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void PVD_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : TAMPER_IRQHandler
- * Description : This function handles Tamper interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void TAMPER_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : RTC_IRQHandler
- * Description : This function handles RTC global interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void RTC_IRQHandler(void)
- {
- if (RTC_GetITStatus(RTC_IT_SEC) != RESET)
- {
- /* Clear the RTC Second interrupt */
- RTC_ClearITPendingBit(RTC_IT_SEC);
- /* Wait until last write operation on RTC registers has finished */
- RTC_WaitForLastTask();
- /* Reset RTC Counter when Time is 23:59:59 */
- if (RTC_GetCounter() == 0x00015180)
- {
- RTC_SetCounter(0x0);
- /* Wait until last write operation on RTC registers has finished */
- RTC_WaitForLastTask();
- }
- }
- }
- /*******************************************************************************
- * Function Name : FLASH_IRQHandler
- * Description : This function handles Flash interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void FLASH_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : RCC_IRQHandler
- * Description : This function handles RCC interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void RCC_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : EXTI0_IRQHandler
- * Description : This function handles External interrupt Line 0 request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void EXTI0_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : EXTI2_IRQHandler
- * Description : This function handles External interrupt Line 2 request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void EXTI2_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : EXTI3_IRQHandler
- * Description : This function handles External interrupt Line 3 request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void EXTI3_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : EXTI4_IRQHandler
- * Description : This function handles External interrupt Line 4 request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void EXTI4_IRQHandler(void)
- {
- #ifdef RT_USING_LWIP
- extern void rt_dm9000_isr(void);
- /* enter interrupt */
- rt_interrupt_enter();
- rt_dm9000_isr();
- /* Clear the Key Button EXTI line pending bit */
- EXTI_ClearITPendingBit(EXTI_Line4);
- /* leave interrupt */
- rt_interrupt_leave();
- rt_hw_interrupt_thread_switch();
- #endif
- }
- /*******************************************************************************
- * Function Name : DMA1_Channel1_IRQHandler
- * Description : This function handles DMA1 Channel 1 interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void DMA1_Channel1_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : DMA1_Channel2_IRQHandler
- * Description : This function handles DMA1 Channel 2 interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void DMA1_Channel2_IRQHandler(void)
- {
- #ifdef RT_USING_UART3
- extern struct rt_device uart3_device;
- /* enter interrupt */
- rt_interrupt_enter();
- if (DMA_GetITStatus(DMA1_IT_TC2))
- {
- /* transmission complete, invoke serial dma tx isr */
- rt_hw_serial_dma_tx_isr(&uart3_device);
- }
- /* clear DMA flag */
- DMA_ClearFlag(DMA1_FLAG_TC2 | DMA1_FLAG_TE2);
- /* leave interrupt */
- rt_interrupt_leave();
- rt_hw_interrupt_thread_switch();
- #endif
- }
- /*******************************************************************************
- * Function Name : DMA1_Channel3_IRQHandler
- * Description : This function handles DMA1 Channel 3 interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void DMA1_Channel3_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : DMA1_Channel4_IRQHandler
- * Description : This function handles DMA1 Channel 4 interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void DMA1_Channel4_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : DMA1_Channel5_IRQHandler
- * Description : This function handles DMA1 Channel 5 interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void DMA1_Channel5_IRQHandler(void)
- {
- #if !CODEC_USE_SPI3
- extern void codec_dma_isr(void);
- /* enter interrupt */
- rt_interrupt_enter();
- if (DMA_GetITStatus(DMA1_IT_TC5))
- {
- /* clear DMA flag */
- DMA_ClearFlag(DMA1_FLAG_TC5 | DMA1_FLAG_TE5);
- // rt_kprintf("DMA\n");
- /* transmission complete, invoke serial dma tx isr */
- codec_dma_isr();
- }
- /* leave interrupt */
- rt_interrupt_leave();
- #endif
- }
- /*******************************************************************************
- * Function Name : DMA1_Channel6_IRQHandler
- * Description : This function handles DMA1 Channel 6 interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void DMA1_Channel6_IRQHandler(void)
- {
- #ifdef RT_USING_UART2
- extern struct rt_device uart2_device;
- /* enter interrupt */
- rt_interrupt_enter();
- /* clear DMA flag */
- DMA_ClearFlag(DMA1_FLAG_TC6 | DMA1_FLAG_TE6);
- rt_hw_serial_dma_rx_isr(&uart2_device);
- /* leave interrupt */
- rt_interrupt_leave();
- rt_hw_interrupt_thread_switch();
- #endif
- }
- /*******************************************************************************
- * Function Name : EXTI9_5_IRQHandler
- * Description : This function handles External lines 9 to 5 interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void EXTI9_5_IRQHandler(void)
- {
- #ifdef RT_USING_LWIP
- extern void rt_dm9000_isr(void);
- /* enter interrupt */
- rt_interrupt_enter();
- rt_dm9000_isr();
- /* Clear the Key Button EXTI line pending bit */
- EXTI_ClearITPendingBit(EXTI_Line7);
- /* leave interrupt */
- rt_interrupt_leave();
- rt_hw_interrupt_thread_switch();
- #endif
- }
- /*******************************************************************************
- * Function Name : USART1_IRQHandler
- * Description : This function handles USART1 global interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void USART1_IRQHandler(void)
- {
- #ifdef RT_USING_UART1
- extern struct rt_device uart1_device;
- /* enter interrupt */
- rt_interrupt_enter();
- rt_hw_serial_isr(&uart1_device);
- /* leave interrupt */
- rt_interrupt_leave();
- rt_hw_interrupt_thread_switch();
- #endif
- }
- /*******************************************************************************
- * Function Name : USART2_IRQHandler
- * Description : This function handles USART2 global interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void USART2_IRQHandler(void)
- {
- #ifdef RT_USING_UART2
- extern struct rt_device uart2_device;
- /* enter interrupt */
- rt_interrupt_enter();
- rt_hw_serial_isr(&uart2_device);
- /* leave interrupt */
- rt_interrupt_leave();
- rt_hw_interrupt_thread_switch();
- #endif
- }
- /*******************************************************************************
- * Function Name : USART3_IRQHandler
- * Description : This function handles USART3 global interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void USART3_IRQHandler(void)
- {
- #ifdef RT_USING_UART3
- extern struct rt_device uart3_device;
- /* enter interrupt */
- rt_interrupt_enter();
- rt_hw_serial_isr(&uart3_device);
- /* leave interrupt */
- rt_interrupt_leave();
- rt_hw_interrupt_thread_switch();
- #endif
- }
- /*******************************************************************************
- * Function Name : EXTI15_10_IRQHandler
- * Description : This function handles External lines 15 to 10 interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void EXTI15_10_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : RTCAlarm_IRQHandler
- * Description : This function handles RTC Alarm interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void RTCAlarm_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : USBWakeUp_IRQHandler
- * Description : This function handles USB WakeUp interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void USBWakeUp_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : TIM8_BRK_IRQHandler
- * Description : This function handles TIM8 Break interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void TIM8_BRK_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : TIM8_UP_IRQHandler
- * Description : This function handles TIM8 overflow and update interrupt
- * request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void TIM8_UP_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : TIM8_TRG_COM_IRQHandler
- * Description : This function handles TIM8 Trigger and commutation interrupts
- * requests.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void TIM8_TRG_COM_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : TIM8_CC_IRQHandler
- * Description : This function handles TIM8 capture compare interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void TIM8_CC_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : ADC3_IRQHandler
- * Description : This function handles ADC3 global interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void ADC3_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : FSMC_IRQHandler
- * Description : This function handles FSMC global interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void FSMC_IRQHandler(void)
- {
- }
- /*******************************************************************************
- * Function Name : SDIO_IRQHandler
- * Description : This function handles SDIO global interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void SDIO_IRQHandler(void)
- {
- #ifdef RT_USING_DFS
- extern int SD_ProcessIRQSrc(void);
- /* enter interrupt */
- rt_interrupt_enter();
- /* Process All SDIO Interrupt Sources */
- SD_ProcessIRQSrc();
- /* leave interrupt */
- rt_interrupt_leave();
- rt_hw_interrupt_thread_switch();
- #endif
- }
- /*******************************************************************************
- * Function Name : DMA2_Channel2_IRQHandler
- * Description : This function handles DMA2 Channel 2 interrupt request.
- * Input : None
- * Output : None
- * Return : None
- *******************************************************************************/
- void DMA2_Channel2_IRQHandler(void)
- {
- #if CODEC_USE_SPI3
- extern void codec_dma_isr(void);
- /* enter interrupt */
- rt_interrupt_enter();
- if (DMA_GetITStatus(DMA2_IT_TC2))
- {
- /* clear DMA flag */
- DMA_ClearFlag(DMA2_FLAG_TC2 | DMA2_FLAG_TE2);
- /* transmission complete, invoke serial dma tx isr */
- codec_dma_isr();
- }
- /* leave interrupt */
- rt_interrupt_leave();
- #endif
- }
- /* add on 2009-12-31 for usb */
- extern void CTR_HP(void);
- extern void USB_Istr(void);
- void USB_HP_CAN1_TX_IRQHandler(void)
- {
- CTR_HP();
- }
- void USB_LP_CAN1_RX0_IRQHandler(void)
- {
- USB_Istr();
- }
- /* add on 2010-01-02 for remote */
- extern void remote_isr(void);
- void TIM5_IRQHandler(void)
- {
- remote_isr();
- }
|