stm32f10x_it.c 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. /**
  2. ******************************************************************************
  3. * @file Project/STM32F10x_StdPeriph_Template/stm32f10x_it.c
  4. * @author MCD Application Team
  5. * @version V3.5.0
  6. * @date 08-April-2011
  7. * @brief Main Interrupt Service Routines.
  8. * This file provides template for all exceptions handler and
  9. * peripherals interrupt service routine.
  10. ******************************************************************************
  11. * @attention
  12. *
  13. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  14. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  15. * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  16. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  17. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  18. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  19. *
  20. * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
  21. ******************************************************************************
  22. */
  23. /* Includes ------------------------------------------------------------------*/
  24. #include "stm32f10x_it.h"
  25. #include "usart.h"
  26. #include "rtc.h"
  27. /* Private typedef -----------------------------------------------------------*/
  28. /* Private define ------------------------------------------------------------*/
  29. /* Private macro -------------------------------------------------------------*/
  30. /* Private variables ---------------------------------------------------------*/
  31. /* Private function prototypes -----------------------------------------------*/
  32. /* Private functions ---------------------------------------------------------*/
  33. /******************************************************************************/
  34. /* Cortex-M3 Processor Exceptions Handlers */
  35. /******************************************************************************/
  36. /**
  37. * @brief This function handles NMI exception.
  38. * @param None
  39. * @retval None
  40. */
  41. void NMI_Handler(void)
  42. {
  43. }
  44. /**
  45. * @brief This function handles Hard Fault exception.
  46. * @param None
  47. * @retval None
  48. */
  49. void HardFault_Handler(void)
  50. {
  51. /* Go to infinite loop when Hard Fault exception occurs */
  52. while (1)
  53. {
  54. }
  55. }
  56. /**
  57. * @brief This function handles Memory Manage exception.
  58. * @param None
  59. * @retval None
  60. */
  61. void MemManage_Handler(void)
  62. {
  63. /* Go to infinite loop when Memory Manage exception occurs */
  64. while (1)
  65. {
  66. }
  67. }
  68. /**
  69. * @brief This function handles Bus Fault exception.
  70. * @param None
  71. * @retval None
  72. */
  73. void BusFault_Handler(void)
  74. {
  75. /* Go to infinite loop when Bus Fault exception occurs */
  76. while (1)
  77. {
  78. }
  79. }
  80. /**
  81. * @brief This function handles Usage Fault exception.
  82. * @param None
  83. * @retval None
  84. */
  85. void UsageFault_Handler(void)
  86. {
  87. /* Go to infinite loop when Usage Fault exception occurs */
  88. while (1)
  89. {
  90. }
  91. }
  92. /**
  93. * @brief This function handles SVCall exception.
  94. * @param None
  95. * @retval None
  96. */
  97. void SVC_Handler(void)
  98. {
  99. }
  100. /**
  101. * @brief This function handles Debug Monitor exception.
  102. * @param None
  103. * @retval None
  104. */
  105. void DebugMon_Handler(void)
  106. {
  107. }
  108. /**
  109. * @brief This function handles PendSVC exception.
  110. * @param None
  111. * @retval None
  112. */
  113. void PendSV_Handler(void)
  114. {
  115. }
  116. /**
  117. * @brief This function handles SysTick Handler.
  118. * @param None
  119. * @retval None
  120. */
  121. //void SysTick_Handler(void)
  122. //{
  123. //}
  124. void RTC_IRQHandler(void)
  125. {
  126. // if (RTC_GetITStatus(RTC_IT_SEC) != RESET)//秒钟中断
  127. // {
  128. // //RTC_Get();//更新时间
  129. // RTC_GetDateTime(&DeviceRTC);
  130. // }
  131. // if(RTC_GetITStatus(RTC_IT_ALR)!= RESET)//闹钟中断
  132. // {
  133. // RTC_ClearITPendingBit(RTC_IT_ALR); //清闹钟中断
  134. // }
  135. // RTC_ClearITPendingBit(RTC_IT_SEC|RTC_IT_OW); //清闹钟中断
  136. // RTC_WaitForLastTask();
  137. /*
  138. //RTC_DateTimeTypeDef RTC_DateTimeStructure;
  139. if(RTC_GetITStatus(RTC_IT_ALR) != RESET)
  140. {
  141. RTC_ClearITPendingBit(RTC_IT_ALR); //清除中断标志位
  142. //RTC_WaitForLastTask(); //等待操作完成
  143. // //读取日历并打印
  144. // RTC_GetDateTime(&RTC_DateTimeStructure);
  145. // USART1_Printf((uint8_t*)"20"); //年
  146. // USART1_SendByte(RTC_DateTimeStructure.Year/10 + 0x30);
  147. // USART1_SendByte(RTC_DateTimeStructure.Year%10 + 0x30);
  148. // USART1_SendByte((uint8_t)'-'); //月
  149. // USART1_SendByte(RTC_DateTimeStructure.Month/10 + 0x30);
  150. // USART1_SendByte(RTC_DateTimeStructure.Month%10 + 0x30);
  151. // USART1_SendByte((uint8_t)'-'); //日
  152. // USART1_SendByte(RTC_DateTimeStructure.Date/10 + 0x30);
  153. // USART1_SendByte(RTC_DateTimeStructure.Date%10 + 0x30);
  154. // USART1_SendByte((uint8_t)' '); //星期
  155. // USART1_SendByte(RTC_DateTimeStructure.Week%10 + 0x30);
  156. // USART1_SendByte((uint8_t)' '); //时
  157. // USART1_SendByte(RTC_DateTimeStructure.Hour/10 + 0x30);
  158. // USART1_SendByte(RTC_DateTimeStructure.Hour%10 + 0x30);
  159. // USART1_SendByte((uint8_t)':'); //分
  160. // USART1_SendByte(RTC_DateTimeStructure.Minute/10 + 0x30);
  161. // USART1_SendByte(RTC_DateTimeStructure.Minute%10 + 0x30);
  162. // USART1_SendByte((uint8_t)':'); //秒
  163. // USART1_SendByte(RTC_DateTimeStructure.Second/10 + 0x30);
  164. // USART1_SendByte(RTC_DateTimeStructure.Second%10 + 0x30);
  165. }
  166. RTC_ClearITPendingBit(RTC_IT_SEC|RTC_IT_OW); //清闹钟中断
  167. RTC_WaitForLastTask();
  168. */
  169. }
  170. /******************************************************************************/
  171. /* STM32F10x Peripherals Interrupt Handlers */
  172. /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
  173. /* available peripheral interrupt handler's name please refer to the startup */
  174. /* file (startup_stm32f10x_xx.s). */
  175. /******************************************************************************/
  176. /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/