Browse Source

AP_Relay: add AP::relay() to get relay singleton

master
Peter Barker 6 years ago committed by Tom Pittenger
parent
commit
8e5ec84317
  1. 8
      libraries/AP_Relay/AP_Relay.cpp
  2. 4
      libraries/AP_Relay/AP_Relay.h

8
libraries/AP_Relay/AP_Relay.cpp

@ -162,3 +162,11 @@ void AP_Relay::toggle(uint8_t relay) @@ -162,3 +162,11 @@ void AP_Relay::toggle(uint8_t relay)
}
}
namespace AP {
AP_Relay *relay()
{
return AP_Relay::get_singleton();
}
}

4
libraries/AP_Relay/AP_Relay.h

@ -48,3 +48,7 @@ private: @@ -48,3 +48,7 @@ private:
AP_Int8 _pin[AP_RELAY_NUM_RELAYS];
AP_Int8 _default;
};
namespace AP {
AP_Relay *relay();
};

Loading…
Cancel
Save