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

This commit is contained in:
Peter Barker 2019-06-27 17:22:21 +10:00 committed by Tom Pittenger
parent 82413a1528
commit 8e5ec84317
2 changed files with 12 additions and 0 deletions

View File

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

View File

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