| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- #include "gd32f3x0.h"
- #include "nv_storage.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 */
- nv_save_soc();
- 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 */
- nv_save_soc();
- 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 */
- nv_save_soc();
- 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 */
- nv_save_soc();
- 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 __weak ml5238_irq_handler(void){}
- void __weak charger_detect_irq_handler(void){}
- void __weak hall1_detect_irq_handler(void){}
- void __weak hall2_detect_irq_handler(void){}
- void __weak small_current_short_irq_handler(void){}
- void __weak dcdc_pwr_detect_irq_handler(void) {}
- void EXTI4_15_IRQHandler(void){
- if(RESET != exti_flag_get(EXTI_4)){
- exti_flag_clear(EXTI_4);
- }
- if(RESET != exti_flag_get(EXTI_5)){
- exti_flag_clear(EXTI_5);
- }
- if(RESET != exti_flag_get(EXTI_6)){
- exti_flag_clear(EXTI_6);
- }
- if(RESET != exti_flag_get(EXTI_7)){
- exti_flag_clear(EXTI_7);
- dcdc_pwr_detect_irq_handler();
- }
- if(RESET != exti_flag_get(EXTI_8)){
- exti_flag_clear(EXTI_8);
- }
- if(RESET != exti_flag_get(EXTI_9)){
- exti_flag_clear(EXTI_9);
- }
- if(RESET != exti_flag_get(EXTI_10)){
- exti_flag_clear(EXTI_10);
- charger_detect_irq_handler();
- }
- if(RESET != exti_flag_get(EXTI_11)){
- exti_flag_clear(EXTI_11);
- small_current_short_irq_handler();
- }
- //ms5238 irq
- if(RESET != exti_flag_get(EXTI_12)){
- exti_flag_clear(EXTI_12);
- ml5238_irq_handler();
- }
- if(RESET != exti_flag_get(EXTI_13)){
- exti_flag_clear(EXTI_13);
- hall2_detect_irq_handler();
- }
- if(RESET != exti_flag_get(EXTI_14)){
- exti_flag_clear(EXTI_14);
- }
- if(RESET != exti_flag_get(EXTI_15)){
- exti_flag_clear(EXTI_15);
- hall1_detect_irq_handler();
- }
- }
|