⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stm32f10x_it.c

📁 用 Hitex 工具软件开发 stm32 的例子
💻 C
📖 第 1 页 / 共 3 页
字号:
/******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
* File Name          : stm32f10x_it.c
* Author             : MCD Application Team
* Version            : V1.0
* Date               : 10/08/2007
* Description        : Main Interrupt Service Routines.
*                      This file can be used to describe all the exceptions 
*                      subroutines that may occur within user application.
*                      When an interrupt happens, the software will branch 
*                      automatically to the corresponding routine.
*                      The following routines are all empty, user can write code 
*                      for exceptions handlers and peripherals IRQ interrupts.
********************************************************************************
* THE PRESENT SOFTWARE 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 SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/

/* Includes ------------------------------------------------------------------*/
#include "stm32f10x_it.h"
#include "main.h"
#include "uart.h"
#include "system.h"
#include "usb_lib.h"
#include "systick.h"
#include "measure_main.h"
#include "uir.h"
#include "can.h"

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/  
//extern vu32 TimeTick; /* global counter */
extern void USB_Istr(void);
extern void CAN_isr(void);
extern void Dummy(void);

void (*RemoteRoutine)(void)=Dummy;


/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/

/*******************************************************************************
* Function Name  : NMIException
* Description    : This function handles NMI exception.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(2) NMIException(void)
#else
void NMIException(void)
#endif
{
}

/*******************************************************************************
* Function Name  : HardFaultException
* Description    : This function handles Hard Fault exception.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(3) __noreturn__ HardFaultException(void)
#else
void HardFaultException(void)
#endif
{
  /* Go to infinite loop when Hard Fault exception occurs */
  while (1)
  {
  }
}

/*******************************************************************************
* Function Name  : MemManageException
* Description    : This function handles Memory Manage exception.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(4) __noreturn__ MemManageException(void)
#else
void MemManageException(void)
#endif
{
  /* Go to infinite loop when Memory Manage exception occurs */
  while (1)
  {
  }
}

/*******************************************************************************
* Function Name  : BusFaultException
* Description    : This function handles Bus Fault exception.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(5) __noreturn__ BusFaultException(void)
#else
void BusFaultException(void)
#endif
{
  /* Go to infinite loop when Bus Fault exception occurs */
  while (1)
  {
  }
}

/*******************************************************************************
* Function Name  : UsageFaultException
* Description    : This function handles Usage Fault exception.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(6) __noreturn__ UsageFaultException(void)
#else
void UsageFaultException(void)
#endif
{
  /* Go to infinite loop when Usage Fault exception occurs */
  while (1)
  {
  }
}

/*******************************************************************************
* Function Name  : DebugMonitor
* Description    : This function handles Debug Monitor exception.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(12) DebugMonitor(void)
#else
void DebugMonitor(void)
#endif
{
}

/*******************************************************************************
* Function Name  : SVCHandler
* Description    : This function handles SVCall exception.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(11) SVCHandler(void)
#else
void SVCHandler(void)
#endif
{
}

/*******************************************************************************
* Function Name  : PendSVC
* Description    : This function handles PendSVC exception.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(14) PendSVC(void)
#else
void PendSVC(void)
#endif
{
}

/*******************************************************************************
* Function Name  : SysTickHandler
* Description    : This function handles SysTick Handler.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(15) SysTickHandler(void)
#else
void SysTickHandler(void)
#endif
{
   systick_isr();
}

/*******************************************************************************
* Function Name  : WWDG_IRQHandler
* Description    : This function handles WWDG interrupt request.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(16) __noreturn__ WWDG_IRQHandler(void)
#else
void WWDG_IRQHandler(void)
#endif
{
   while(1);
}

/*******************************************************************************
* Function Name  : PVD_IRQHandler
* Description    : This function handles PVD interrupt request.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(17) PVD_IRQHandler(void)
#else
void PVD_IRQHandler(void)
#endif
{
}

/*******************************************************************************
* Function Name  : TAMPER_IRQHandler
* Description    : This function handles Tamper interrupt request. 
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(18) TAMPER_IRQHandler(void)
#else
void TAMPER_IRQHandler(void)
#endif
{
}

/*******************************************************************************
* Function Name  : RTC_IRQHandler
* Description    : This function handles RTC global interrupt request.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(19) RTC_IRQHandler(void)
#else
void RTC_IRQHandler(void)
#endif
{
   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();    
   }
}

/*******************************************************************************
* Function Name  : FLASH_IRQHandler
* Description    : This function handles Flash interrupt request.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(20) FLASH_IRQHandler(void)
#else
void FLASH_IRQHandler(void)
#endif
{
}

/*******************************************************************************
* Function Name  : RCC_IRQHandler
* Description    : This function handles RCC interrupt request. 
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(21) RCC_IRQHandler(void)
#else
void RCC_IRQHandler(void)
#endif
{
}

/*******************************************************************************
* Function Name  : EXTI0_IRQHandler
* Description    : This function handles External interrupt Line 0 request.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(22) EXTI0_IRQHandler(void)
#else
void EXTI0_IRQHandler(void)
#endif
{
   /*Interruptfunktin for Event Counter*/
   if(CounterState.enabled != FALSE)
   {
      if(GPIO_ReadInputDataBit(GPIOC,GPIO_Pin_13) == 0x01)
      {
        if(Counter_Gate == FALSE)
        {
            event_counter = 0;
            Counter_Gate = TRUE;
        }
      }
      else
      {
        Counter_Gate = FALSE;
      }
    
      if(Counter_Gate == TRUE)
      {
         event_counter++;
         if(event_counter == 0xFFFFFFFF)
            event_counter = 0;
      }
   }   
   /*Interrupt for Freq.*/
   if(ScanState.enabled != FALSE)
   {
      if(tim_set_null == 1)
      {
         TIM_SetCounter(TIM2,0);
         freq_time = 0;
         tim_set_null = 0;
      }
      else
      {
         freq_time = TIM_GetCounter(TIM2);
         if(freq_time == 0)
             freq_time = 0x2710;
         frequency = 0x2710/freq_time;
         tim_set_null = 1;
      }
    
   }

   EXTI_ClearFlag(EXTI_Line0);
}

/*******************************************************************************
* Function Name  : EXTI1_IRQHandler
* Description    : This function handles External interrupt Line 1 request.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
#ifdef TaskingVXtoolset
void __interrupt(23) EXTI1_IRQHandler(void)
#else
void EXTI1_IRQHandler(void)
#endif
{
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -