mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 16:25:26 +03:00
Add battery profiles feature
This commit is contained in:
parent
99f7b1daf2
commit
ce8621ee8f
26 changed files with 578 additions and 176 deletions
|
@ -232,7 +232,6 @@ void processRcStickPositions(throttleStatus_e throttleStatus)
|
|||
}
|
||||
|
||||
// actions during not armed
|
||||
int i = 0;
|
||||
|
||||
// GYRO calibration
|
||||
if (rcSticks == THR_LO + YAW_LO + PIT_LO + ROL_CE) {
|
||||
|
@ -257,16 +256,38 @@ void processRcStickPositions(throttleStatus_e throttleStatus)
|
|||
|
||||
// Multiple configuration profiles
|
||||
if (feature(FEATURE_TX_PROF_SEL)) {
|
||||
|
||||
uint8_t i = 0;
|
||||
|
||||
if (rcSticks == THR_LO + YAW_LO + PIT_CE + ROL_LO) // ROLL left -> Profile 1
|
||||
i = 1;
|
||||
else if (rcSticks == THR_LO + YAW_LO + PIT_HI + ROL_CE) // PITCH up -> Profile 2
|
||||
i = 2;
|
||||
else if (rcSticks == THR_LO + YAW_LO + PIT_CE + ROL_HI) // ROLL right -> Profile 3
|
||||
i = 3;
|
||||
|
||||
if (i) {
|
||||
setConfigProfileAndWriteEEPROM(i - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
|
||||
// Multiple battery configuration profiles
|
||||
if (rcSticks == THR_HI + YAW_LO + PIT_CE + ROL_LO) // ROLL left -> Profile 1
|
||||
i = 1;
|
||||
else if (rcSticks == THR_HI + YAW_LO + PIT_HI + ROL_CE) // PITCH up -> Profile 2
|
||||
i = 2;
|
||||
else if (rcSticks == THR_HI + YAW_LO + PIT_CE + ROL_HI) // ROLL right -> Profile 3
|
||||
i = 3;
|
||||
|
||||
if (i) {
|
||||
setConfigBatteryProfileAndWriteEEPROM(i - 1);
|
||||
batteryDisableProfileAutoswitch();
|
||||
activateBatteryProfile();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Save config
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue