2 * This file is part of INAV Project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
6 * You can obtain one at http://mozilla.org/MPL/2.0/.
8 * Alternatively, the contents of this file may be used under the terms
9 * of the GNU General Public License Version 3, as described below:
11 * This file is free software: you may copy, redistribute and/or modify
12 * it under the terms of the GNU General Public License as published by the
13 * Free Software Foundation, either version 3 of the License, or (at your
14 * option) any later version.
16 * This file is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19 * Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see http://www.gnu.org/licenses/.
30 #include <sys/socket.h>
34 #define TARGET_BOARD_IDENTIFIER "SITL"
35 #define USBD_PRODUCT_STRING "SITL"
37 #define REQUIRE_PRINTF_LONG_SUPPORT
39 // file name to save config
40 #define EEPROM_FILENAME "eeprom.bin"
41 #define CONFIG_IN_FILE
42 #define EEPROM_SIZE 32768
44 #undef SCHEDULER_DELAY_LIMIT
45 #define SCHEDULER_DELAY_LIMIT 1
56 #define SERIAL_PORT_COUNT 8
57 #define SITL_SERIAL_TASK_US (500)
59 #define DEFAULT_RX_FEATURE FEATURE_RX_MSP
60 #define DEFAULT_FEATURES (FEATURE_GPS | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT)
65 #define USE_PITOT_FAKE
70 #define USE_RANGEFINDER_FAKE
72 #undef MAX_MIXER_PROFILE_COUNT
73 #define MAX_MIXER_PROFILE_COUNT 2
77 #define USE_SERIAL_GIMBAL
78 #define USE_HEADTRACKER
79 #define USE_HEADTRACKER_SERIAL
80 #define USE_HEADTRACKER_MSP
84 #define MAX_GEOZONES_IN_CONFIG 63
85 #define MAX_VERTICES_IN_CONFIG 126
87 #undef USE_GYRO_KALMAN // Strange behaviour under x86/x64 ?!?
92 #undef USE_MSP_OVER_TELEMETRY
93 #undef USE_TELEMETRY_FRSKY_HUB
94 #undef USE_TELEMETRY_HOTT
95 #undef USE_TELEMETRY_SMARTPORT
96 #undef USE_RESOURCE_MGMT
97 #undef USE_TELEMETRY_CRSF
98 #undef USE_TELEMETRY_IBUS
99 #undef USE_TELEMETRY_JETIEXBUS
100 #undef USE_TELEMETRY_SRXL
101 #undef USE_TELEMETRY_GHST
103 #undef USE_CAMERA_CONTROL
104 #undef USE_BRUSHED_ESC_AUTODETECT
105 #undef USE_SERIAL_4WAY_BLHELI_BOOTLOADER
106 #undef USE_SERIAL_4WAY_SK_BOOTLOADER
107 #undef USE_ADAPTIVE_FILTER
113 #define TARGET_FLASH_SIZE 2048
115 #define LED_STRIP_TIMER 1
116 #define SOFTSERIAL_1_TIMER 2
117 #define SOFTSERIAL_2_TIMER 3
119 #define DEFIO_NO_PORTS
121 extern uint32_t SystemCoreClock
;
143 } DMA_Channel_TypeDef
;
155 typedef enum {RESET
= 0, SET
= !RESET
} FlagStatus
, ITStatus
;
156 typedef enum {DISABLE
= 0, ENABLE
= !DISABLE
} FunctionalState
;
157 typedef enum {TEST_IRQ
= 0 } IRQn_Type
;
159 EXTI_Trigger_Rising
= 0x08,
160 EXTI_Trigger_Falling
= 0x0C,
161 EXTI_Trigger_Rising_Falling
= 0x10
162 } EXTITrigger_TypeDef
;
172 #define GPIOA_BASE ((intptr_t)0x0001)
179 #define USART1 ((USART_TypeDef *)0x0001)
180 #define USART2 ((USART_TypeDef *)0x0002)
181 #define USART3 ((USART_TypeDef *)0x0003)
182 #define USART4 ((USART_TypeDef *)0x0004)
183 #define USART5 ((USART_TypeDef *)0x0005)
184 #define USART6 ((USART_TypeDef *)0x0006)
185 #define USART7 ((USART_TypeDef *)0x0007)
186 #define USART8 ((USART_TypeDef *)0x0008)
188 #define UART4 ((USART_TypeDef *)0x0004)
189 #define UART5 ((USART_TypeDef *)0x0005)
190 #define UART7 ((USART_TypeDef *)0x0007)
191 #define UART8 ((USART_TypeDef *)0x0008)
202 extern bool lockMainPID(void);
203 extern void unlockMainPID(void);
204 extern void parseArguments(int argc
, char *argv
[]);
205 extern char *strnstr(const char *s
, const char *find
, size_t slen
);
206 extern int lookupAddress (char *, int, int, struct sockaddr
*, socklen_t
*);
208 #define IPADDRESS_PRINT_BUFLEN (INET6_ADDRSTRLEN + 16)
209 extern char *prettyPrintAddress(struct sockaddr
*, char*, size_t);