gd32f10x_it.c 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. /*!
  2. \file gd32f10x_it.c
  3. \brief interrupt service routines
  4. \version 2015-11-16, V1.0.0, demo for GD32F10x
  5. \version 2017-06-30, V2.0.0, demo for GD32F10x
  6. \version 2021-04-30, V2.1.0, demo for GD32F10x
  7. */
  8. /*
  9. Copyright (c) 2021, GigaDevice Semiconductor Inc.
  10. Redistribution and use in source and binary forms, with or without modification,
  11. are permitted provided that the following conditions are met:
  12. 1. Redistributions of source code must retain the above copyright notice, this
  13. list of conditions and the following disclaimer.
  14. 2. Redistributions in binary form must reproduce the above copyright notice,
  15. this list of conditions and the following disclaimer in the documentation
  16. and/or other materials provided with the distribution.
  17. 3. Neither the name of the copyright holder nor the names of its contributors
  18. may be used to endorse or promote products derived from this software without
  19. specific prior written permission.
  20. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  21. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  22. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  23. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  24. INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  25. NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  26. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  27. WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  28. ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  29. OF SUCH DAMAGE.
  30. */
  31. #include "gd32f10x_it.h"
  32. #include "gd32f10x.h"
  33. //#include "systick.h"
  34. //#include "Uart.h"
  35. void EXTI5_9_IRQHandler(void)
  36. {
  37. if(RESET != exti_interrupt_flag_get(EXTI_8)){ //
  38. exti_interrupt_flag_clear(EXTI_8);
  39. }
  40. }
  41. void EXTI2_IRQHandler(void)
  42. {
  43. if(RESET != exti_interrupt_flag_get(EXTI_2)){ //
  44. exti_interrupt_flag_clear(EXTI_2);
  45. }
  46. }
  47. void EXTI3_IRQHandler(void)
  48. {
  49. if(RESET != exti_interrupt_flag_get(EXTI_3)){ //
  50. exti_interrupt_flag_clear(EXTI_3);
  51. }
  52. }
  53. void EXTI4_IRQHandler(void)
  54. {
  55. if(RESET != exti_interrupt_flag_get(EXTI_4)){ //
  56. exti_interrupt_flag_clear(EXTI_4);
  57. }
  58. }
  59. void EXTI10_15_IRQHandler(void)
  60. {
  61. if(RESET != exti_interrupt_flag_get(EXTI_10)){ //
  62. exti_interrupt_flag_clear(EXTI_10);
  63. }
  64. if(RESET != exti_interrupt_flag_get(EXTI_11)){ //
  65. exti_interrupt_flag_clear(EXTI_11);
  66. }
  67. if(RESET != exti_interrupt_flag_get(EXTI_12)){ //
  68. exti_interrupt_flag_clear(EXTI_12);
  69. }
  70. if(RESET != exti_interrupt_flag_get(EXTI_13)){ //
  71. exti_interrupt_flag_clear(EXTI_13);
  72. }
  73. if(RESET != exti_interrupt_flag_get(EXTI_14)){ //
  74. exti_interrupt_flag_clear(EXTI_14);
  75. }
  76. if(RESET != exti_interrupt_flag_get(EXTI_15)){ //
  77. exti_interrupt_flag_clear(EXTI_15);
  78. }
  79. }
  80. /*!
  81. \brief this function handles NMI exception
  82. \param[in] none
  83. \param[out] none
  84. \retval none
  85. */
  86. void NMI_Handler(void)
  87. {
  88. }
  89. /*!
  90. \brief this function handles HardFault exception
  91. \param[in] none
  92. \param[out] none
  93. \retval none
  94. */
  95. void HardFault_Handler(void)
  96. {
  97. /* if Hard Fault exception occurs, go to infinite loop */
  98. while(1){
  99. }
  100. }
  101. /*!
  102. \brief this function handles MemManage exception
  103. \param[in] none
  104. \param[out] none
  105. \retval none
  106. */
  107. void MemManage_Handler(void)
  108. {
  109. /* if Memory Manage exception occurs, go to infinite loop */
  110. while(1){
  111. }
  112. }
  113. /*!
  114. \brief this function handles BusFault exception
  115. \param[in] none
  116. \param[out] none
  117. \retval none
  118. */
  119. void BusFault_Handler(void)
  120. {
  121. /* if Bus Fault exception occurs, go to infinite loop */
  122. while(1){
  123. }
  124. }
  125. /*!
  126. \brief this function handles UsageFault exception
  127. \param[in] none
  128. \param[out] none
  129. \retval none
  130. */
  131. void UsageFault_Handler(void)
  132. {
  133. /* if Usage Fault exception occurs, go to infinite loop */
  134. while(1){
  135. }
  136. }
  137. /*!
  138. \brief this function handles SVC exception
  139. \param[in] none
  140. \param[out] none
  141. \retval none
  142. */
  143. void SVC_Handler(void)
  144. {
  145. }
  146. /*!
  147. \brief this function handles DebugMon exception
  148. \param[in] none
  149. \param[out] none
  150. \retval none
  151. */
  152. void DebugMon_Handler(void)
  153. {
  154. }
  155. /*!
  156. \brief this function handles PendSV exception
  157. \param[in] none
  158. \param[out] none
  159. \retval none
  160. */
  161. //void PendSV_Handler(void)
  162. //{
  163. //}
  164. /*!
  165. \brief this function handles SysTick exception
  166. \param[in] none
  167. \param[out] none
  168. \retval none
  169. */
  170. //volatile uint32_t g_tick = 0;
  171. //void SysTick_Handler(void)
  172. //{
  173. //// g_tick++;
  174. //// delay_decrement();
  175. ////
  176. //// USART_ReceiveOvertimeProcess();//´®¿Ú½ÓÊÕ³¬Ê±´¦Àíº¯Êý
  177. //}
  178. //uint32_t Get_SysTick(void)
  179. //{
  180. // return g_tick;
  181. //}