Skip to content

[WIP] Refactor STM32 OLED project to meet open source standards#3

Draft
RtimesC with Copilot wants to merge 2 commits into
mainfrom
copilot/refactor-project-for-open-source
Draft

[WIP] Refactor STM32 OLED project to meet open source standards#3
RtimesC with Copilot wants to merge 2 commits into
mainfrom
copilot/refactor-project-for-open-source

Conversation

Copilot AI commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Project Standardization Refactoring Progress

  • 1. Git configuration
    • Rename gitignore.txt to .gitignore
    • Delete build artifacts and user-specific files
  • 2. Create LICENSE file (MIT License)
  • 3. Create comprehensive README.md with badges, TOC, and detailed sections
  • 4. Create CONTRIBUTING.md with contribution workflow
  • 5. Create CHANGELOG.md with version 1.0.0
  • 6. Create docs/ directory structure
    • Create docs/API.md with detailed API documentation
    • Create docs/HARDWARE.md with hardware connection guide
    • Create docs/DEVELOPMENT.md with development guide
  • 7. Create GitHub configuration
    • Create .github/ISSUE_TEMPLATE/bug_report.md
    • Create .github/ISSUE_TEMPLATE/feature_request.md
    • Create .github/PULL_REQUEST_TEMPLATE.md
  • 8. Create .editorconfig for code style consistency
  • 9. Final validation and testing
Original prompt

项目标准化重构

目标

将当前的 STM32 OLED 项目重构为符合开源标准的项目模板,提升项目的专业性和可维护性。

需要完成的改动

1. Git 配置文件

  • gitignore.txt 重命名为 .gitignore
  • 删除以下不应提交到仓库的文件:
    • Project.uvguix.Admin
    • Project.uvguix.王燕涛
    • Project.uvoptx
    • keilkill.bat
    • _codeql_detected_source_root
    • Objects/ 目录下所有文件
    • Listings/ 目录下所有文件
    • DebugConfig/ 目录下所有文件

2. 项目文档完善

2.1 创建 LICENSE 文件

使用 MIT 许可证,内容如下:

MIT License

Copyright (c) 2026 RtimesC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

2.2 完善 README.md

需要包含以下内容:

  • 项目徽章(build status, license, language)
  • 详细的项目描述
  • 功能特性列表
  • 快速开始指南
  • 硬件要求
  • 软件要求
  • 编译和烧录步骤
  • 项目结构说明
  • API 使用示例
  • 贡献指南链接
  • 许可证信息
  • 联系方式

2.3 创建 CONTRIBUTING.md

包含:

  • 如何报告问题
  • 如何提交功能请求
  • 代码贡献流程
  • 代码规范
  • 提交信息规范
  • Pull Request 流程

2.4 创建 CHANGELOG.md

记录版本更新历史:

# Changelog

All notable changes to this project will be documented in this file.

## [1.0.0] - 2026-02-02

### Added
- 初始版本发布
- OLED 显示屏驱动(SSD1306)
- I2C 通信实现
- 字符和字符串显示功能
- 数字显示功能(十进制、十六进制、二进制)
- LED 控制功能
- 按键输入功能

3. 创建标准目录结构

3.1 创建 docs/ 目录

用于存放所有文档文件

3.2 创建 docs/API.md

详细的 API 文档,包含:

  • OLED 模块 API
  • LED 模块 API
  • Key 模块 API
  • 每个函数的参数说明、返回值、使用示例

3.3 创建 docs/HARDWARE.md

硬件连接说明:

  • STM32 引脚定义
  • OLED 模块连接方式
  • LED 连接电路
  • 按键连接电路
  • 电路原理图(如有)

3.4 创建 docs/DEVELOPMENT.md

开发指南:

  • 开发环境搭建
  • Keil 项目配置
  • 调试技巧
  • 常见问题解决

4. GitHub 配置

4.1 创建 .github/ 目录

4.2 创建 .github/ISSUE_TEMPLATE/bug_report.md

Bug 报告模板

4.3 创建 .github/ISSUE_TEMPLATE/feature_request.md

功能请求模板

4.4 创建 .github/PULL_REQUEST_TEMPLATE.md

PR 模板

5. 编辑器配置

5.1 创建 .editorconfig

统一代码风格配置:

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{c,h}]
indent_style = tab
indent_size = 4

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab

6. 优化项目结构

确保最终的项目结构为:

OLED1/
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   └── feature_request.md
│   └── PULL_REQUEST_TEMPLATE.md
├── docs/
│   ├── API.md
│   ├── HARDWARE.md
│   └── DEVELOPMENT.md
├── Hardware/
│   ├── LED.c
│   ├── LED.h
│   ├── Key.c
│   ├── Key.h
│   ├── OLED.c
│   ├── OLED.h
│   └── OLED_Font.h
├── Library/
├── System/
├── User/
│   ├── main.c
│   ├── stm32f10x_conf.h
│   ├── stm32f10x_it.c
│   └── stm32f10x_it.h
├── Start/
├── .editorconfig
├── .gitignore
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── Project.uvprojx
└── README.md

技术要求

  1. 所有 Markdown 文件必须使用 UTF-8 编码
  2. 中文文档应保持专业性和可读性
  3. 代码注释保持原有风格
  4. 不修改任何源代码文件(.c, .h)
  5. 确保 .gitignore 正确配置,避免提交编译生成文件

验证标准

  • 所有文档文件格式正确
  • 目录结构清晰规范
  • .gitignore 配置完整
  • README.md 信息完整且格式美观
  • 所有模板文件创建完成

参考

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Renamed gitignore.txt to .gitignore
- Removed build artifacts and user-specific files
- Created LICENSE file with MIT license
- Enhanced README.md with comprehensive documentation
- Created CONTRIBUTING.md with contribution guidelines
- Created CHANGELOG.md with version history
- Created .editorconfig for code style consistency
- Created docs/ directory with API.md, HARDWARE.md, and DEVELOPMENT.md
- Created GitHub templates (bug report, feature request, PR template)

Co-authored-by: RtimesC <232979165+RtimesC@users.noreply.github.com>
Copilot AI requested a review from RtimesC February 2, 2026 09:01
Copilot stopped work on behalf of RtimesC due to an error February 2, 2026 09:01
Copilot stopped work on behalf of RtimesC due to an error February 2, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants