mirror of https://github.com/ArduPilot/ardupilot
AP_Relay: add AP::relay() to get relay singleton
This commit is contained in:
parent
82413a1528
commit
8e5ec84317
|
@ -162,3 +162,11 @@ void AP_Relay::toggle(uint8_t relay)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace AP {
|
||||||
|
|
||||||
|
AP_Relay *relay()
|
||||||
|
{
|
||||||
|
return AP_Relay::get_singleton();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -48,3 +48,7 @@ private:
|
||||||
AP_Int8 _pin[AP_RELAY_NUM_RELAYS];
|
AP_Int8 _pin[AP_RELAY_NUM_RELAYS];
|
||||||
AP_Int8 _default;
|
AP_Int8 _default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace AP {
|
||||||
|
AP_Relay *relay();
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue