mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 07:33:34 +08:00
tune_control: use orb queue advertisement consistently
This commit is contained in:
@@ -52,7 +52,8 @@ int test_tone(int argc, char *argv[])
|
||||
tune_control_s tune_control = {};
|
||||
tune_control.tune_id = static_cast<int>(TuneID::NOTIFY_NEGATIVE);
|
||||
|
||||
orb_advert_t tune_control_pub = orb_advertise(ORB_ID(tune_control), &tune_control);
|
||||
orb_advert_t tune_control_pub = orb_advertise_queue(ORB_ID(tune_control), &tune_control,
|
||||
tune_control_s::ORB_QUEUE_LENGTH);
|
||||
|
||||
if (argc == 1) {
|
||||
PX4_INFO("Volume silenced for testing predefined tunes 0-20.");
|
||||
|
||||
@@ -69,7 +69,7 @@ static void publish_tune_control(tune_control_s &tune_control)
|
||||
|
||||
if (tune_control_pub == nullptr) {
|
||||
// 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);
|
||||
tune_control_pub = orb_advertise_queue(ORB_ID(tune_control), &tune_control, tune_control_s::ORB_QUEUE_LENGTH);
|
||||
|
||||
} else {
|
||||
orb_publish(ORB_ID(tune_control), tune_control_pub, &tune_control);
|
||||
|
||||
Reference in New Issue
Block a user