From 3ab58d30f23aa1f3d7d1968846de16fddddca8fd Mon Sep 17 00:00:00 2001 From: Jonathan Papineau Date: Sat, 30 Jul 2022 16:02:49 -0400 Subject: [PATCH] feat: add digital safe pin --- protobuf-definitions | 2 +- src/digitalMessage.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/protobuf-definitions b/protobuf-definitions index 38da2e9..41b8356 160000 --- a/protobuf-definitions +++ b/protobuf-definitions @@ -1 +1 @@ -Subproject commit 38da2e9033c0d9528fb46e09616a49f1d93d2c2d +Subproject commit 41b8356d5c8396c62ebb0ef1c64e9b06f1a2fffa diff --git a/src/digitalMessage.cpp b/src/digitalMessage.cpp index 5a3bf9d..d1d1b5f 100644 --- a/src/digitalMessage.cpp +++ b/src/digitalMessage.cpp @@ -54,9 +54,10 @@ void initDigital(const RocketryProto_DigitalInit &digitalInit) } pinMode(pin, OUTPUT); + digitalWrite(pin, digitalInit.safeState); digitalPins[digitalCount].pin = pin; - digitalPins[digitalCount].activated = false; + digitalPins[digitalCount].activated = digitalInit.safeState; digitalCount++; sendEventMessage(RocketryProto_EventTypes_DIGITAL_INIT, pin);