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

Fix debug calculation in motor cycletime

This commit is contained in:
borisbstyle 2016-03-02 14:54:44 +01:00
parent 7529db2b5e
commit a058bb3843

View file

@ -730,10 +730,10 @@ void subTasksMainPidLoop(void) {
void taskMotorUpdate(void) { void taskMotorUpdate(void) {
if (debugMode == DEBUG_CYCLETIME) { if (debugMode == DEBUG_CYCLETIME) {
static uint32_t previousMotorUpdateTime; static uint32_t previousMotorUpdateTime;
uint32_t currentDeltaTime = getTaskDeltaTime(TASK_SELF); uint32_t currentDeltaTime = micros() - previousMotorUpdateTime;
debug[2] = currentDeltaTime; debug[2] = currentDeltaTime;
debug[3] = currentDeltaTime - previousMotorUpdateTime; debug[3] = currentDeltaTime - targetPidLooptime;
previousMotorUpdateTime = currentDeltaTime; previousMotorUpdateTime = micros();
} }
#ifdef USE_SERVOS #ifdef USE_SERVOS