2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
26 #ifdef USE_TARGET_CONFIG
28 #include "common/axis.h"
29 #include "common/utils.h"
31 #include "drivers/io.h"
33 #include "config/config.h"
34 #include "fc/rc_controls.h"
35 #include "fc/controlrate_profile.h"
37 #include "flight/failsafe.h"
38 #include "flight/pid.h"
44 #include "sensors/acceleration.h"
45 #include "sensors/compass.h"
46 #include "sensors/gyro.h"
48 #include "pg/beeper_dev.h"
52 #include "hardware_revision.h"
54 void targetConfiguration(void)
56 if (hardwareRevision
>= NAZE32_REV5
) {
57 // naze rev4 and below used opendrain to PNP for buzzer. Rev5 and above use PP to NPN.
58 beeperDevConfigMutable()->isOpenDrain
= false;
59 beeperDevConfigMutable()->isInverted
= true;
61 beeperDevConfigMutable()->isOpenDrain
= true;
62 beeperDevConfigMutable()->isInverted
= false;
63 flashConfigMutable()->csTag
= IO_TAG_NONE
;
67 if (hardwareRevision
< NAZE32_REV5
) {
68 compassConfigMutable()->interruptTag
= IO_TAG(PB12
);
73 void targetValidateConfiguration(void)
75 if (hardwareRevision
< NAZE32_REV5
&& accelerometerConfig()->acc_hardware
== ACC_ADXL345
) {
76 accelerometerConfigMutable()->acc_hardware
= ACC_NONE
;