Repository navigation
feat(spi): configure write-protection fallback and document contributions - #19
Merged
Merged
Conversation
MarsDoge
force-pushed
the
fix/spi-write-protection-option
branch
from
October 28, 2026 08:31
c90cec3 to
bd8faa1
Compare
Replace ENABLE_WRITE_PROTECTION guards with the --write-protection command-line option, disabled by default. Reset the option for each SPI command invocation. Validation: - C syntax check passed. - Patch reverse-application check passed.
Simplify the commit template and add a pull request template and contribution guide. Document types, scopes, template setup and accurate build and hardware validation reporting. Validation: - Reviewed template fields and setup instructions. - Documentation-only change; no runtime tests performed.
Use stdbool.h instead of custom bool, true and false definitions in util.c. The affected values are internal MAC parsing results; public interfaces and structure layouts are unchanged. Use the compiler default language standard and preserve supplied CFLAGS. Put the build script shebang first and stop immediately on command failure. Validation: - Reviewed boolean usage across LoongArch C sources and headers. - The identical final source tree passed the complete GCC 15 CI build.
MarsDoge
force-pushed
the
fix/spi-write-protection-option
branch
from
October 28, 2026 08:41
5869d8b to
fca6221
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
问题与改动
SPI 的 WREN/WRSR 写保护兼容流程原先需要通过 ENABLE_WRITE_PROTECTION 宏重新编译才能启用。新增
--write-protection命令行选项,默认关闭,运行时控制原有两处宏条件中的流程;每次 SPI 命令调用时重置配置。该选项控制额外的兼容流程,基础写保护操作仍执行。同时规范仓库后续提交:更新
commit-template.txt,新增.github/pull_request_template.md和CONTRIBUTING.md,说明提交类型、模块范围、模板启用方式和验证记录要求。SPI 功能、文档规范与构建兼容性修复分为三个提交,均使用<type>(<scope>): <简短说明>格式。验证结果
gcc -std=gnu11 -fsyntax-only spi.c argparse.c通过。<stdbool.h>替代 util.c 的自定义 bool/true/false,消除 C23 关键字冲突。