stm32f4xx_it.c 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. /**
  2. ******************************************************************************
  3. * @file Project/STM32F4xx_StdPeriph_Templates/stm32f4xx_it.c
  4. * @author MCD Application Team
  5. * @version V1.5.0
  6. * @date 06-March-2015
  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. * <h2><center>&copy; COPYRIGHT 2015 STMicroelectronics</center></h2>
  14. *
  15. * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  16. * You may not use this file except in compliance with the License.
  17. * You may obtain a copy of the License at:
  18. *
  19. * http://www.st.com/software_license_agreement_liberty_v2
  20. *
  21. * Unless required by applicable law or agreed to in writing, software
  22. * distributed under the License is distributed on an "AS IS" BASIS,
  23. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  24. * See the License for the specific language governing permissions and
  25. * limitations under the License.
  26. *
  27. ******************************************************************************
  28. */
  29. /* Includes ------------------------------------------------------------------*/
  30. #include "stm32f4xx_it.h"
  31. #include "includes.h"
  32. #include "lwip_eth.h"
  33. #include "stm32f4x7_eth.h"
  34. #include "stm32f4xx.h"
  35. extern OS_EVENT *g_enet_rx_sem;
  36. /** @addtogroup Template_Project
  37. * @{
  38. */
  39. /* Private typedef -----------------------------------------------------------*/
  40. /* Private define ------------------------------------------------------------*/
  41. /* Private macro -------------------------------------------------------------*/
  42. /* Private variables ---------------------------------------------------------*/
  43. /* Private function prototypes -----------------------------------------------*/
  44. /* Private functions ---------------------------------------------------------*/
  45. /******************************************************************************/
  46. /* Cortex-M4 Processor Exceptions Handlers */
  47. /******************************************************************************/
  48. /**
  49. * @brief This function handles NMI exception.
  50. * @param None
  51. * @retval None
  52. */
  53. void NMI_Handler(void)
  54. {
  55. }
  56. /**
  57. * @brief This function handles Hard Fault exception.
  58. * @param None
  59. * @retval None
  60. */
  61. void HardFault_Handler(void)
  62. {
  63. /* Go to infinite loop when Hard Fault exception occurs */
  64. while (1)
  65. {
  66. }
  67. }
  68. /**
  69. * @brief This function handles Memory Manage exception.
  70. * @param None
  71. * @retval None
  72. */
  73. void MemManage_Handler(void)
  74. {
  75. /* Go to infinite loop when Memory Manage exception occurs */
  76. while (1)
  77. {
  78. }
  79. }
  80. /**
  81. * @brief This function handles Bus Fault exception.
  82. * @param None
  83. * @retval None
  84. */
  85. void BusFault_Handler(void)
  86. {
  87. /* Go to infinite loop when Bus Fault exception occurs */
  88. while (1)
  89. {
  90. }
  91. }
  92. /**
  93. * @brief This function handles Usage Fault exception.
  94. * @param None
  95. * @retval None
  96. */
  97. void UsageFault_Handler(void)
  98. {
  99. /* Go to infinite loop when Usage Fault exception occurs */
  100. while (1)
  101. {
  102. }
  103. }
  104. /**
  105. * @brief This function handles SVCall exception.
  106. * @param None
  107. * @retval None
  108. */
  109. void SVC_Handler(void)
  110. {
  111. }
  112. /**
  113. * @brief This function handles Debug Monitor exception.
  114. * @param None
  115. * @retval None
  116. */
  117. void DebugMon_Handler(void)
  118. {
  119. }
  120. /**
  121. * @brief This function handles PendSVC exception.
  122. * @param None
  123. * @retval None
  124. */
  125. // void PendSV_Handler(void)
  126. // {
  127. // }
  128. /**
  129. * @brief This function handles SysTick Handler.
  130. * @param None
  131. * @retval None
  132. */
  133. // void SysTick_Handler(void)
  134. // {
  135. // // TimingDelay_Decrement();
  136. // }
  137. /******************************************************************************/
  138. /* STM32F4xx Peripherals Interrupt Handlers */
  139. /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
  140. /* available peripheral interrupt handler's name please refer to the startup */
  141. /* file (startup_stm32f4xx.s). */
  142. /******************************************************************************/
  143. /**
  144. * @brief This function handles PPP interrupt request.
  145. * @param None
  146. * @retval None
  147. */
  148. /*void PPP_IRQHandler(void)
  149. {
  150. }*/
  151. /**
  152. * @}
  153. */
  154. #ifdef USE_ETH_INTERRUPT
  155. /*!
  156. \brief this function handles ethernet interrupt request
  157. \param[in] none
  158. \param[out] none
  159. \retval none
  160. */
  161. void ETH_IRQHandler(void)
  162. {
  163. OSIntEnter();
  164. /* frame received */
  165. if (SET == ETH_GetDMAITStatus(ETH_DMA_FLAG_R))
  166. {
  167. /* clear the enet DMA Rx interrupt pending bits */
  168. ETH_DMAClearITPendingBit(ETH_DMA_FLAG_R);
  169. ETH_DMAClearITPendingBit(ETH_DMA_FLAG_NIS);
  170. /* give the semaphore to wakeup LwIP task */
  171. OSSemPost(g_enet_rx_sem);
  172. }
  173. OSIntExit();
  174. }
  175. #endif /* USE_ETH_INTERRUPT */
  176. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/