From 8129f47c69035472d0d0340f19cb954eccadfaf9 Mon Sep 17 00:00:00 2001 From: borisbstyle Date: Thu, 5 Nov 2015 15:17:47 +0100 Subject: [PATCH] Disable Beep on USB via beeper_off_flags --- src/main/io/beeper.c | 4 ++-- src/main/io/beeper.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/io/beeper.c b/src/main/io/beeper.c index 85d054f272..138ba415b3 100644 --- a/src/main/io/beeper.c +++ b/src/main/io/beeper.c @@ -191,7 +191,7 @@ static const beeperTableEntry_t beeperTable[] = { { BEEPER_ENTRY(BEEPER_ARMING_GPS_FIX, 5, beep_armedGpsFix, "ARMING_GPS_FIX") }, { BEEPER_ENTRY(BEEPER_BAT_CRIT_LOW, 6, beep_critBatteryBeep, "BAT_CRIT_LOW") }, { BEEPER_ENTRY(BEEPER_BAT_LOW, 7, beep_lowBatteryBeep, "BAT_LOW") }, - { BEEPER_ENTRY(BEEPER_GPS_STATUS, 8, beep_multiBeeps, NULL) }, + { BEEPER_ENTRY(BEEPER_USB, 8, beep_multiBeeps, NULL) }, { BEEPER_ENTRY(BEEPER_RX_SET, 9, beep_shortBeep, "RX_SET") }, { BEEPER_ENTRY(BEEPER_ACC_CALIBRATION, 10, beep_2shortBeeps, "ACC_CALIBRATION") }, { BEEPER_ENTRY(BEEPER_ACC_CALIBRATION_FAIL, 11, beep_2longerBeeps, "ACC_CALIBRATION_FAIL") }, @@ -211,7 +211,7 @@ static const beeperTableEntry_t *currentBeeperEntry = NULL; */ void beeper(beeperMode_e mode) { - if (mode == BEEPER_SILENCE) { + if (mode == BEEPER_SILENCE || ((masterConfig.beeper_off.flags & (1 << (BEEPER_USB - 1))) && (feature(FEATURE_VBAT) && (batteryCellCount < 2)))) { beeperSilence(); return; } diff --git a/src/main/io/beeper.h b/src/main/io/beeper.h index 5989af6e0a..fc5f44f208 100644 --- a/src/main/io/beeper.h +++ b/src/main/io/beeper.h @@ -29,7 +29,7 @@ typedef enum { BEEPER_ARMING_GPS_FIX, // Beep a special tone when arming the board and GPS has fix BEEPER_BAT_CRIT_LOW, // Longer warning beeps when battery is critically low (repeats) BEEPER_BAT_LOW, // Warning beeps when battery is getting low (repeats) - BEEPER_GPS_STATUS, + BEEPER_USB, // Disable beeper when connected to USB BEEPER_RX_SET, // Beeps when aux channel is set for beep or beep sequence how many satellites has found if GPS enabled BEEPER_DISARM_REPEAT, // Beeps sounded while stick held in disarm position BEEPER_ACC_CALIBRATION, // ACC inflight calibration completed confirmation @@ -65,7 +65,7 @@ BEEPER_ARMING, 16 // Beep when arming the board BEEPER_ARMING_GPS_FIX, 32 // Beep a special tone when arming the board and GPS has fix BEEPER_BAT_CRIT_LOW, 64 // Longer warning beeps when battery is critically low (repeats) BEEPER_BAT_LOW, 128 // Warning beeps when battery is getting low (repeats) -BEEPER_GPS_STATUS, 256 +BEEPER_USB_DISABLE, 256 // Disable beeper when connected to USB BEEPER_RX_SET, 512 // Beeps when aux channel is set for beep or beep sequence how many satellites has found if GPS enabled BEEPER_DISARM_REPEAT, 1024 // Beeps sounded while stick held in disarm position BEEPER_ACC_CALIBRATION, 2048 // ACC inflight calibration completed confirmation