From 4aa901f203c1b6e43e02bd8f66389e7481d04bfa Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 20 Jan 2014 15:35:38 +1100 Subject: [PATCH] AP_Relay: added enabled() API --- libraries/AP_Relay/AP_Relay.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/AP_Relay/AP_Relay.h b/libraries/AP_Relay/AP_Relay.h index 7fb6416ffd..2aa9a441c5 100644 --- a/libraries/AP_Relay/AP_Relay.h +++ b/libraries/AP_Relay/AP_Relay.h @@ -32,6 +32,9 @@ public: // de-activate the relay void off(uint8_t relay); + // see if the relay is enabled + bool enabled(uint8_t relay) { return relay < AP_RELAY_NUM_RELAYS && _pin[relay] != -1; } + // toggle the relay status void toggle(uint8_t relay);