AP_HAL_SITL: ToneAlarm doesn't play tones if disabled via param

This commit is contained in:
Peter Barker 2019-10-09 11:01:04 +11:00 committed by Andrew Tridgell
parent a94b1ed65e
commit 9fde3e6297

View File

@ -20,6 +20,10 @@ Synth::sEnvelope envelope;
void ToneAlarm_SF::set_buzzer_tone(float frequency, float volume, float duration_ms)
{
if (!AP::sitl()->tonealarm_sim.is_enabled()) {
return;
}
if (frequency <= 0) {
return;
}