mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 01:13:34 +08:00
tunes: Improve logic for interrupting tunes
src/lib/tunes already knows which tunes are interruptable, so add return values to expose than and use than in tone_alarm. This fixes the issue that repeating tunes cannot be interrupted without tune_override set to true. Signed-off-by: Alex Mikhalev <alex@corvus-robotics.com>
This commit is contained in:
committed by
Kabir Mohammed
parent
bd943d872c
commit
378b41af6a
@@ -187,9 +187,9 @@ extern "C" __EXPORT int tune_control_main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
} else if (!strcmp(argv[myoptind], "libtest")) {
|
||||
int ret = tunes.set_control(tune_control);
|
||||
Tunes::ControlResult ret = tunes.set_control(tune_control);
|
||||
|
||||
if (ret == -EINVAL) {
|
||||
if (ret == Tunes::ControlResult::InvalidTune) {
|
||||
PX4_WARN("Tune ID not recognized.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user