1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

Added option 'disable_rx_loss_dshot_beacon' to stop RX loss Dshot beacon from working.

This commit is contained in:
mikeller 2018-05-15 01:45:11 +12:00
parent b2f7aa3c36
commit a0dd12db42
4 changed files with 6 additions and 2 deletions

View file

@ -630,6 +630,7 @@ const clivalue_t valueTable[] = {
// PG_BEEPER_CONFIG
#ifdef USE_DSHOT
{ "beeper_dshot_beacon_tone", VAR_UINT8 | MASTER_VALUE, .config.minmax = {0, DSHOT_CMD_BEACON5 }, PG_BEEPER_CONFIG, offsetof(beeperConfig_t, dshotBeaconTone) },
{ "disable_rx_loss_dshot_beacon", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_BEEPER_CONFIG, offsetof(beeperConfig_t, disableRxLossDshotBeacon) },
#endif
#endif

View file

@ -392,7 +392,7 @@ void beeperUpdate(timeUs_t currentTimeUs)
beeperIsOn = 1;
#ifdef USE_DSHOT
if (!areMotorsRunning() && beeperConfig()->dshotBeaconTone && (beeperConfig()->dshotBeaconTone <= DSHOT_CMD_BEACON5) && (currentBeeperEntry->mode == BEEPER_RX_SET || currentBeeperEntry->mode == BEEPER_RX_LOST)) {
if (!areMotorsRunning() && beeperConfig()->dshotBeaconTone && (beeperConfig()->dshotBeaconTone <= DSHOT_CMD_BEACON5) && (currentBeeperEntry->mode == BEEPER_RX_SET || (beeperConfig()->disableRxLossDshotBeacon && currentBeeperEntry->mode == BEEPER_RX_LOST))) {
pwmDisableMotors();
delay(1);

View file

@ -28,7 +28,9 @@
#include "beeper.h"
PG_REGISTER_WITH_RESET_TEMPLATE(beeperConfig_t, beeperConfig, PG_BEEPER_CONFIG, 1);
PG_RESET_TEMPLATE(beeperConfig_t, beeperConfig,
.dshotBeaconTone = 0
.dshotBeaconTone = 0,
.disableRxLossDshotBeacon = false,
);
#endif

View file

@ -27,6 +27,7 @@ typedef struct beeperConfig_s {
uint32_t beeper_off_flags;
uint32_t preferred_beeper_off_flags;
uint8_t dshotBeaconTone;
uint8_t disableRxLossDshotBeacon;
} beeperConfig_t;
PG_DECLARE(beeperConfig_t, beeperConfig);