-
Notifications
You must be signed in to change notification settings - Fork 0
Develop/nn #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Develop/nn #8
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| # Claude Code configuration | ||
| .claude/ | ||
| .specify/ | ||
| .spec-workflow | ||
|
|
||
| # Common IDE files | ||
| .vscode/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # GD32头文件 | ||
| set(GD_Include_Dir | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/Core/Inc | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/Driver/Inc | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/Driver/CMSIS/Device/GD/GD32F4xx/Include | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/Driver/CMSIS/Include | ||
| ) | ||
|
|
||
| # 收集源文件 | ||
| file(GLOB GD_Start_S ${CMAKE_CURRENT_SOURCE_DIR}/*.s) | ||
| aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/Core/Src GD_Core_Src) | ||
| aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/Driver/Src GD_Std_Src) | ||
| aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/Driver/CMSIS/Device/GD/GD32F4xx/Source GD_CMSIS_Src) | ||
|
|
||
| target_sources(l1_mcu PRIVATE | ||
| ${GD_Start_S} | ||
| ${GD_Core_Src} | ||
| ${GD_Std_Src} | ||
| ${GD_CMSIS_Src} | ||
| ) | ||
|
|
||
| target_include_directories(l1_mcu PUBLIC | ||
| ${GD_Include_Dir} | ||
| ) | ||
|
|
||
| target_compile_definitions(l1_mcu PUBLIC | ||
| GD32F470 | ||
| GD32F470ZGT6 | ||
| $<$<CONFIG:Debug>:DEBUG> | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #ifndef GD32F4XX_IT_H | ||
| #define GD32F4XX_IT_H | ||
|
|
||
| #include "gd32f4xx.h" | ||
|
|
||
| /* function declarations */ | ||
| /* this function handles NMI exception */ | ||
| void NMI_Handler(void); | ||
| /* this function handles HardFault exception */ | ||
| void HardFault_Handler(void); | ||
| /* this function handles MemManage exception */ | ||
| void MemManage_Handler(void); | ||
| /* this function handles BusFault exception */ | ||
| void BusFault_Handler(void); | ||
| /* this function handles UsageFault exception */ | ||
| void UsageFault_Handler(void); | ||
| /* this function handles SVC exception */ | ||
| void SVC_Handler(void); | ||
| /* this function handles DebugMon exception */ | ||
| void DebugMon_Handler(void); | ||
| /* this function handles PendSV exception */ | ||
| void PendSV_Handler(void); | ||
| /* this function handles SysTick exception */ | ||
| void SysTick_Handler(void); | ||
|
|
||
| #endif /* GD32F4XX_IT_H */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| /*! | ||
| \file gd32f4xx_libopt.h | ||
| \brief library optional for gd32f4xx | ||
|
|
||
| \version 2016-08-15, V1.0.0, firmware for GD32F4xx | ||
| \version 2018-12-12, V2.0.0, firmware for GD32F4xx | ||
| \version 2020-09-30, V2.1.0, firmware for GD32F4xx | ||
| \version 2022-03-09, V3.0.0, firmware for GD32F4xx | ||
| */ | ||
|
|
||
| /* | ||
| Copyright (c) 2022, GigaDevice Semiconductor Inc. | ||
|
|
||
| Redistribution and use in source and binary forms, with or without modification, | ||
| are permitted provided that the following conditions are met: | ||
|
|
||
| 1. Redistributions of source code must retain the above copyright notice, this | ||
| list of conditions and the following disclaimer. | ||
| 2. Redistributions in binary form must reproduce the above copyright notice, | ||
| this list of conditions and the following disclaimer in the documentation | ||
| and/or other materials provided with the distribution. | ||
| 3. Neither the name of the copyright holder nor the names of its contributors | ||
| may be used to endorse or promote products derived from this software without | ||
| specific prior written permission. | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
| IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | ||
| INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
| PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
| WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY | ||
| OF SUCH DAMAGE. | ||
| */ | ||
|
|
||
| #ifndef __GD32F4XX_LIBOPT_H | ||
| #define __GD32F4XX_LIBOPT_H | ||
|
|
||
| #if defined(GD32F450) || defined(GD32F405) || defined(GD32F407) || defined(GD32F470) || defined(GD32F425) || \ | ||
| defined(GD32F427) | ||
| #include "gd32f4xx_rcu.h" | ||
| #include "gd32f4xx_adc.h" | ||
| #include "gd32f4xx_can.h" | ||
| #include "gd32f4xx_crc.h" | ||
| #include "gd32f4xx_ctc.h" | ||
| #include "gd32f4xx_dac.h" | ||
| #include "gd32f4xx_dbg.h" | ||
| #include "gd32f4xx_dci.h" | ||
| #include "gd32f4xx_dma.h" | ||
| #include "gd32f4xx_exti.h" | ||
| #include "gd32f4xx_fmc.h" | ||
| #include "gd32f4xx_fwdgt.h" | ||
| #include "gd32f4xx_gpio.h" | ||
| #include "gd32f4xx_syscfg.h" | ||
| #include "gd32f4xx_i2c.h" | ||
| #include "gd32f4xx_iref.h" | ||
| #include "gd32f4xx_pmu.h" | ||
| #include "gd32f4xx_rtc.h" | ||
| #include "gd32f4xx_sdio.h" | ||
| #include "gd32f4xx_spi.h" | ||
| #include "gd32f4xx_timer.h" | ||
| #include "gd32f4xx_trng.h" | ||
| #include "gd32f4xx_usart.h" | ||
| #include "gd32f4xx_wwdgt.h" | ||
| #include "gd32f4xx_misc.h" | ||
| #endif | ||
|
|
||
| #if defined(GD32F450) || defined(GD32F470) | ||
| #include "gd32f4xx_enet.h" | ||
| #include "gd32f4xx_exmc.h" | ||
| #include "gd32f4xx_ipa.h" | ||
| #include "gd32f4xx_tli.h" | ||
| #endif | ||
|
|
||
| #if defined(GD32F407) || defined(GD32F427) | ||
| #include "gd32f4xx_enet.h" | ||
| #include "gd32f4xx_exmc.h" | ||
| #endif /* __GD32F4XX_LIBOPT_H */ | ||
|
|
||
| #endif /* __GD32F4XX_LIBOPT_H */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #ifndef __MAIN_H | ||
| #define __MAIN_H | ||
|
|
||
| #include "gd32f4xx.h" | ||
| #include "systick.h" | ||
| #include "gd32f4xx_libopt.h" | ||
|
|
||
| /* _assert */ | ||
| #define _assert(X) while ((X) == 0) | ||
| #define MAX_DELAY UINT32_MAX | ||
|
|
||
| void Error_Handler(void); | ||
|
|
||
| #endif /* __MAIN_H */ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /*! | ||
| \file systick.h | ||
| \brief the header file of systick | ||
|
|
||
| \version 2016-08-15, V1.0.0, firmware for GD32F4xx | ||
| \version 2018-12-12, V2.0.0, firmware for GD32F4xx | ||
| \version 2020-09-30, V2.1.0, firmware for GD32F4xx | ||
| \version 2022-03-09, V3.0.0, firmware for GD32F4xx | ||
| */ | ||
|
|
||
| /* | ||
| Copyright (c) 2022, GigaDevice Semiconductor Inc. | ||
|
|
||
| Redistribution and use in source and binary forms, with or without modification, | ||
| are permitted provided that the following conditions are met: | ||
|
|
||
| 1. Redistributions of source code must retain the above copyright notice, this | ||
| list of conditions and the following disclaimer. | ||
| 2. Redistributions in binary form must reproduce the above copyright notice, | ||
| this list of conditions and the following disclaimer in the documentation | ||
| and/or other materials provided with the distribution. | ||
| 3. Neither the name of the copyright holder nor the names of its contributors | ||
| may be used to endorse or promote products derived from this software without | ||
| specific prior written permission. | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
| IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | ||
| INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
| PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
| WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY | ||
| OF SUCH DAMAGE. | ||
| */ | ||
|
|
||
| #ifndef __SYSTICK_H | ||
| #define __SYSTICK_H | ||
|
|
||
| #include <stdint.h> | ||
| #include "gd32f4xx.h" | ||
|
|
||
| extern volatile uint32_t uwTick; | ||
|
|
||
| void SysTick_Init(void); | ||
| void Delay(uint32_t xms); | ||
| uint32_t GetTick(void); | ||
| void Tick_Inc(void); | ||
|
|
||
| #endif /* __SYSTICK_H */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,79 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include "gd32f4xx_it.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include "main.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include "systick.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) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | |
| } | |
| /*! | |
| \brief this function handles SVC exception | |
| \param[in] none | |
| \param[out] none | |
| \retval none | |
| */ | |
| void SVC_Handler(void) | |
| { | |
| } | |
| /*! | |
| \brief this function handles PendSV exception | |
| \param[in] none | |
| \param[out] none | |
| \retval none | |
| */ | |
| void PendSV_Handler(void) | |
| { | |
| } | |
| /*! | |
| \brief this function handles SysTick interrupt | |
| \param[in] none | |
| \param[out] none | |
| \retval none | |
| */ | |
| void SysTick_Handler(void) | |
| { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #include "main.h" | ||
|
|
||
| extern void ek_main(void); | ||
|
|
||
| int main(void) | ||
| { | ||
| // NVIC Group | ||
| nvic_priority_group_set(NVIC_PRIGROUP_PRE4_SUB0); | ||
| SysTick_Init(); | ||
|
|
||
| ek_main(); | ||
|
|
||
| while (1) | ||
| { | ||
| } | ||
| } | ||
|
|
||
| void Error_Handler(void) | ||
| { | ||
| while (1) | ||
| { | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_assert宏展开为裸while语句,容易在if/else等场景触发“悬空 else/语句结合”问题,也不利于调试定位。建议改为do { ... } while (0)形式,并在断言失败时提供可选的 trap(如调用Error_Handler()或触发断点)以便定位。