mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 01:13:33 +08:00
Addressed review comments from #9769
This commit is contained in:
committed by
Beat Küng
parent
df257c6555
commit
155089c800
@@ -52,8 +52,6 @@
|
||||
* @group Events
|
||||
* @boolean
|
||||
* @reboot_required true
|
||||
* @value 0 OFF
|
||||
* @value 1 ON
|
||||
*/
|
||||
PARAM_DEFINE_INT32(EV_TSK_STAT_DIS, 0);
|
||||
|
||||
@@ -61,12 +59,13 @@ PARAM_DEFINE_INT32(EV_TSK_STAT_DIS, 0);
|
||||
* RC Loss Alarm
|
||||
*
|
||||
* Enable/disable event task for RC Loss. When enabled, an alarm tune will be
|
||||
* played via buzzer or ESCs, if supported.
|
||||
* played via buzzer or ESCs, if supported. The alarm will sound after a disarm,
|
||||
* if the vehicle was previously armed and only if the vehicle had RC signal at
|
||||
* some point. Particularly useful for locating crashes drones without a GPS
|
||||
* sensor.
|
||||
*
|
||||
* @group Events
|
||||
* @boolean
|
||||
* @reboot_required true
|
||||
* @value 0 OFF
|
||||
* @value 1 ON
|
||||
*/
|
||||
PARAM_DEFINE_INT32(EV_TSK_RC_LOSS, 0);
|
||||
|
||||
@@ -94,15 +94,15 @@ void RC_Loss_Alarm::process()
|
||||
void RC_Loss_Alarm::play_tune()
|
||||
{
|
||||
struct tune_control_s tune_control = {};
|
||||
tune_control.tune_id = static_cast<int>(TuneID::ERROR_TUNE);
|
||||
tune_control.strength = tune_control_s::STRENGTH_MAX;
|
||||
tune_control.tune_override = 1;
|
||||
tune_control.timestamp = hrt_absolute_time();
|
||||
|
||||
if (_tune_control_pub == nullptr) {
|
||||
_tune_control_pub = orb_advertise(ORB_ID(tune_control), &tune_control);
|
||||
|
||||
} else {
|
||||
tune_control.tune_id = static_cast<int>(TuneID::ERROR_TUNE);
|
||||
tune_control.strength = tune_control_s::STRENGTH_MAX;
|
||||
tune_control.tune_override = 1;
|
||||
tune_control.timestamp = hrt_absolute_time();
|
||||
orb_publish(ORB_ID(tune_control), _tune_control_pub, &tune_control);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,9 +68,6 @@ private:
|
||||
/** Publish tune control to sound alarm */
|
||||
void play_tune();
|
||||
|
||||
/** Publish tune control to stop any ongoing tune, including alarm */
|
||||
void stop_tune();
|
||||
|
||||
int _vehicle_status_sub = -1;
|
||||
struct vehicle_status_s _vehicle_status = {};
|
||||
bool _was_armed = false;
|
||||
|
||||
Reference in New Issue
Block a user