1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 00:05:33 +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) {
if (debugMode == DEBUG_CYCLETIME) {
static uint32_t previousMotorUpdateTime;
uint32_t currentDeltaTime = getTaskDeltaTime(TASK_SELF);
uint32_t currentDeltaTime = micros() - previousMotorUpdateTime;
debug[2] = currentDeltaTime;
debug[3] = currentDeltaTime - previousMotorUpdateTime;
previousMotorUpdateTime = currentDeltaTime;
debug[3] = currentDeltaTime - targetPidLooptime;
previousMotorUpdateTime = micros();
}
#ifdef USE_SERVOS