diff --git a/src/main/flight/mixer.c b/src/main/flight/mixer.c index 9ffd32f71a..7561250aa0 100755 --- a/src/main/flight/mixer.c +++ b/src/main/flight/mixer.c @@ -44,11 +44,15 @@ #include "lowpass_table.h" + #define GIMBAL_SERVO_PITCH 0 #define GIMBAL_SERVO_ROLL 1 #define AUX_FORWARD_CHANNEL_TO_SERVO_COUNT 4 +#include "drivers/system.h" +extern int16_t debug[4]; + static uint8_t motorCount = 0; int16_t motor[MAX_SUPPORTED_MOTORS]; int16_t motor_disarmed[MAX_SUPPORTED_MOTORS]; @@ -708,6 +712,8 @@ void filterServos(void) { int16_t servoIdx; + uint32_t startTime = micros(); + if (mixerConfig->servo_lowpass_enable) { for (servoIdx = 0; servoIdx < MAX_SUPPORTED_SERVOS; servoIdx++) { // Round to nearest @@ -716,5 +722,7 @@ void filterServos(void) servo[servoIdx] = constrain(servo[servoIdx], servoConf[servoIdx].min, servoConf[servoIdx].max); } } + + debug[0] = (int16_t)(micros() - startTime); }