๐ค Contributing to HardFOC Internal Interface Wrapper
Thank you for your interest in contributing to the HardFOC Internal Interface Wrapper! This document provides guidelines and information for contributors.
๐ Code Standards
๐ฏ Coding Style and Best Practices for HardFOC Development
- C++17 Standard Compliance - All code must be compatible with C++17
- Consistent Naming - Follow the established naming conventions:
- Classes:
PascalCase(e.g.,EspGpio,BaseTemperature) - Functions:
PascalCase(e.g.,EnsureInitialized,ReadChannelV) - Variables:
snake_case*with trailing underscore for members (e.g.,motor_enable*,current_sensor*) - Constants:
UPPER_SNAKE_CASE(e.g.,ADC_CHANNEL_0) - Types:
hf*prefix with*tsuffix (e.g.,hf_gpio_err_t,hf_pin_num_t)
- Classes:
๐๏ธ Architecture Guidelines
- Inherit from Base Classes - All hardware implementations must inherit from their respective base classes
- Lazy Initialization - Use the
EnsureInitialized()pattern for resource allocation - Comprehensive Error Handling - All functions must return appropriate error codes
- Thread Safety - Consider thread safety implications and document any limitations
- Platform Agnostic Types - Use HardFOC type system
(
hf_u32_t,hf_pin_num_t, etc.)
๐งช Testing
๐ง Unit Tests and Hardware Validation Requirements for HardFOC Boards
- Unit Tests - Write comprehensive unit tests for all new functionality
- Hardware Testing - Test on actual HardFOC boards with ESP32-C6
- Integration Tests - Verify compatibility with existing HardFOC systems
- Performance Tests - Ensure real-time performance requirements are met
- Safety Tests - Validate safety features and error handling
๐ Documentation
๐ Documentation Standards and Updates for HardFOC Systems
- API Documentation - Update documentation for all public interfaces
- User Guides - Create or update guides for new HardFOC features
- Example Code - Provide working examples for HardFOC motor controller boards
- Architecture Documentation - Document design decisions and patterns
๐ Bug Reports
๐ How to Report Bugs Effectively for HardFOC Applications
When reporting bugs, please include:
- HardFOC Board Information: Board model, ESP32-C6 version, power supply
- Environment Details: ESP-IDF version, compiler version, operating system
- Reproduction Steps: Minimal code example, configuration settings
- Hardware Configuration: Connected peripherals, pin assignments
- Debugging Information: Error messages, log output, stack traces
โจ Feature Requests
๐ Proposing New Features and Enhancements for HardFOC Boards
When proposing new features:
- HardFOC Use Case - Describe the specific HardFOC motor controller board use case
- Technical Specification - Provide detailed technical requirements
- API Design - Propose the interface design following established patterns
- Implementation Plan - Outline the implementation approach
- Testing Strategy - Describe how the feature will be tested
๐ Development Workflow
๐ Step-by-Step Development Process
- Fork the Repository
- Create a Feature Branch
- Implement Your Changes with HardFOC-Specific Tests
- Document Your Changes with HardFOC Examples
- Submit a Pull Request
๐ Code Quality Standards for HardFOC
- C++17 Compliance - Code compiles without warnings
- HardFOC Compatibility - Tested on HardFOC boards
- Error Handling - All error conditions handled appropriately
- Documentation - All public APIs documented
- Tests - Adequate test coverage provided
- Performance - Real-time requirements met
๐ Thank You for Contributing to HardFOC
Your contributions help make HardFOC motor controller boards more accessible and powerful for everyone.