Thanks for your interest in contributing! 🎉
git clone https://github.com/redbasecap-buiss/esp32emu.git
cd esp32emu
make test # Run all tests
make examples # Build all examples- Create header in
include/(e.g.,MyLibrary.h) - Implement as header-only if possible; use
src/for larger implementations - Add test in
test/test_mylib.cpp - Add example in
examples/myexample/myexample.ino - Update
CHANGELOG.md
- Header-only preferred — keeps build simple, one
#includeand it works - Thread-safe — use
std::mutexfor shared state (FreeRTOS tasks run as real threads) - Test helpers — add methods like
simulateX(),injectData(),getState()for testing - Namespace — put implementation in
esp32emu::namespace, expose Arduino-compatible free functions - Reset — every controller needs a
reset()method for test isolation
- C++17, no external dependencies beyond POSIX
snake_casefor internal APIs, Arduino-compatible naming for public APIs- Keep mocks faithful to the real Arduino/ESP-IDF API signatures
- Use
fprintf(stderr, "[esp32emu] ...")for emulator-level logging
Every mock needs a test in test/. Tests should:
- Use
assert()for verification - Print a summary line:
printf("test_name: all assertions passed\n"); - Return 0 on success
- Be self-contained (reset state at the beginning)
Examples should:
- Live in
examples/<name>/<name>.ino - Have a descriptive comment header explaining what they do
- Be runnable:
./esp32emu run examples/<name>/<name>.ino - Demonstrate practical use cases
- Add board definition in
include/esp32emu_board.h - Include ASCII art for the board
- Set correct pin counts, RAM, flash, and feature flags
- Add to
--list-boardsoutput - Add an example if the board has unique features
- Keep PRs focused — one feature or fix per PR
- Run
make testbefore submitting - Update CHANGELOG.md with your changes
- Add tests for new functionality
Open an issue! We're happy to help.