1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

Disable Beep on USB via beeper_off_flags

This commit is contained in:
borisbstyle 2015-11-05 15:17:47 +01:00
parent 7e72d89081
commit 8129f47c69
2 changed files with 4 additions and 4 deletions

View file

@ -191,7 +191,7 @@ static const beeperTableEntry_t beeperTable[] = {
{ BEEPER_ENTRY(BEEPER_ARMING_GPS_FIX, 5, beep_armedGpsFix, "ARMING_GPS_FIX") }, { 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_CRIT_LOW, 6, beep_critBatteryBeep, "BAT_CRIT_LOW") },
{ BEEPER_ENTRY(BEEPER_BAT_LOW, 7, beep_lowBatteryBeep, "BAT_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_RX_SET, 9, beep_shortBeep, "RX_SET") },
{ BEEPER_ENTRY(BEEPER_ACC_CALIBRATION, 10, beep_2shortBeeps, "ACC_CALIBRATION") }, { BEEPER_ENTRY(BEEPER_ACC_CALIBRATION, 10, beep_2shortBeeps, "ACC_CALIBRATION") },
{ BEEPER_ENTRY(BEEPER_ACC_CALIBRATION_FAIL, 11, beep_2longerBeeps, "ACC_CALIBRATION_FAIL") }, { 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) 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(); beeperSilence();
return; return;
} }

View file

@ -29,7 +29,7 @@ typedef enum {
BEEPER_ARMING_GPS_FIX, // Beep a special tone when arming the board and GPS has fix 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_CRIT_LOW, // Longer warning beeps when battery is critically low (repeats)
BEEPER_BAT_LOW, // Warning beeps when battery is getting 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_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_DISARM_REPEAT, // Beeps sounded while stick held in disarm position
BEEPER_ACC_CALIBRATION, // ACC inflight calibration completed confirmation 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_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_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_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_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_DISARM_REPEAT, 1024 // Beeps sounded while stick held in disarm position
BEEPER_ACC_CALIBRATION, 2048 // ACC inflight calibration completed confirmation BEEPER_ACC_CALIBRATION, 2048 // ACC inflight calibration completed confirmation