Anvil v1.0.0 -- Arduino build tool with HAL and test scaffolding
Single-binary CLI that scaffolds testable Arduino projects, compiles, uploads, and monitors serial output. Templates embed a hardware abstraction layer, Google Mock infrastructure, and CMake-based host tests so application logic can be verified without hardware. Commands: new, doctor, setup, devices, build, upload, monitor 39 Rust tests (21 unit, 18 integration) Cross-platform: Linux and Windows
This commit is contained in:
28
templates/basic/__name__/__name__.ino.tmpl
Normal file
28
templates/basic/__name__/__name__.ino.tmpl
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* {{PROJECT_NAME}}.ino -- LED blink with button-controlled speed
|
||||
*
|
||||
* This .ino file is the entry point. All logic lives in the app
|
||||
* header (lib/app/{{PROJECT_NAME}}_app.h) which depends on the HAL
|
||||
* interface (lib/hal/hal.h), making it testable on the host.
|
||||
*
|
||||
* Wiring:
|
||||
* Pin 13 (LED_BUILTIN) -- onboard LED (no wiring needed)
|
||||
* Pin 2 -- momentary button to GND (uses INPUT_PULLUP)
|
||||
*
|
||||
* Serial: 115200 baud
|
||||
* Prints "FAST" or "SLOW" on button press.
|
||||
*/
|
||||
|
||||
#include <hal_arduino.h>
|
||||
#include <{{PROJECT_NAME}}_app.h>
|
||||
|
||||
static ArduinoHal hw;
|
||||
static BlinkApp app(&hw);
|
||||
|
||||
void setup() {
|
||||
app.begin();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
app.update();
|
||||
}
|
||||
Reference in New Issue
Block a user