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 "blackbox/blackbox.h"
30 #include "config/feature.h"
32 #include "drivers/adc.h"
33 #include "drivers/io.h"
35 #include "sensors/gyro.h"
38 #include "pg/beeper_dev.h"
39 #include "pg/gyrodev.h"
41 #include "hardware_revision.h"
43 // BEEPER_OPT will be handled by post-flash configuration
44 #define BEEPER_OPT PB7
46 // alternative defaults settings for BlueJayF4 targets
47 void targetConfiguration(void)
49 if (hardwareRevision
== BJF4_REV1
|| hardwareRevision
== BJF4_REV2
) {
50 gyroDeviceConfigMutable(0)->alignment
= CW180_DEG
;
51 beeperDevConfigMutable()->ioTag
= IO_TAG(BEEPER_OPT
);
54 if (hardwareRevision
== BJF4_MINI_REV3A
|| hardwareRevision
== BJF4_REV1
) {
55 blackboxConfigMutable()->device
= BLACKBOX_DEVICE_NONE
;
58 if (hardwareRevision
== BJF4_MINI_REV3A
) {
59 adcConfigMutable()->vbat
.ioTag
= IO_TAG(PA4
);
63 void targetValidateConfiguration(void)
65 /* make sure the SDCARD cannot be turned on */
66 if (hardwareRevision
== BJF4_MINI_REV3A
|| hardwareRevision
== BJF4_REV1
) {
67 if (blackboxConfig()->device
== BLACKBOX_DEVICE_SDCARD
) {
68 blackboxConfigMutable()->device
= BLACKBOX_DEVICE_NONE
;