微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > stm32f10x_it.c 的书写

stm32f10x_it.c 的书写

时间:11-17 来源:互联网 点击:
从名字上看,这个文件包含的是和中断相关的函数。

确实,中断服务函数应该放到这里来。

但是

这个里面还包含了一些其它的异常中断的信息。

/**

******************************************************************************

* @file USART/Printf/stm32f10x_it.c

* @author MCD Application Team

* @version V3.1.0

* @date 06/19/2009

* @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 2009 STMicroelectronics

*/

#include "stm32f10x_it.h"

#include "stm32f10x_exti.h"

/**

* @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 */

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 */

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 */

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 */

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 PendSV_Handler exception.

* @param None

* @retval None

*/

void PendSV_Handler(void)

{

}

/**

* @brief This function handles SysTick Handler.

* @param None

* @retval None

*/

extern void SysTick_ISR(void);

/*void SysTick_Handler(void)

{

if(net_time05++>=1000)

{ //0.5秒溢出标志

net_time05=0;

net_timeover05=1;

}

if(net_time10++>=20000)

{ //10秒溢出标志

net_time10=0;

net_timeover10=1;

}

}*/

/****************************************************************************

* 名 称:void EXTI1_IRQHandler(void)

* 功 能:ENC28J60 接收完成 EXTI1中断处理程序

* 入口参数:无

* 出口参数:无

* 说 明:

* 调用方法:无

****************************************************************************/

void EXTI1_IRQHandler(void)

{

/*if(EXTI_GetITStatus(EXTI_Line1) != RESET) //判别是否有键按下

{

ETH_INT=1; //设置接收完成标志

EXTI_ClearITPendingBit(EXTI_Line1); //清除中断请求标志

}*/

}

void EXTI9_5_IRQHandler(void)

{

if(EXTI_GetITStatus(EXTI_Line6) != RESET)

{

ETH_INT=1; //设置接收完成标志

EXTI_ClearITPendingBit(EXTI_Line6); //清除中断请求标志

}

}

/******************************************************************************/

/* STM32F10x Peripherals Interrupt Handlers */

/* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */

/* available peripheral interrupt handlers name please refer to the startup */

/* file (startup_stm32f10x_xx.s).

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top