mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 09:58:28 -04:00
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
e75dfd793b
commit
7cb169d0b9
@ -550,8 +550,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
Block a user