Skip to content

Commit 6fb1c79

Browse files
dagarjulianoes
authored andcommitted
mixer_module: reject mixer load and reset when dynamic mixing is enabled
1 parent f1016dc commit 6fb1c79

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lib/mixer_module/mixer_module.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,11 @@ void MixingOutput::handleCommands()
10671067

10681068
void MixingOutput::resetMixerThreadSafe()
10691069
{
1070+
if (_use_dynamic_mixing) {
1071+
PX4_ERR("mixer reset unavailable, not using static mixers");
1072+
return;
1073+
}
1074+
10701075
if ((Command::Type)_command.command.load() != Command::Type::None) {
10711076
// Cannot happen, because we expect only one other thread to call this.
10721077
// But as a safety precaution we return here.
@@ -1091,6 +1096,11 @@ void MixingOutput::resetMixerThreadSafe()
10911096

10921097
int MixingOutput::loadMixerThreadSafe(const char *buf, unsigned len)
10931098
{
1099+
if (_use_dynamic_mixing) {
1100+
PX4_ERR("mixer load unavailable, not using static mixers");
1101+
return -1;
1102+
}
1103+
10941104
if ((Command::Type)_command.command.load() != Command::Type::None) {
10951105
// Cannot happen, because we expect only one other thread to call this.
10961106
// But as a safety precaution we return here.

0 commit comments

Comments
 (0)