Merge pull request #11189 from klutvott123/move-telemetry-displayport-init
[betaflight.git] / src / main / target / BLUEJAYF4 / config.c
blob3d3b8283d01f52d8126aff8c5c127dbe151ece73
1 /*
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)
8 * any later version.
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/>.
21 #include <stdint.h>
22 #include <stdbool.h>
24 #include "platform.h"
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"
37 #include "pg/adc.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;
72 #endif