mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-21 04:33:10 +08:00
ToneAlarm: ignore topic updates with 0 timestamp
Commander initially publishes a tune_control topic set to 0, which can interfere with the startup tone (as happening on the Pixhawk Cube).
This commit is contained in:
@@ -139,7 +139,10 @@ void ToneAlarm::orb_update()
|
||||
|
||||
if (updated) {
|
||||
orb_copy(ORB_ID(tune_control), _tune_control_sub, &_tune);
|
||||
_play_tone = _tunes.set_control(_tune) == 0;
|
||||
|
||||
if (_tune.timestamp > 0) {
|
||||
_play_tone = _tunes.set_control(_tune) == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user