Files
stepper_base/AGENTS.md

35 lines
2.1 KiB
Markdown

# 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.