gd32f30x_it.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /*!
  2. \file gd32f30x_it.c
  3. \brief interrupt service routines
  4. \version 2017-02-10, V1.0.0, firmware for GD32F30x
  5. \version 2018-10-10, V1.1.0, firmware for GD32F30x
  6. \version 2018-12-25, V2.0.0, firmware for GD32F30x
  7. \version 2020-09-30, V2.1.0, firmware for GD32F30x
  8. */
  9. /*
  10. Copyright (c) 2020, GigaDevice Semiconductor Inc.
  11. All rights reserved.
  12. Redistribution and use in source and binary forms, with or without modification,
  13. are permitted provided that the following conditions are met:
  14. 1. Redistributions of source code must retain the above copyright notice, this
  15. list of conditions and the following disclaimer.
  16. 2. Redistributions in binary form must reproduce the above copyright notice,
  17. this list of conditions and the following disclaimer in the documentation
  18. and/or other materials provided with the distribution.
  19. 3. Neither the name of the copyright holder nor the names of its contributors
  20. may be used to endorse or promote products derived from this software without
  21. specific prior written permission.
  22. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  23. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  24. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  25. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  26. INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  27. NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  29. WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  30. ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  31. OF SUCH DAMAGE.
  32. */
  33. #include "gd32f30x_it.h"
  34. #include "gd32f307c_eval.h"
  35. extern __IO uint32_t timedisplay;
  36. uint8_t g_button_press_flag = 0;
  37. /*!
  38. \brief this function handles NMI exception
  39. \param[in] none
  40. \param[out] none
  41. \retval none
  42. */
  43. void NMI_Handler(void)
  44. {
  45. }
  46. /*!
  47. \brief this function handles HardFault exception
  48. \param[in] none
  49. \param[out] none
  50. \retval none
  51. */
  52. void HardFault_Handler(void)
  53. {
  54. /* if Hard Fault exception occurs, go to infinite loop */
  55. while(1) {
  56. }
  57. }
  58. /*!
  59. \brief this function handles MemManage exception
  60. \param[in] none
  61. \param[out] none
  62. \retval none
  63. */
  64. void MemManage_Handler(void)
  65. {
  66. /* if Memory Manage exception occurs, go to infinite loop */
  67. while(1) {
  68. }
  69. }
  70. /*!
  71. \brief this function handles BusFault exception
  72. \param[in] none
  73. \param[out] none
  74. \retval none
  75. */
  76. void BusFault_Handler(void)
  77. {
  78. /* if Bus Fault exception occurs, go to infinite loop */
  79. while(1) {
  80. }
  81. }
  82. /*!
  83. \brief this function handles UsageFault exception
  84. \param[in] none
  85. \param[out] none
  86. \retval none
  87. */
  88. void UsageFault_Handler(void)
  89. {
  90. /* if Usage Fault exception occurs, go to infinite loop */
  91. while(1) {
  92. }
  93. }
  94. /*!
  95. \brief this function handles SVC exception
  96. \param[in] none
  97. \param[out] none
  98. \retval none
  99. */
  100. void SVC_Handler(void)
  101. {
  102. }
  103. /*!
  104. \brief this function handles DebugMon exception
  105. \param[in] none
  106. \param[out] none
  107. \retval none
  108. */
  109. void DebugMon_Handler(void)
  110. {
  111. }
  112. /*!
  113. \brief this function handles PendSV exception
  114. \param[in] none
  115. \param[out] none
  116. \retval none
  117. */
  118. void PendSV_Handler(void)
  119. {
  120. }
  121. /*!
  122. \brief this function handles SysTick exception
  123. \param[in] none
  124. \param[out] none
  125. \retval none
  126. */
  127. void SysTick_Handler(void)
  128. {
  129. }
  130. /*!
  131. \brief this function handles external lines 10 to 15 interrupt request
  132. \param[in] none
  133. \param[out] none
  134. \retval none
  135. */
  136. void EXTI10_15_IRQHandler(void)
  137. {
  138. if(RESET != exti_interrupt_flag_get(TAMPER_KEY_EXTI_LINE)) {
  139. g_button_press_flag = 1;
  140. exti_interrupt_flag_clear(TAMPER_KEY_EXTI_LINE);
  141. }
  142. }