mirror of https://github.com/ArduPilot/ardupilot
AP_IOMCU: fixed setting of rate masks
this affects layouts which set a subset of channels on a timer
This commit is contained in:
parent
fa4d125727
commit
6d3ff416cf
|
@ -563,8 +563,15 @@ void AP_IOMCU::push(void)
|
|||
// set output frequency
|
||||
void AP_IOMCU::set_freq(uint16_t chmask, uint16_t freq)
|
||||
{
|
||||
const uint8_t masks[] = { 0x03,0x0C,0xF0 };
|
||||
// ensure mask is legal for the timer layout
|
||||
for (uint8_t i=0; i<ARRAY_SIZE_SIMPLE(masks); i++) {
|
||||
if (chmask & masks[i]) {
|
||||
chmask |= masks[i];
|
||||
}
|
||||
}
|
||||
rate.freq = freq;
|
||||
rate.chmask = chmask;
|
||||
rate.chmask |= chmask;
|
||||
trigger_event(IOEVENT_SET_RATES);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue