1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 08:15:30 +03:00

Merge pull request #10714 from mikeller/add_g474_mcu_id

Added MCU id / name for STM32G474.
This commit is contained in:
Michael Keller 2021-05-18 00:32:15 +12:00 committed by GitHub
commit acce1872fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View file

@ -76,6 +76,8 @@ mcuTypeId_e getMcuTypeId(void)
return MCU_TYPE_H7A3; return MCU_TYPE_H7A3;
#elif defined(STM32H723xx) || defined(STM32H725xx) #elif defined(STM32H723xx) || defined(STM32H725xx)
return MCU_TYPE_H723_725; return MCU_TYPE_H723_725;
#elif defined(STM32G474xx)
return MCU_TYPE_G474;
#else #else
return MCU_TYPE_UNKNOWN; return MCU_TYPE_UNKNOWN;
#endif #endif

View file

@ -59,6 +59,7 @@ typedef enum {
MCU_TYPE_H743_REV_V, MCU_TYPE_H743_REV_V,
MCU_TYPE_H7A3, MCU_TYPE_H7A3,
MCU_TYPE_H723_725, MCU_TYPE_H723_725,
MCU_TYPE_G474,
MCU_TYPE_UNKNOWN = 255, MCU_TYPE_UNKNOWN = 255,
} mcuTypeId_e; } mcuTypeId_e;

View file

@ -308,6 +308,7 @@ static const char *mcuTypeNames[] = {
"H743 (Rev.V)", "H743 (Rev.V)",
"H7A3", "H7A3",
"H723/H725", "H723/H725",
"G474",
}; };
static const char *configurationStates[] = { "UNCONFIGURED", "CUSTOM DEFAULTS", "CONFIGURED" }; static const char *configurationStates[] = { "UNCONFIGURED", "CUSTOM DEFAULTS", "CONFIGURED" };
@ -4664,7 +4665,7 @@ STATIC_UNIT_TESTED void cliSet(const char *cmdName, char *cmdline)
} }
} }
const char *getMcuTypeById(mcuTypeId_e id) static const char *getMcuTypeById(mcuTypeId_e id)
{ {
if (id < MCU_TYPE_UNKNOWN) { if (id < MCU_TYPE_UNKNOWN) {
return mcuTypeNames[id]; return mcuTypeNames[id];