mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Moving EXTI to new io
Updated i2c to use new io
This commit is contained in:
parent
7db5445bf7
commit
928609e2bb
32 changed files with 559 additions and 676 deletions
|
@ -55,48 +55,6 @@ void registerExtiCallbackHandler(IRQn_Type irqn, extiCallbackHandlerFunc *fn)
|
|||
failureMode(FAILURE_DEVELOPER); // EXTI_CALLBACK_HANDLER_COUNT is too low for the amount of handlers required.
|
||||
}
|
||||
|
||||
void unregisterExtiCallbackHandler(IRQn_Type irqn, extiCallbackHandlerFunc *fn)
|
||||
{
|
||||
for (int index = 0; index < EXTI_CALLBACK_HANDLER_COUNT; index++) {
|
||||
extiCallbackHandlerConfig_t *candidate = &extiHandlerConfigs[index];
|
||||
if (candidate->fn == fn && candidate->irqn == irqn) {
|
||||
candidate->fn = NULL;
|
||||
candidate->irqn = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void extiHandler(IRQn_Type irqn)
|
||||
{
|
||||
for (int index = 0; index < EXTI_CALLBACK_HANDLER_COUNT; index++) {
|
||||
extiCallbackHandlerConfig_t *candidate = &extiHandlerConfigs[index];
|
||||
if (candidate->fn && candidate->irqn == irqn) {
|
||||
candidate->fn();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void EXTI15_10_IRQHandler(void)
|
||||
{
|
||||
extiHandler(EXTI15_10_IRQn);
|
||||
}
|
||||
|
||||
#if defined(CC3D)
|
||||
void EXTI3_IRQHandler(void)
|
||||
{
|
||||
extiHandler(EXTI3_IRQn);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLIBRI_RACE) || defined(LUX_RACE)
|
||||
void EXTI9_5_IRQHandler(void)
|
||||
{
|
||||
extiHandler(EXTI9_5_IRQn);
|
||||
}
|
||||
#endif
|
||||
|
||||
// cycles per microsecond
|
||||
static uint32_t usTicks = 0;
|
||||
// current uptime for 1kHz systick timer. will rollover after 49 days. hopefully we won't care.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue