Browse Source

pwm_out_sim: add dynamic mixing support

master
Beat Küng 3 years ago committed by Daniel Agar
parent
commit
21c1671693
  1. 2
      src/drivers/pwm_out_sim/CMakeLists.txt
  2. 4
      src/drivers/pwm_out_sim/PWMSim.cpp
  3. 8
      src/drivers/pwm_out_sim/module.yaml

2
src/drivers/pwm_out_sim/CMakeLists.txt

@ -35,6 +35,8 @@ px4_add_module( @@ -35,6 +35,8 @@ px4_add_module(
MAIN pwm_out_sim
SRCS
PWMSim.cpp
MODULE_CONFIG
module.yaml
DEPENDS
mixer
mixer_module

4
src/drivers/pwm_out_sim/PWMSim.cpp

@ -104,7 +104,7 @@ PWMSim::ioctl(device::file_t *filp, int cmd, unsigned long arg) @@ -104,7 +104,7 @@ PWMSim::ioctl(device::file_t *filp, int cmd, unsigned long arg)
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
for (unsigned i = 0; i < pwm->channel_count; i++) {
if (i < OutputModuleInterface::MAX_ACTUATORS) {
if (i < OutputModuleInterface::MAX_ACTUATORS && !_mixing_output.useDynamicMixing()) {
_mixing_output.minValue(i) = pwm->values[i];
}
}
@ -116,7 +116,7 @@ PWMSim::ioctl(device::file_t *filp, int cmd, unsigned long arg) @@ -116,7 +116,7 @@ PWMSim::ioctl(device::file_t *filp, int cmd, unsigned long arg)
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
for (unsigned i = 0; i < pwm->channel_count; i++) {
if (i < OutputModuleInterface::MAX_ACTUATORS) {
if (i < OutputModuleInterface::MAX_ACTUATORS && !_mixing_output.useDynamicMixing()) {
_mixing_output.maxValue(i) = pwm->values[i];
}
}

8
src/drivers/pwm_out_sim/module.yaml

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
module_name: PWM Sim
actuator_output:
output_groups:
- param_prefix: PWM_SIM
channel_label: 'PWM Sim'
num_channels: 16
Loading…
Cancel
Save