mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Inhibit Dshot motor beeping while motors are running (armed or motor test).
This commit is contained in:
parent
dfe868ef96
commit
c8f528c0af
5 changed files with 27 additions and 24 deletions
|
@ -925,25 +925,8 @@ void stopInTestMode(void)
|
|||
*/
|
||||
bool inMotorTestMode(void) {
|
||||
static uint32_t resetTime = 0;
|
||||
uint16_t inactiveMotorCommand;
|
||||
if (feature(FEATURE_3D)) {
|
||||
inactiveMotorCommand = flight3DConfig()->neutral3d;
|
||||
#ifdef USE_DSHOT
|
||||
} else if (isMotorProtocolDshot()) {
|
||||
inactiveMotorCommand = DSHOT_DISARM_COMMAND;
|
||||
#endif
|
||||
} else {
|
||||
inactiveMotorCommand = motorConfig()->mincommand;
|
||||
}
|
||||
|
||||
int i;
|
||||
bool atLeastOneMotorActivated = false;
|
||||
|
||||
// set disarmed motor values
|
||||
for (i = 0; i < MAX_SUPPORTED_MOTORS; i++)
|
||||
atLeastOneMotorActivated |= (motor_disarmed[i] != inactiveMotorCommand);
|
||||
|
||||
if (atLeastOneMotorActivated) {
|
||||
if (!ARMING_FLAG(ARMED) && areMotorsRunning()) {
|
||||
resetTime = millis() + 5000; // add 5 seconds
|
||||
return true;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue