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:
Beat Küng
2019-05-08 11:24:35 +02:00
parent f30f12341f
commit 1169d091b6
+4 -1
View File
@@ -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;
}
}
}