gd32e230_it.c 4.1 KB

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