|
|
@ -500,10 +500,10 @@ RCOutput::pwm_group *RCOutput::find_chan(uint8_t chan, uint8_t &group_idx) |
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* return mask of channels that must be disabled because they share a group with a digital channel |
|
|
|
* return mask of channels that must be disabled because they share a group with a digital channel |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
uint16_t RCOutput::get_disabled_channels(uint16_t digital_mask) |
|
|
|
uint32_t RCOutput::get_disabled_channels(uint32_t digital_mask) |
|
|
|
{ |
|
|
|
{ |
|
|
|
uint16_t dmask = (digital_mask >> chan_offset); |
|
|
|
uint32_t dmask = (digital_mask >> chan_offset); |
|
|
|
uint16_t disabled_chan_mask = 0; |
|
|
|
uint32_t disabled_chan_mask = 0; |
|
|
|
for (auto &group : pwm_group_list) { |
|
|
|
for (auto &group : pwm_group_list) { |
|
|
|
bool digital_group = false; |
|
|
|
bool digital_group = false; |
|
|
|
for (uint8_t j = 0; j < 4; j++) { |
|
|
|
for (uint8_t j = 0; j < 4; j++) { |
|
|
@ -615,7 +615,7 @@ void RCOutput::push_local(void) |
|
|
|
if (active_fmu_channels == 0) { |
|
|
|
if (active_fmu_channels == 0) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
uint16_t outmask = (1U<<active_fmu_channels)-1; |
|
|
|
uint32_t outmask = (1U<<active_fmu_channels)-1; |
|
|
|
outmask &= en_mask; |
|
|
|
outmask &= en_mask; |
|
|
|
|
|
|
|
|
|
|
|
uint16_t widest_pulse = 0; |
|
|
|
uint16_t widest_pulse = 0; |
|
|
@ -1383,7 +1383,7 @@ void RCOutput::dshot_send(pwm_group &group, uint32_t time_out_us) |
|
|
|
// assume that we won't be able to get the input capture lock
|
|
|
|
// assume that we won't be able to get the input capture lock
|
|
|
|
group.bdshot.enabled = false; |
|
|
|
group.bdshot.enabled = false; |
|
|
|
|
|
|
|
|
|
|
|
uint16_t active_channels = group.ch_mask & group.en_mask; |
|
|
|
uint32_t active_channels = group.ch_mask & group.en_mask; |
|
|
|
// now grab the input capture lock if we are able, we can only enable bi-dir on a group basis
|
|
|
|
// now grab the input capture lock if we are able, we can only enable bi-dir on a group basis
|
|
|
|
if (((_bdshot.mask & active_channels) == active_channels) && group.has_ic()) { |
|
|
|
if (((_bdshot.mask & active_channels) == active_channels) && group.has_ic()) { |
|
|
|
if (group.has_shared_ic_up_dma()) { |
|
|
|
if (group.has_shared_ic_up_dma()) { |
|
|
@ -1456,7 +1456,7 @@ void RCOutput::dshot_send(pwm_group &group, uint32_t time_out_us) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const uint16_t chan_mask = (1U<<chan); |
|
|
|
const uint32_t chan_mask = (1U<<chan); |
|
|
|
|
|
|
|
|
|
|
|
pwm = constrain_int16(pwm, 1000, 2000); |
|
|
|
pwm = constrain_int16(pwm, 1000, 2000); |
|
|
|
uint16_t value = MIN(2 * (pwm - 1000), 1999); |
|
|
|
uint16_t value = MIN(2 * (pwm - 1000), 1999); |
|
|
|