Browse Source

AP_IOMCU: fix IO fast channel mask

master
Mark Whitehorn 5 years ago committed by Andrew Tridgell
parent
commit
0a6ae60c89
  1. 7
      libraries/AP_IOMCU/AP_IOMCU.cpp
  2. 3
      libraries/AP_IOMCU/AP_IOMCU.h

7
libraries/AP_IOMCU/AP_IOMCU.cpp

@ -652,11 +652,10 @@ void AP_IOMCU::push(void) @@ -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;

3
libraries/AP_IOMCU/AP_IOMCU.h

@ -103,6 +103,9 @@ public: @@ -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;

Loading…
Cancel
Save