[FLYWOOF411] add board documentation
[inav/snaewe.git] / src / main / target / common_post.h
blob32b6e3531a8f9a69ad6c2ab2fe866f54d468a5b1
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 // Touch up configuration
20 #pragma once
22 // Backward compatibility for I2C OLED display
23 #if !defined(USE_I2C)
24 # undef USE_DASHBOARD
25 # undef USE_OLED_UG2864
26 #endif
28 // Enable MSP_DISPLAYPORT for F3 targets without builtin OSD,
29 // since it's used to display CMS on MWOSD
30 #if !defined(USE_MSP_DISPLAYPORT) && (FLASH_SIZE > 128) && !defined(USE_OSD)
31 #define USE_MSP_DISPLAYPORT
32 #endif
34 #if defined(USE_OSD) && (FLASH_SIZE > 256)
35 #define USE_CANVAS
36 #endif
38 #ifdef USE_ESC_SENSOR
39 #define USE_RPM_FILTER
40 #endif
42 #ifdef USE_ITCM_RAM
43 #define FAST_CODE __attribute__((section(".tcm_code")))
44 #define NOINLINE __NOINLINE
45 #else
46 #define FAST_CODE
47 #define NOINLINE
48 #endif
50 #ifdef STM32F3
51 #undef USE_WIND_ESTIMATOR
52 #undef USE_SERIALRX_SUMD
53 #undef USE_SERIALRX_SUMH
54 #undef USE_SERIALRX_XBUS
55 #undef USE_SERIALRX_JETIEXBUS
56 #undef USE_PWM_SERVO_DRIVER
57 #endif
59 #if defined(SIMULATOR_BUILD) || defined(UNIT_TEST)
60 // This feature uses 'arm_math.h', which does not exist for x86.
61 #undef USE_DYNAMIC_FILTERS
62 #endif
64 //Defines for compiler optimizations
65 #ifndef STM32F3
66 #define FUNCTION_COMPILE_FOR_SIZE __attribute__((optimize("-Os")))
67 #define FUNCTION_COMPILE_NORMAL __attribute__((optimize("-O2")))
68 #define FUNCTION_COMPILE_FOR_SPEED __attribute__((optimize("-Ofast")))
69 #define FILE_COMPILE_FOR_SIZE _Pragma("GCC optimize(\"Os\")")
70 #define FILE_COMPILE_NORMAL _Pragma("GCC optimize(\"O2\")")
71 #define FILE_COMPILE_FOR_SPEED _Pragma("GCC optimize(\"Ofast\")")
72 #else
73 #define FUNCTION_COMPILE_FOR_SIZE
74 #define FUNCTION_COMPILE_NORMAL
75 #define FUNCTION_COMPILE_FOR_SPEED
76 #define FILE_COMPILE_FOR_SIZE
77 #define FILE_COMPILE_NORMAL
78 #define FILE_COMPILE_FOR_SPEED
79 #endif