Create release.yml
[betaflight.git] / src / main / target / SPRACINGF7DUAL / config.c
blob53654f1f840260cbf5c615b34539792dfe5e7cdc
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 <stdbool.h>
22 #include <stdint.h>
24 #include "platform.h"
26 #include "common/axis.h"
28 #include "drivers/sensor.h"
29 #include "drivers/compass/compass.h"
30 #include "drivers/serial.h"
32 #include "fc/rc_controls.h"
34 #include "flight/failsafe.h"
35 #include "flight/mixer.h"
36 #include "flight/pid.h"
38 #include "pg/rx.h"
40 #include "rx/rx.h"
42 #include "io/serial.h"
44 #include "telemetry/telemetry.h"
46 #include "sensors/sensors.h"
47 #include "sensors/compass.h"
48 #include "sensors/barometer.h"
50 #include "config/feature.h"
52 #include "config/config.h"
54 #ifdef USE_TARGET_CONFIG
56 #include "config_helper.h"
58 #define GPS_UART SERIAL_PORT_USART3
59 #define TELEMETRY_UART SERIAL_PORT_UART5
61 static targetSerialPortFunction_t targetSerialPortFunction[] = {
62 #ifdef USE_GPS
63 { GPS_UART, FUNCTION_GPS },
64 #endif
65 #ifdef USE_TELEMETRY
66 { TELEMETRY_UART, FUNCTION_TELEMETRY_SMARTPORT },
67 #endif
68 #if !defined(USE_GPS) && !defined(USE_TELEMETRY)
69 { SERIAL_PORT_NONE, FUNCTION_NONE },
70 #endif
73 void targetConfiguration(void)
75 barometerConfigMutable()->baro_hardware = BARO_DEFAULT;
77 #ifdef USE_TELEMETRY
78 targetSerialPortFunctionConfig(targetSerialPortFunction, ARRAYLEN(targetSerialPortFunction));
79 // change telemetry settings
80 telemetryConfigMutable()->telemetry_inverted = 1;
81 telemetryConfigMutable()->halfDuplex = 1;
82 #endif
84 #endif