AP_IOMCU: fix IO fast channel mask

This commit is contained in:
Mark Whitehorn 2019-09-22 16:52:31 -06:00 committed by Andrew Tridgell
parent d8a07b6c44
commit 0a6ae60c89
2 changed files with 6 additions and 4 deletions

View File

@ -652,11 +652,10 @@ 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(masks); i++) {
if (chmask & masks[i]) {
chmask |= masks[i];
for (uint8_t i=0; i<ARRAY_SIZE(ch_masks); i++) {
if (chmask & ch_masks[i]) {
chmask |= ch_masks[i];
}
}
rate.freq = freq;

View File

@ -103,6 +103,9 @@ public:
bool setup_mixing(RCMapper *rcmap, int8_t override_chan,
float mixing_gain, uint16_t manual_rc_mask);
// channel group masks
const uint8_t ch_masks[3] = { 0x03,0x0C,0xF0 };
private:
AP_HAL::UARTDriver &uart;