Merge pull request #11299 from daleckystepan/vtx-start-bit
[betaflight.git] / src / main / build / build_config.c
blobe3c6fb7345d83f03ddca121afa9c92c38c2f0189
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 "build_config.h"
28 #ifdef STM32F1
29 #warning STM32F1 based targets are unsupported as of Betaflight 3.3.
30 #endif
32 #ifdef STM32F3
33 #warning STM32F3 based targets are unsupported as of Betaflight 4.1.
34 #endif
36 #ifdef USE_CLI_DEBUG_PRINT
37 #warning Do not use USE_CLI_DEBUG_PRINT for production builds.
38 #endif
40 mcuTypeId_e getMcuTypeId(void)
42 #if defined(SIMULATOR_BUILD)
43 return MCU_TYPE_SIMULATOR;
44 #elif defined(STM32F1)
45 return MCU_TYPE_F103;
46 #elif defined(STM32F3)
47 return MCU_TYPE_F303;
48 #elif defined(STM32F40_41xxx)
49 return MCU_TYPE_F40X;
50 #elif defined(STM32F411xE)
51 return MCU_TYPE_F411;
52 #elif defined(STM32F446xx)
53 return MCU_TYPE_F446;
54 #elif defined(STM32F722xx)
55 return MCU_TYPE_F722;
56 #elif defined(STM32F745xx)
57 return MCU_TYPE_F745;
58 #elif defined(STM32F746xx)
59 return MCU_TYPE_F746;
60 #elif defined(STM32F765xx)
61 return MCU_TYPE_F765;
62 #elif defined(STM32H750xx)
63 return MCU_TYPE_H750;
64 #elif defined(STM32H730xx)
65 return MCU_TYPE_H730;
66 #elif defined(STM32H743xx)
67 switch (HAL_GetREVID()) {
68 case REV_ID_Y:
69 return MCU_TYPE_H743_REV_Y;
70 case REV_ID_X:
71 return MCU_TYPE_H743_REV_X;
72 case REV_ID_V:
73 return MCU_TYPE_H743_REV_V;
74 default:
75 return MCU_TYPE_H743_REV_UNKNOWN;
77 #elif defined(STM32H7A3xx) || defined(STM32H7A3xxQ)
78 return MCU_TYPE_H7A3;
79 #elif defined(STM32H723xx) || defined(STM32H725xx)
80 return MCU_TYPE_H723_725;
81 #elif defined(STM32G474xx)
82 return MCU_TYPE_G474;
83 #else
84 return MCU_TYPE_UNKNOWN;
85 #endif