mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 21:35:44 +03:00
Moved target specific code out of initialisation.c
This commit is contained in:
parent
e39ff27b95
commit
251b3d7e3c
6 changed files with 59 additions and 41 deletions
|
@ -90,45 +90,10 @@ const extiConfig_t *selectMPUIntExtiConfig(void)
|
|||
return &mpuIntExtiConfig;
|
||||
#endif
|
||||
|
||||
#ifdef NAZE
|
||||
// MPU_INT output on rev4 PB13
|
||||
static const extiConfig_t nazeRev4MPUIntExtiConfig = {
|
||||
.io = IO_TAG(PB13)
|
||||
};
|
||||
// MPU_INT output on rev5 hardware PC13
|
||||
static const extiConfig_t nazeRev5MPUIntExtiConfig = {
|
||||
.io = IO_TAG(PC13)
|
||||
};
|
||||
|
||||
#ifdef AFROMINI
|
||||
return &nazeRev5MPUIntExtiConfig;
|
||||
#else
|
||||
if (hardwareRevision < NAZE32_REV5) {
|
||||
return &nazeRev4MPUIntExtiConfig;
|
||||
}
|
||||
else {
|
||||
return &nazeRev5MPUIntExtiConfig;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef ALIENFLIGHTF3
|
||||
// MPU_INT output on V1 PA15
|
||||
static const extiConfig_t alienFlightF3V1MPUIntExtiConfig = {
|
||||
.io = IO_TAG(PA15)
|
||||
};
|
||||
// MPU_INT output on V2 PB13
|
||||
static const extiConfig_t alienFlightF3V2MPUIntExtiConfig = {
|
||||
.io = IO_TAG(PB13)
|
||||
};
|
||||
if (hardwareRevision == AFF3_REV_1) {
|
||||
return &alienFlightF3V1MPUIntExtiConfig;
|
||||
}
|
||||
else {
|
||||
return &alienFlightF3V2MPUIntExtiConfig;
|
||||
}
|
||||
#endif
|
||||
return NULL;
|
||||
#ifdef USE_HARDWARE_REVISION_DETECTION
|
||||
return selectMPUIntExtiConfigByHardwareRevision();
|
||||
#else
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef USE_FAKE_GYRO
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue