mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-18 06:38:29 -04:00
SRV_Channels: added SRV_Channels::enable_by_mask()
This commit is contained in:
parent
2c4975ba31
commit
84114d067a
@ -321,6 +321,9 @@ public:
|
||||
// assign and enable auxiliary channels
|
||||
static void enable_aux_servos(void);
|
||||
|
||||
// enable channels by mask
|
||||
static void enable_by_mask(uint16_t mask);
|
||||
|
||||
// return the current function for a channel
|
||||
static SRV_Channel::Aux_servo_function_t channel_function(uint8_t channel);
|
||||
|
||||
|
@ -161,6 +161,16 @@ void SRV_Channels::enable_aux_servos()
|
||||
}
|
||||
}
|
||||
|
||||
/// enable output channels using a channel mask
|
||||
void SRV_Channels::enable_by_mask(uint16_t mask)
|
||||
{
|
||||
for (uint8_t i = 0; i < 16; i++) {
|
||||
if (mask & (1U<<i)) {
|
||||
hal.rcout->enable_ch(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
set radio_out for all channels matching the given function type
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user