|
@@ -0,0 +1,131 @@
|
|
|
|
|
+#include "gd32f1x0.h"
|
|
|
|
|
+/*!
|
|
|
|
|
+ \brief this function handles NMI exception
|
|
|
|
|
+ \param[in] none
|
|
|
|
|
+ \param[out] none
|
|
|
|
|
+ \retval none
|
|
|
|
|
+*/
|
|
|
|
|
+void NMI_Handler(void)
|
|
|
|
|
+{
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/*!
|
|
|
|
|
+ \brief this function handles HardFault exception
|
|
|
|
|
+ \param[in] none
|
|
|
|
|
+ \param[out] none
|
|
|
|
|
+ \retval none
|
|
|
|
|
+*/
|
|
|
|
|
+void HardFault_Handler(void){
|
|
|
|
|
+ /* if Hard Fault exception occurs, go to infinite loop */
|
|
|
|
|
+ while (1){
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/*!
|
|
|
|
|
+ \brief this function handles MemManage exception
|
|
|
|
|
+ \param[in] none
|
|
|
|
|
+ \param[out] none
|
|
|
|
|
+ \retval none
|
|
|
|
|
+*/
|
|
|
|
|
+void MemManage_Handler(void)
|
|
|
|
|
+{
|
|
|
|
|
+ /* if Memory Manage exception occurs, go to infinite loop */
|
|
|
|
|
+ while (1){
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/*!
|
|
|
|
|
+ \brief this function handles BusFault exception
|
|
|
|
|
+ \param[in] none
|
|
|
|
|
+ \param[out] none
|
|
|
|
|
+ \retval none
|
|
|
|
|
+*/
|
|
|
|
|
+void BusFault_Handler(void)
|
|
|
|
|
+{
|
|
|
|
|
+ /* if Bus Fault exception occurs, go to infinite loop */
|
|
|
|
|
+ while (1){
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/*!
|
|
|
|
|
+ \brief this function handles UsageFault exception
|
|
|
|
|
+ \param[in] none
|
|
|
|
|
+ \param[out] none
|
|
|
|
|
+ \retval none
|
|
|
|
|
+*/
|
|
|
|
|
+void UsageFault_Handler(void)
|
|
|
|
|
+{
|
|
|
|
|
+ /* if Usage Fault exception occurs, go to infinite loop */
|
|
|
|
|
+ while (1){
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/*!
|
|
|
|
|
+ \brief this function handles DebugMon exception
|
|
|
|
|
+ \param[in] none
|
|
|
|
|
+ \param[out] none
|
|
|
|
|
+ \retval none
|
|
|
|
|
+*/
|
|
|
|
|
+void DebugMon_Handler(void)
|
|
|
|
|
+{
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void EXTI0_1_IRQHandler(void){
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_0)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_0);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_1)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_1);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void EXTI2_3_IRQHandler(void){
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_2)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_2);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_3)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_3);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void EXTI4_15_IRQHandler(void){
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_4)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_4);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_5)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_5);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_6)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_6);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_7)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_7);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_8)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_8);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_9)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_9);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_10)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_10);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_11)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_11);
|
|
|
|
|
+ }
|
|
|
|
|
+ //ms5238 irq
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_12)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_12);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_13)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_13);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_14)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_14);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(RESET != exti_interrupt_flag_get(EXTI_15)){
|
|
|
|
|
+ exti_interrupt_flag_clear(EXTI_15);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|