📄 stm32f10x_it.c
字号:
/******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
* File Name : stm32f10x_it.c
* Author : MCD Application Team
* Version : V1.1
* Date : 11/26/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 "main.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
static vu32 Index = 0;
static vu32 AlarmStatus = 0;
static vu32 LedCounter = 0;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/*******************************************************************************
* Function Name : NMIException
* Description : This function handles NMI exception.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void NMIException(void)
{
u32 tmp = 318, index = 0;
/* Disable LCD Window mode */
LCD_WindowModeDisable();
/* If HSE is not detected at program startup or HSE clock failed during program execution */
if((Get_HSEStartUpStatus() == ERROR) || (RCC_GetITStatus(RCC_IT_CSS) != RESET))
{
/* Clear the LCD */
LCD_Clear(White);
/* Set the LCD Back Color */
LCD_SetBackColor(Blue);
/* Set the LCD Text Color */
LCD_SetTextColor(White);
/* Display " No Clock Detected " message */
LCD_DisplayStringLine(Line0, "No HSE Clock Detected");
LCD_DisplayStringLine(Line1, "Detected. STANDBY ");
LCD_DisplayStringLine(Line2, "mode in few seconds. ");
LCD_DisplayStringLine(Line5, "If HSE Clock recovers");
LCD_DisplayStringLine(Line6, "before the time out a");
LCD_DisplayStringLine(Line7, "system reset is ");
LCD_DisplayStringLine(Line8, "generated. ");
LCD_ClearLine(Line9);
/* Clear Clock Security System interrupt pending bit */
RCC_ClearITPendingBit(RCC_IT_CSS);
GPIO_SetBits(GPIOC, GPIO_Pin_6 | GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9);
/* Enable HSE */
RCC_HSEConfig(RCC_HSE_ON);
LCD_ClearLine(Line4);
/* Set the Back Color */
LCD_SetBackColor(White);
/* Set the Text Color */
LCD_SetTextColor(Red);
LCD_DrawRect(71, 319, 25, 320);
LCD_SetBackColor(Green);
LCD_SetTextColor(White);
/* Wait till HSE is ready */
while(RCC_GetFlagStatus(RCC_FLAG_HSERDY) == RESET)
{
if(index == 0x3FFFF)
{
LCD_DisplayChar(Line3, tmp, 0x20);
tmp -= 16;
index = 0;
}
index++;
/* Enters the system in STANDBY mode */
if(tmp < 16)
{
LCD_SetBackColor(Blue);
LCD_ClearLine(Line3);
LCD_ClearLine(Line4);
LCD_ClearLine(Line5);
LCD_ClearLine(Line6);
LCD_DisplayStringLine(Line7, " MCU in STANDBY Mode");
LCD_DisplayStringLine(Line8, "To exit press Wakeup");
/* Request to enter STANDBY mode */
PWR_EnterSTANDBYMode();
}
}
/* Generate a system reset */
NVIC_GenerateSystemReset();
}
}
/*******************************************************************************
* 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 */
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 */
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 */
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 */
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 : PendSVC
* Description : This function handles PendSVC exception.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void PendSVC(void)
{
}
/*******************************************************************************
* Function Name : SysTickHandler
* Description : This function handles SysTick Handler.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void SysTickHandler(void)
{
/* Decrement the TimingDelay variable */
Decrement_TimingDelay();
}
/*******************************************************************************
* 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 counter is equal to 86339: one day was elapsed */
if((RTC_GetCounter()/3600 == 23)&&(((RTC_GetCounter()%3600)/60) == 59)&&
(((RTC_GetCounter()%3600)%60) == 59)) /* 23*3600 + 59*60 + 59 = 86339 */
{
/* Wait until last write operation on RTC registers has finished */
RTC_WaitForLastTask();
/* Reset counter value */
RTC_SetCounter(0x0);
/* Wait until last write operation on RTC registers has finished */
RTC_WaitForLastTask();
/* Increment the date */
Date_Update();
}
/* Clear the RTC Second Interrupt pending bit */
RTC_ClearITPendingBit(RTC_IT_SEC);
}
/*******************************************************************************
* 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 : EXTI1_IRQHandler
* Description : This function handles External interrupt Line 1 request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void EXTI1_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)
{
}
/*******************************************************************************
* Function Name : DMAChannel1_IRQHandler
* Description : This function handles DMA Stream 1 interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void DMAChannel1_IRQHandler(void)
{
}
/*******************************************************************************
* Function Name : DMAChannel2_IRQHandler
* Description : This function handles DMA Stream 2 interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void DMAChannel2_IRQHandler(void)
{
}
/*******************************************************************************
* Function Name : DMAChannel3_IRQHandler
* Description : This function handles DMA Stream 3 interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void DMAChannel3_IRQHandler(void)
{
}
/*******************************************************************************
* Function Name : DMAChannel4_IRQHandler
* Description : This function handles DMA Stream 4 interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void DMAChannel4_IRQHandler(void)
{
}
/*******************************************************************************
* Function Name : DMAChannel5_IRQHandler
* Description : This function handles DMA Stream 5 interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void DMAChannel5_IRQHandler(void)
{
}
/*******************************************************************************
* Function Name : DMAChannel6_IRQHandler
* Description : This function handles DMA Stream 6 interrupt request.
* Input : None
* Output : None
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -