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

Further 2khz Stability Enhancements

This commit is contained in:
borisbstyle 2015-12-24 02:35:01 +01:00
parent a3fe45d774
commit 6d679b72e1
5 changed files with 38 additions and 23 deletions

View file

@ -91,7 +91,7 @@ enum {
ALIGN_MAG = 2
};
#define JITTER_DEBUG 0 // Specify debug value for jitter debug
//#define JITTER_DEBUG 0 // Specify debug value for jitter debug
/* VBAT monitoring interval (in microseconds) - 1s*/
#define VBATINTERVAL (6 * 3500)
@ -644,17 +644,6 @@ void processRx(void)
static bool haveProcessedAnnexCodeOnce = false;
#endif
// Function for loop trigger
bool taskMainPidLoopCheck(uint32_t currentDeltaTime) {
bool loopTrigger = false;
if (gyroSyncCheckUpdate() || (currentDeltaTime >= (targetLooptime + GYRO_WATCHDOG_DELAY))) {
loopTrigger = true;
}
return loopTrigger;
}
void taskMainPidLoop(void)
{
cycleTime = getTaskDeltaTime(TASK_SELF);
@ -748,6 +737,16 @@ void taskMainPidLoop(void)
#endif
}
// Function for loop trigger
void taskMainPidLoopCheck(void) {
while (1) {
if (gyroSyncCheckUpdate() || (getTaskDeltaTime(TASK_SELF) >= (targetLooptime + GYRO_WATCHDOG_DELAY))) {
taskMainPidLoop();
break;
}
}
}
void taskUpdateAccelerometer(void)
{
imuUpdateAccelerometer(&currentProfile->accelerometerTrims);