1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 17:25:20 +03:00

Use wasThrottleRaised in place of isAirmodeActivated where appropriate (#13968)

* use wasThrottleRaised in place of isAirmodeActivated where airmode isn't really needed

* fix unit test

* fix typo

* remove unnecessary check

* final changes and clarificartions

* Update src/main/flight/mixer.c

Co-authored-by: Ivan Efimov <gendalf44@yandex.ru>

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
Co-authored-by: Ivan Efimov <gendalf44@yandex.ru>
This commit is contained in:
ctzsnooze 2024-10-17 19:46:54 +11:00 committed by GitHub
parent 58fc8bbbb8
commit fc52b6b4ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 42 additions and 37 deletions

View file

@ -1314,7 +1314,7 @@ extern "C" {
return false;
}
bool airmodeIsEnabled() {
bool isAirmodeEnabled() {
return false;
}

View file

@ -24,7 +24,7 @@
#include "gtest/gtest.h"
#include "build/debug.h"
bool simulatedAirmodeEnabled = true;
bool simulatedThrottleRaised = true;
float simulatedSetpointRate[3] = { 0,0,0 };
float simulatedPrevSetpointRate[3] = { 0,0,0 };
float simulatedRcDeflection[3] = { 0,0,0 };
@ -93,7 +93,7 @@ extern "C" {
float getMotorMixRange(void) { return simulatedMotorMixRange; }
float getSetpointRate(int axis) { return simulatedSetpointRate[axis]; }
bool isAirmodeActivated(void) { return simulatedAirmodeEnabled; }
bool wasThrottleRaised(void) { return simulatedThrottleRaised; }
float getRcDeflectionAbs(int axis) { return fabsf(simulatedRcDeflection[axis]); }
// used by auto-disarm code

View file

@ -420,7 +420,7 @@ extern "C" {
bool telemetryIsSensorEnabled(sensor_e) {return true; }
bool sensors(uint32_t ) { return true; }
bool airmodeIsEnabled(void) {return airMode; }
bool isAirmodeEnabled(void) {return airMode; }
bool isBatteryVoltageConfigured(void) { return true; }
bool isAmperageConfigured(void) { return true; }

View file

@ -292,7 +292,7 @@ extern "C" {
bool featureIsEnabled(uint32_t) {return false;}
bool airmodeIsEnabled(void) {return true;}
bool isAirmodeEnabled(void) {return true;}
mspDescriptor_t mspDescriptorAlloc(void) {return 0;}

View file

@ -343,7 +343,7 @@ bool telemetryIsSensorEnabled(sensor_e) {return true;}
portSharing_e determinePortSharing(const serialPortConfig_t *, serialPortFunction_e) {return PORTSHARING_NOT_SHARED;}
bool airmodeIsEnabled(void) {return airMode;}
bool isAirmodeEnabled(void) {return airMode;}
int32_t getAmperage(void)
{