drivers/tone_alarm and tune_control small improvements/cleanup

- drivers/tone_alarm: move to ModuleBase and purge CDev (/dev/tone_alarm0)
 - drivers/tone_alarm: only run on tune_control publication (or scheduled note) rather than continuously
 - drivers/tone_alarm: use HRT to schedule tone stop (prevents potential disruption)
 - msg/tune_control: add tune_id numbering
 - systemcmds/tune_control: add "error" special case tune_id
 - move all tune_control publication to new uORB::PublicationQueued<>
 - start tone_alarm immediately after board defaults are loaded to fix potential startup issues
 - for SITL (or other boards with no TONE output) print common messages (startup, error, etc)
This commit is contained in:
Daniel Agar
2020-10-05 21:39:26 -04:00
committed by GitHub
parent c7072b61a3
commit 08bf71b73d
39 changed files with 429 additions and 577 deletions
+2 -6
View File
@@ -129,14 +129,11 @@ SafetyButton::CheckPairingRequest(bool button_pressed)
++_pairing_button_counter;
}
if (_pairing_button_counter == 3) {
vehicle_command_s vcmd{};
vcmd.command = vehicle_command_s::VEHICLE_CMD_START_RX_PAIR;
vcmd.timestamp = now;
vcmd.param1 = 10.f; // GCS pairing request handled by a companion.
vcmd.timestamp = hrt_absolute_time();
_to_command.publish(vcmd);
PX4_DEBUG("Sending GCS pairing request");
@@ -150,9 +147,8 @@ SafetyButton::CheckPairingRequest(bool button_pressed)
_to_led_control.publish(led_control);
tune_control_s tune_control{};
tune_control.tune_id = TONE_NOTIFY_POSITIVE_TUNE;
tune_control.tune_id = tune_control_s::TUNE_ID_NOTIFY_POSITIVE;
tune_control.volume = tune_control_s::VOLUME_LEVEL_DEFAULT;
tune_control.tune_override = 0;
tune_control.timestamp = hrt_absolute_time();
_to_tune_control.publish(tune_control);
@@ -77,7 +77,6 @@ private:
void FlashButton();
void CheckPairingRequest(bool button_pressed);
uORB::Subscription _armed_sub{ORB_ID(actuator_armed)};
uORB::Publication<safety_s> _to_safety{ORB_ID(safety)};
uORB::PublicationQueued<vehicle_command_s> _to_command{ORB_ID(vehicle_command)};