gd32f3x0_it.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /*!
  2. \file gd32f3x0_it.c
  3. \brief interrupt service routines
  4. */
  5. /*
  6. Copyright (C) 2017 GigaDevice
  7. 2017-06-06, V1.0.0, firmware for GD32F3x0
  8. */
  9. #include "gd32f3x0_it.h"
  10. extern __IO uint8_t g_dmacomplete_flag;
  11. /*!
  12. \brief this function handles NMI exception
  13. \param[in] none
  14. \param[out] none
  15. \retval none
  16. */
  17. void NMI_Handler(void)
  18. {
  19. }
  20. /*!
  21. \brief this function handles HardFault exception
  22. \param[in] none
  23. \param[out] none
  24. \retval none
  25. */
  26. void HardFault_Handler(void)
  27. {
  28. /* if Hard Fault exception occurs, go to infinite loop */
  29. while (1);
  30. }
  31. /*!
  32. \brief this function handles MemManage exception
  33. \param[in] none
  34. \param[out] none
  35. \retval none
  36. */
  37. void MemManage_Handler(void)
  38. {
  39. /* if Memory Manage exception occurs, go to infinite loop */
  40. while (1);
  41. }
  42. /*!
  43. \brief this function handles BusFault exception
  44. \param[in] none
  45. \param[out] none
  46. \retval none
  47. */
  48. void BusFault_Handler(void)
  49. {
  50. /* if Bus Fault exception occurs, go to infinite loop */
  51. while (1);
  52. }
  53. /*!
  54. \brief this function handles UsageFault exception
  55. \param[in] none
  56. \param[out] none
  57. \retval none
  58. */
  59. void UsageFault_Handler(void)
  60. {
  61. /* if Usage Fault exception occurs, go to infinite loop */
  62. while (1);
  63. }
  64. /*!
  65. \brief this function handles SVC exception
  66. \param[in] none
  67. \param[out] none
  68. \retval none
  69. */
  70. void SVC_Handler(void)
  71. {
  72. }
  73. /*!
  74. \brief this function handles DebugMon exception
  75. \param[in] none
  76. \param[out] none
  77. \retval none
  78. */
  79. void DebugMon_Handler(void)
  80. {
  81. }
  82. /*!
  83. \brief this function handles PendSV exception
  84. \param[in] none
  85. \param[out] none
  86. \retval none
  87. */
  88. void PendSV_Handler(void)
  89. {
  90. }
  91. /*!
  92. \brief this function handles SysTick exception
  93. \param[in] none
  94. \param[out] none
  95. \retval none
  96. */
  97. void SysTick_Handler(void)
  98. {
  99. }
  100. /*!
  101. \brief this function handles DMA_Channel1_2_IRQHandler interrupt
  102. \param[in] none
  103. \param[out] none
  104. \retval none
  105. */
  106. void DMA_Channel1_2_IRQHandler(void)
  107. {
  108. if(dma_interrupt_flag_get(DMA_CH1, DMA_INT_FLAG_FTF)){
  109. dma_interrupt_flag_clear(DMA_CH1, DMA_INT_FLAG_G);
  110. g_dmacomplete_flag |= (1 << 0);
  111. }
  112. if(dma_interrupt_flag_get(DMA_CH2, DMA_INT_FLAG_FTF)){
  113. dma_interrupt_flag_clear(DMA_CH2, DMA_INT_FLAG_G);
  114. g_dmacomplete_flag |= (1 << 1);
  115. }
  116. }
  117. /*!
  118. \brief this function handles DMA_Channel1_2_IRQHandler interrupt
  119. \param[in] none
  120. \param[out] none
  121. \retval none
  122. */
  123. void DMA_Channel3_4_IRQHandler(void)
  124. {
  125. if(dma_interrupt_flag_get(DMA_CH3, DMA_INT_FLAG_FTF)){
  126. dma_interrupt_flag_clear(DMA_CH3, DMA_INT_FLAG_G);
  127. g_dmacomplete_flag |= (1 << 2);
  128. }
  129. if(dma_interrupt_flag_get(DMA_CH4, DMA_INT_FLAG_FTF)){
  130. dma_interrupt_flag_clear(DMA_CH4, DMA_INT_FLAG_G);
  131. g_dmacomplete_flag |= (1 << 3);
  132. }
  133. }