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)
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/>.
26 #include "build_config.h"
29 #warning STM32F1 based targets are unsupported as of Betaflight 3.3.
33 #warning STM32F3 based targets are unsupported as of Betaflight 4.1.
36 #ifdef USE_CLI_DEBUG_PRINT
37 #warning Do not use USE_CLI_DEBUG_PRINT for production builds.
40 mcuTypeId_e
getMcuTypeId(void)
42 #if defined(SIMULATOR_BUILD)
43 return MCU_TYPE_SIMULATOR
;
44 #elif defined(STM32F1)
46 #elif defined(STM32F3)
48 #elif defined(STM32F40_41xxx)
50 #elif defined(STM32F411xE)
52 #elif defined(STM32F446xx)
54 #elif defined(STM32F722xx)
56 #elif defined(STM32F745xx)
58 #elif defined(STM32F746xx)
60 #elif defined(STM32F765xx)
62 #elif defined(STM32H750xx)
64 #elif defined(STM32H730xx)
66 #elif defined(STM32H743xx)
67 switch (HAL_GetREVID()) {
69 return MCU_TYPE_H743_REV_Y
;
71 return MCU_TYPE_H743_REV_X
;
73 return MCU_TYPE_H743_REV_V
;
75 return MCU_TYPE_H743_REV_UNKNOWN
;
77 #elif defined(STM32H7A3xx) || defined(STM32H7A3xxQ)
79 #elif defined(STM32H723xx) || defined(STM32H725xx)
80 return MCU_TYPE_H723_725
;
81 #elif defined(STM32G474xx)
84 return MCU_TYPE_UNKNOWN
;