stm32f2xx_it.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /**
  2. ******************************************************************************
  3. * @file Project/STM32F2xx_StdPeriph_Template/stm32f2xx_it.c
  4. * @author MCD Application Team
  5. * @version V1.2.0
  6. * @date 13-April-2012
  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. * Copyright (c) 2012 STMicroelectronics.
  14. * All rights reserved.
  15. *
  16. * This software is licensed under terms that can be found in the LICENSE file
  17. * in the root directory of this software component.
  18. * If no LICENSE file comes with this software, it is provided AS-IS.
  19. *
  20. ******************************************************************************
  21. */
  22. /* Includes ------------------------------------------------------------------*/
  23. #include "stm32f2xx_it.h"
  24. #include "main.h"
  25. #include "node_data_acquisition.h"
  26. #include "mmodbus.h"
  27. #include "dlt645.h"
  28. /** @addtogroup Template_Project
  29. * @{
  30. */
  31. /* Private typedef -----------------------------------------------------------*/
  32. /* Private define ------------------------------------------------------------*/
  33. /* Private macro -------------------------------------------------------------*/
  34. /* Private variables ---------------------------------------------------------*/
  35. /* Private function prototypes -----------------------------------------------*/
  36. /* Private functions ---------------------------------------------------------*/
  37. /******************************************************************************/
  38. /* Cortex-M3 Processor Exceptions Handlers */
  39. /******************************************************************************/
  40. /**
  41. * @brief This function handles NMI exception.
  42. * @param None
  43. * @retval None
  44. */
  45. void NMI_Handler(void)
  46. {
  47. }
  48. /**
  49. * @brief This function handles Hard Fault exception.
  50. * @param None
  51. * @retval None
  52. */
  53. void HardFault_Handler(void)
  54. {
  55. /* Go to infinite loop when Hard Fault exception occurs */
  56. while (1)
  57. {
  58. }
  59. }
  60. /**
  61. * @brief This function handles Memory Manage exception.
  62. * @param None
  63. * @retval None
  64. */
  65. void MemManage_Handler(void)
  66. {
  67. /* Go to infinite loop when Memory Manage exception occurs */
  68. while (1)
  69. {
  70. }
  71. }
  72. /**
  73. * @brief This function handles Bus Fault exception.
  74. * @param None
  75. * @retval None
  76. */
  77. void BusFault_Handler(void)
  78. {
  79. /* Go to infinite loop when Bus Fault exception occurs */
  80. while (1)
  81. {
  82. }
  83. }
  84. /**
  85. * @brief This function handles Usage Fault exception.
  86. * @param None
  87. * @retval None
  88. */
  89. void UsageFault_Handler(void)
  90. {
  91. /* Go to infinite loop when Usage Fault exception occurs */
  92. while (1)
  93. {
  94. }
  95. }
  96. /**
  97. * @brief This function handles SVCall exception.
  98. * @param None
  99. * @retval None
  100. */
  101. void SVC_Handler(void)
  102. {
  103. }
  104. /**
  105. * @brief This function handles Debug Monitor exception.
  106. * @param None
  107. * @retval None
  108. */
  109. void DebugMon_Handler(void)
  110. {
  111. }
  112. void USART3_IRQHandler(void)
  113. {
  114. if(protocol_485==1) //dlt645
  115. {
  116. mmodbus_callback();
  117. }
  118. else if(protocol_485==2)
  119. {
  120. dlt_callback();
  121. }
  122. }
  123. /**
  124. * @brief This function handles PendSVC exception.
  125. * @param None
  126. * @retval None
  127. */
  128. //void PendSV_Handler(void)
  129. //{
  130. //}
  131. /**
  132. * @brief This function handles SysTick Handler.
  133. * @param None
  134. * @retval None
  135. */
  136. //void SysTick_Handler(void)
  137. //{
  138. //}
  139. /******************************************************************************/
  140. /* STM32F2xx Peripherals Interrupt Handlers */
  141. /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
  142. /* available peripheral interrupt handler's name please refer to the startup */
  143. /* file (startup_stm32f2xx.s). */
  144. /******************************************************************************/
  145. /**
  146. * @brief This function handles PPP interrupt request.
  147. * @param None
  148. * @retval None
  149. */
  150. /*void PPP_IRQHandler(void)
  151. {
  152. }*/
  153. /**
  154. * @}
  155. */