Update repo guidelines and VS Code config

This commit is contained in:
2026-01-30 15:43:38 +08:00
parent f66b097667
commit 917f42d7ab
5 changed files with 40 additions and 49 deletions

View File

@@ -1,23 +0,0 @@
{
"configurations": [
{
"name": "ESP-IDF",
"compilerPath": "${config:idf.toolsPathWin}\\tools\\xtensa-esp-elf\\esp-14.2.0_20251107\\xtensa-esp-elf\\bin\\xtensa-esp32-elf-gcc.exe",
"compileCommands": "${config:idf.buildPath}/compile_commands.json",
"includePath": [
"${config:idf.espIdfPath}/components/**",
"${config:idf.espIdfPathWin}/components/**",
"${workspaceFolder}/**"
],
"browse": {
"path": [
"${config:idf.espIdfPath}/components",
"${config:idf.espIdfPathWin}/components",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
}
}
],
"version": 4
}

6
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"recommendations": [
"espressif.esp-idf-extension",
"llvm-vs-code-extensions.vscode-clangd"
]
}

15
.vscode/launch.json vendored
View File

@@ -1,15 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "gdbtarget",
"request": "attach",
"name": "Eclipse CDT GDB Adapter"
},
{
"type": "espidf",
"name": "Launch",
"request": "launch"
}
]
}

11
.vscode/settings.json vendored
View File

@@ -1,20 +1,9 @@
{
"C_Cpp.intelliSenseEngine": "default",
"idf.espIdfPathWin": "C:\\Users\\Admin\\esp\\v5.5.2\\esp-idf",
"idf.pythonInstallPath": "C:\\Users\\Admin\\.espressif\\tools\\idf-python\\3.11.2\\python.exe",
"idf.openOcdConfigs": [
"board/esp32s3-builtin.cfg"
],
"idf.portWin": "COM3",
"idf.toolsPathWin": "C:\\Users\\Admin\\.espressif",
"idf.customExtraVars": {
"IDF_TARGET": "esp32s3"
},
"clangd.path": "C:\\Users\\Admin\\.espressif\\tools\\esp-clang\\esp-19.1.2_20250312\\esp-clang\\bin\\clangd.exe",
"clangd.arguments": [
"--background-index",
"--query-driver=**",
"--compile-commands-dir=c:\\Users\\Admin\\OneDrive\\Project\\招财猫\\Stepper base\\build"
],
"idf.flashType": "UART"
}

34
AGENTS.md Normal file
View File

@@ -0,0 +1,34 @@
# Repository Guidelines
## Project Structure & Module Organization
- `main/` holds the application entry point (`main.c`) and its build file (`main/CMakeLists.txt`).
- `components/stepper_motor/` contains the reusable stepper motor component. Public headers live in `components/stepper_motor/include/` and source in `components/stepper_motor/stepper_motor.c`.
- `build/` is generated by ESP-IDF/CMake; do not edit or commit build artifacts.
- `sdkconfig` is the project configuration used by ESP-IDF; `sdkconfig.old` is a backup after config changes.
## Build, Test, and Development Commands
Run these from an ESP-IDF environment with `IDF_PATH` set:
- `idf.py build` — configure and compile the firmware into `build/`.
- `idf.py flash -p <PORT>` — flash to the connected device.
- `idf.py monitor` — open the serial monitor.
- `idf.py flash monitor -p <PORT>` — common flash + monitor workflow.
- `idf.py menuconfig` — edit `sdkconfig` interactively.
- `idf.py fullclean` — remove build output and cached configuration.
## Coding Style & Naming Conventions
- C code uses 4-space indentation with braces on the same line.
- Use `lower_snake_case` for functions/variables, `UPPER_SNAKE_CASE` for macros, and `*_t` suffixes for typedefs.
- Prefer `static` for file-local helpers and use `ESP_LOGx` for logging.
- Keep component APIs in `components/<name>/include/` and include with quotes (e.g., `"stepper_motor.h"`).
## Testing Guidelines
- No automated test framework is configured in this repo.
- Validate behavior on hardware after changes; include manual test steps and results in PR descriptions.
## Commit & Pull Request Guidelines
- Git history shows short, imperative summaries without scopes (e.g., "Initial commit").
- PRs should include: a short description, hardware/board tested, and any notable serial output or behavior changes. Attach photos/videos when motion behavior changes.
## Configuration & Hardware Notes
- GPIO assignments and motion parameters are defined in `components/stepper_motor/include/stepper_motor.h`.
- Update pin mappings and timing constants there if wiring or motor characteristics change.