1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

hack for cc3d interrupt

This commit is contained in:
henn1001 2015-10-07 21:17:12 +02:00
parent 3f10c0c184
commit dbcfa5dc43
3 changed files with 43 additions and 1 deletions

View file

@ -218,6 +218,33 @@ void MPU_DATA_READY_EXTI_Handler(void)
#endif
}
//// Hack for cc3d
void EXTI3_IRQHandler(void)
{
if (EXTI_GetITStatus(mpuIntExtiConfig->exti_line) == RESET) {
return;
}
EXTI_ClearITPendingBit(mpuIntExtiConfig->exti_line);
mpuDataReady = true;
#ifdef DEBUG_MPU_DATA_READY_INTERRUPT
// Measure the delta in micro seconds between calls to the interrupt handler
static uint32_t lastCalledAt = 0;
static int32_t callDelta = 0;
uint32_t now = micros();
callDelta = now - lastCalledAt;
//UNUSED(callDelta);
debug[0] = callDelta;
lastCalledAt = now;
#endif
}
//// Hack for cc3d
void configureMPUDataReadyInterruptHandling(void)
{
#ifdef USE_MPU_DATA_READY_SIGNAL
@ -247,7 +274,9 @@ void configureMPUDataReadyInterruptHandling(void)
}
#endif
#ifndef CC3D
registerExti15_10_CallbackHandler(MPU_DATA_READY_EXTI_Handler);
#endif
EXTI_ClearITPendingBit(mpuIntExtiConfig->exti_line);