gd32f3x0_it.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. #include "main.h"
  11. #include "systick.h"
  12. #include "gd32f3x0_eval.h"
  13. extern uint8_t data;
  14. /*!
  15. \brief this function handles NMI exception
  16. \param[in] none
  17. \param[out] none
  18. \retval none
  19. */
  20. void NMI_Handler(void)
  21. {
  22. }
  23. /*!
  24. \brief this function handles HardFault exception
  25. \param[in] none
  26. \param[out] none
  27. \retval none
  28. */
  29. void HardFault_Handler(void)
  30. {
  31. /* if Hard Fault exception occurs, go to infinite loop */
  32. while (1);
  33. }
  34. /*!
  35. \brief this function handles MemManage exception
  36. \param[in] none
  37. \param[out] none
  38. \retval none
  39. */
  40. void MemManage_Handler(void)
  41. {
  42. /* if Memory Manage exception occurs, go to infinite loop */
  43. while (1);
  44. }
  45. /*!
  46. \brief this function handles BusFault exception
  47. \param[in] none
  48. \param[out] none
  49. \retval none
  50. */
  51. void BusFault_Handler(void)
  52. {
  53. /* if Bus Fault exception occurs, go to infinite loop */
  54. while (1);
  55. }
  56. /*!
  57. \brief this function handles UsageFault exception
  58. \param[in] none
  59. \param[out] none
  60. \retval none
  61. */
  62. void UsageFault_Handler(void)
  63. {
  64. /* if Usage Fault exception occurs, go to infinite loop */
  65. while (1);
  66. }
  67. /*!
  68. \brief this function handles SVC exception
  69. \param[in] none
  70. \param[out] none
  71. \retval none
  72. */
  73. void SVC_Handler(void)
  74. {
  75. }
  76. /*!
  77. \brief this function handles DebugMon exception
  78. \param[in] none
  79. \param[out] none
  80. \retval none
  81. */
  82. void DebugMon_Handler(void)
  83. {
  84. }
  85. /*!
  86. \brief this function handles PendSV exception
  87. \param[in] none
  88. \param[out] none
  89. \retval none
  90. */
  91. void PendSV_Handler(void)
  92. {
  93. }
  94. /*!
  95. \brief this function handles SysTick exception
  96. \param[in] none
  97. \param[out] none
  98. \retval none
  99. */
  100. void SysTick_Handler(void)
  101. {
  102. delay_decrement();
  103. }
  104. /*!
  105. \brief this function handles ADC exception
  106. \param[in] none
  107. \param[out] none
  108. \retval none
  109. */
  110. void ADC_CMP_IRQHandler(void)
  111. {
  112. /* clear the ADC interrupt or status flag */
  113. adc_interrupt_flag_clear(ADC_INT_WDE);
  114. /* turn on LED2 */
  115. gd_eval_led_on(LED2);
  116. data = 1;
  117. }