mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Added option 'disable_rx_loss_dshot_beacon' to stop RX loss Dshot beacon from working.
This commit is contained in:
parent
b2f7aa3c36
commit
a0dd12db42
4 changed files with 6 additions and 2 deletions
|
@ -630,6 +630,7 @@ const clivalue_t valueTable[] = {
|
||||||
// PG_BEEPER_CONFIG
|
// PG_BEEPER_CONFIG
|
||||||
#ifdef USE_DSHOT
|
#ifdef USE_DSHOT
|
||||||
{ "beeper_dshot_beacon_tone", VAR_UINT8 | MASTER_VALUE, .config.minmax = {0, DSHOT_CMD_BEACON5 }, PG_BEEPER_CONFIG, offsetof(beeperConfig_t, dshotBeaconTone) },
|
{ "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
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -392,7 +392,7 @@ void beeperUpdate(timeUs_t currentTimeUs)
|
||||||
beeperIsOn = 1;
|
beeperIsOn = 1;
|
||||||
|
|
||||||
#ifdef USE_DSHOT
|
#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();
|
pwmDisableMotors();
|
||||||
delay(1);
|
delay(1);
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,9 @@
|
||||||
#include "beeper.h"
|
#include "beeper.h"
|
||||||
|
|
||||||
PG_REGISTER_WITH_RESET_TEMPLATE(beeperConfig_t, beeperConfig, PG_BEEPER_CONFIG, 1);
|
PG_REGISTER_WITH_RESET_TEMPLATE(beeperConfig_t, beeperConfig, PG_BEEPER_CONFIG, 1);
|
||||||
|
|
||||||
PG_RESET_TEMPLATE(beeperConfig_t, beeperConfig,
|
PG_RESET_TEMPLATE(beeperConfig_t, beeperConfig,
|
||||||
.dshotBeaconTone = 0
|
.dshotBeaconTone = 0,
|
||||||
|
.disableRxLossDshotBeacon = false,
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -27,6 +27,7 @@ typedef struct beeperConfig_s {
|
||||||
uint32_t beeper_off_flags;
|
uint32_t beeper_off_flags;
|
||||||
uint32_t preferred_beeper_off_flags;
|
uint32_t preferred_beeper_off_flags;
|
||||||
uint8_t dshotBeaconTone;
|
uint8_t dshotBeaconTone;
|
||||||
|
uint8_t disableRxLossDshotBeacon;
|
||||||
} beeperConfig_t;
|
} beeperConfig_t;
|
||||||
|
|
||||||
PG_DECLARE(beeperConfig_t, beeperConfig);
|
PG_DECLARE(beeperConfig_t, beeperConfig);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue