mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 06:13:34 +08:00
tunes:Refactor for maintenance
Adds a single file definition to provide a single point to add
new tunes and clearly understand, the useage: it need to be
stopped will it not allow interruption.
This commit is contained in:
committed by
Lorenz Meier
parent
250c561963
commit
ab26bd76ff
@@ -81,7 +81,8 @@ static void publish_tune_control(tune_control_s &tune_control)
|
||||
tune_control.timestamp = hrt_absolute_time();
|
||||
|
||||
if (tune_control_pub == nullptr) {
|
||||
tune_control_pub = orb_advertise(ORB_ID(tune_control), &tune_control);
|
||||
// We have a minimum of 3 so that tune, stop, tune will fit
|
||||
tune_control_pub = orb_advertise_queue(ORB_ID(tune_control), &tune_control, 3);
|
||||
|
||||
} else {
|
||||
orb_publish(ORB_ID(tune_control), tune_control_pub, &tune_control);
|
||||
@@ -233,6 +234,9 @@ tune_control_main(int argc, char *argv[])
|
||||
tune_control.silence = 0;
|
||||
tune_control.tune_override = true;
|
||||
publish_tune_control(tune_control);
|
||||
// We wait the maximum update interval to ensure
|
||||
// The stop will not be overwritten
|
||||
usleep(tunes.get_maximum_update_interval());
|
||||
|
||||
} else {
|
||||
usage();
|
||||
|
||||
Reference in New Issue
Block a user