/**
******************************************************************************
* @file Project/STM32F10x_StdPeriph_Template/stm32f10x_it.c
* @author MCD Application Team
* @version V3.4.0
* @date 10/15/2010
* @brief Main Interrupt Service Routines.
* This file provides template for all exceptions handler and
* peripherals interrupt service routine.
******************************************************************************
* @copy
*
* 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.
*
*
© COPYRIGHT 2010 STMicroelectronics
*/
/* Includes ------------------------------------------------------------------*/
#include
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/******************************************************************************/
/* Cortex-M3 Processor Exceptions Handlers */
/******************************************************************************/
/**
* @brief This function handles NMI exception.
* @param None
* @retval None
*/
void NMI_Handler(void)
{
}
/**
* @brief This function handles Hard Fault exception.
* @param None
* @retval None
*/
void HardFault_Handler(void)
{
/* Go to infinite loop when Hard Fault exception occurs */
#ifdef USE_RUNNING_MAKE
printf("\r\n[HFH]F=%d,L=%lu",g_usFileID,g_ulFileLine);
#endif
while (1)
{
}
}
/**
* @brief This function handles Memory Manage exception.
* @param None
* @retval None
*/
void MemManage_Handler(void)
{
/* Go to infinite loop when Memory Manage exception occurs */
#ifdef USE_RUNNING_MAKE
printf("\r\n[MMH]F=%d,L=%lu",g_usFileID,g_ulFileLine);
#endif
while (1)
{
}
}
/**
* @brief This function handles Bus Fault exception.
* @param None
* @retval None
*/
void BusFault_Handler(void)
{
/* Go to infinite loop when Bus Fault exception occurs */
#ifdef USE_RUNNING_MAKE
printf("\r\n[BFH]F=%d,L=%lu",g_usFileID,g_ulFileLine);
#endif
while (1)
{
}
}
/**
* @brief This function handles Usage Fault exception.
* @param None
* @retval None
*/
void UsageFault_Handler(void)
{
/* Go to infinite loop when Usage Fault exception occurs */
#ifdef USE_RUNNING_MAKE
printf("\r\n[UFH]F=%d,L=%lu",g_usFileID,g_ulFileLine);
#endif
while (1)
{
}
}
/**
* @brief This function handles SVCall exception.
* @param None
* @retval None
*/
//void SVC_Handler(void)
//{
//}
/**
* @brief This function handles Debug Monitor exception.
* @param None
* @retval None
*/
void DebugMon_Handler(void)
{
}
/**
* @brief This function handles SysTick Handler.
* @param None
* @retval None
*/
//static int siSecCt=0;
//void SysTick_Handler(void)
//{
// //sutSysMsg.Tick10ms=1;
// if(++siSecCt>=50){
// siSecCt=0;
// //sutSysMsg.Tick500ms=1;
// }
//
//}
//void TIM2_IRQHandler(void)
//{
// if (TIM_GetITStatus(TIM2, TIM_IT_Update) != RESET)
// {
// /* Clear TIM2 Capture Compare1 interrupt pending bit*/
// TIM_ClearITPendingBit(TIM2, TIM_IT_Update);
// //每ms加1
// g_ulSysTick++;
// }
// }
/*******************************************************************************
* Function Name : USART1_IRQHandler
* Description : This function handles USART1 global interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void USART1_IRQHandler(void)
{
RS485_DIR_LOW;
UART1RxTxISRHandler();
}
/*******************************************************************************
* Function Name : USART2_IRQHandler
* Description : This function handles USART2 global interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void USART2_IRQHandler(void)
{
UART2RxTxISRHandler();
}
/*******************************************************************************
* Function Name : USART3_IRQHandler
* Description : This function handles USART1 global interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void USART3_IRQHandler(void)
{
UART3RxTxISRHandler();
}
void DMA1_Channel2_IRQHandler(void)
{
//USART3_SendOK_IQ();
}
void DMA1_Channel4_IRQHandler(void)
{
USART1_SendOK_IQ();
}
//unsigned char g_ucRX_START=0;
//unsigned char g_ucRX_STOP=0;
//char RecvBuf[1024];
//int RecvBufCt=0;
/*
用于RTC计算 50ms调用一次,1秒=20次
*/
void TIM2_IRQHandler(void)
{
//__IO static unsigned char ct=0;
if(TIM_GetITStatus(TIM2, TIM_IT_Update) != RESET){
TIM_ClearITPendingBit(TIM2,TIM_FLAG_Update);
// if(++ct>19){
// ct=0;
// RTCIncSecond();
// }
}
}
void TIM3_IRQHandler(void)
{
// if(TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET){
// g_ucRecvStat++;
// if(g_ucRecvStat == COM_STOP_BIT){
// TIM_Cmd(TIM3, DISABLE);
// TIM_ClearITPendingBit(TIM3,TIM_FLAG_Update);
// RecvBuf[RecvBufCt]=g_ucRecvData;
// RecvBufCt++;
// g_ucRX_STOP=1;
// TIM_Cmd(TIM4,ENABLE);
// return;
// }
// if(COM_RX_STAT){ //'1'
// g_ucRecvData |= (1 << (g_ucRecvStat - 1));
// }
// else{ //'0'
// g_ucRecvData &= ~(1 <<(g_ucRecvStat - 1));
// }
// TIM_ClearITPendingBit(TIM3,TIM_FLAG_Update);
// }
}
void TIM4_IRQHandler(void)
{
// if(TIM_GetITStatus(TIM4, TIM_IT_Update) != RESET){
// if(g_ucRX_START==1 && g_ucRX_STOP==1){
// g_ucRX_START=0;
// g_ucRX_STOP=0;
//// printf("%s\r\n",RecvBuf);//此处RecvBuf已接收完整,可以取出
// RecvBufCt=0;
// memset(RecvBuf,0,sizeof(RecvBuf));
// TIM_Cmd(TIM4,DISABLE);
// }
// TIM_ClearITPendingBit(TIM4,TIM_FLAG_Update);
// }
}
void EXTI15_10_IRQHandler(void)
{
// if(EXTI_GetITStatus(EXTI_Line13)!=RESET)
// {
// if(!COM_RX_STAT)
// {
// if(g_ucRecvStat == COM_STOP_BIT)
// {
// g_ucRecvStat = COM_START_BIT;
// COM_RX_Start_Delay(g_iCOMRXDelayCt);
// TIM_Cmd(TIM3, ENABLE);
// g_ucRX_START=1;
// g_ucRX_STOP=0;
// TIM_Cmd(TIM4,DISABLE);
// }
// }
// EXTI_ClearITPendingBit(EXTI_Line13);
// }
}
/******************************************************************************/
/* STM32F10x Peripherals Interrupt Handlers */
/* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
/* available peripheral interrupt handler's name please refer to the startup */
/* file (startup_stm32f10x_xx.s). */
/******************************************************************************/
/**
* @brief This function handles PPP interrupt request.
* @param None
* @retval None
*/
/*void PPP_IRQHandler(void)
{
}*/
/**
* @}
*/
/******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/