1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00

Added options to allow further TPA configuration

Replaced define BREAKPOINT with cfg option
Added tpa and tpa_breakpoint to cli
This commit is contained in:
Johannes Kasberger 2014-04-07 22:52:32 +02:00
parent 4faa8d0043
commit 74a54d81dd
4 changed files with 6 additions and 4 deletions

View file

@ -80,8 +80,6 @@ void blinkLED(uint8_t num, uint8_t wait, uint8_t repeat)
}
}
#define BREAKPOINT 1500
void annexCode(void)
{
static uint32_t calibratedAccTime;
@ -98,11 +96,11 @@ void annexCode(void)
int i;
// PITCH & ROLL only dynamic PID adjustemnt, depending on throttle value
if (rcData[THROTTLE] < BREAKPOINT) {
if (rcData[THROTTLE] < cfg.tpaBreakPoint) {
prop2 = 100;
} else {
if (rcData[THROTTLE] < 2000) {
prop2 = 100 - (uint16_t) cfg.dynThrPID * (rcData[THROTTLE] - BREAKPOINT) / (2000 - BREAKPOINT);
prop2 = 100 - (uint16_t) cfg.dynThrPID * (rcData[THROTTLE] - cfg.tpaBreakPoint) / (2000 - cfg.tpaBreakPoint);
} else {
prop2 = 100 - cfg.dynThrPID;
}