元驭机器人元驭机器人Hall 传感器教学下载原文件
1/*!2    \file    gd32e23x_it.c3    \brief   interrupt service routines45    \version 2026-02-04, V2.5.0, firmware for GD32E23x6*/78/*9    Copyright (c) 2026, GigaDevice Semiconductor Inc.1011    Redistribution and use in source and binary forms, with or without modification,12are permitted provided that the following conditions are met:1314    1. Redistributions of source code must retain the above copyright notice, this15       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 documentation18       and/or other materials provided with the distribution.19    3. Neither the name of the copyright holder nor the names of its contributors20       may be used to endorse or promote products derived from this software without21       specific prior written permission.2223    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"24AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED25WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.26IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,27INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT28NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR29PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,30WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)31ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY32OF SUCH DAMAGE.33*/3435#include "gd32e23x_it.h"36#include "systick.h"37#include "rs485_proto.h"3839#define SRAM_PARITY_CHECK_ERROR_HANDLE(s)    do{}while(1)4041/*!42    \brief      this function handles NMI exception43    \param[in]  none44    \param[out] none45    \retval     none46*/47void NMI_Handler(void)48{49    if(SET == syscfg_flag_get(SYSCFG_SRAM_PCEF)) {50        SRAM_PARITY_CHECK_ERROR_HANDLE("SRAM parity check error error\r\n");51    } else {52        /* if NMI exception occurs, go to infinite loop */53        /* HXTAL clock monitor NMI error or NMI pin error */54        while(1) {55        }56    }57}5859/*!60    \brief      this function handles HardFault exception61    \param[in]  none62    \param[out] none63    \retval     none64*/65void HardFault_Handler(void)66{67    /* if Hard Fault exception occurs, go to infinite loop */68    while(1) {69    }70}7172/*!73    \brief      this function handles SVC exception74    \param[in]  none75    \param[out] none76    \retval     none77*/78void SVC_Handler(void)79{80    /* if SVC exception occurs, go to infinite loop */81    while(1) {82    }83}8485/*!86    \brief      this function handles PendSV exception87    \param[in]  none88    \param[out] none89    \retval     none90*/91void PendSV_Handler(void)92{93    /* if PendSV exception occurs, go to infinite loop */94    while(1) {95    }96}9798/*!99    \brief      this function handles SysTick exception100    \param[in]  none101    \param[out] none102    \retval     none103*/104void SysTick_Handler(void)105{106    delay_decrement();107}108109/*!110    \brief      USART0 接收中断111    \param[in]  none112    \param[out] none113    \retval     none114*/115void USART0_IRQHandler(void)116{117    rs485_usart_isr();118}