Skip to content

Commit 3e91ccd

Browse files
committed
export cortex-m cpu type when export keil project file
1 parent d90ceec commit 3e91ccd

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/KeilXmlParser.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,28 @@ class ARMParser extends KeilParser<KeilARMOption> {
11831183
if (family.vendor) {
11841184
vendor = family.vendor.replace(/:.+$/i, '');
11851185
}
1186+
} else {
1187+
const buildOpts = prj.GetConfiguration<ArmBaseCompileData>().config;
1188+
const cpuname = buildOpts.compileConfig.cpuType.toLowerCase();
1189+
const valMap = [
1190+
['Cortex-M35P.Dsp', 'ARMCM35P_DSP_FP'],
1191+
['Cortex-M33.Dsp', 'ARMCM33_DSP_FP'],
1192+
['Cortex-M35P', 'ARMCM35P'],
1193+
['Cortex-M33', 'ARMCM33'],
1194+
['Cortex-M23', 'ARMCM23'],
1195+
['Cortex-M0+', 'ARMCM0P'],
1196+
['Cortex-M0', 'ARMCM0'],
1197+
['Cortex-M3', 'ARMCM3'],
1198+
['Cortex-M4', 'ARMCM4'],
1199+
['Cortex-M7', 'ARMCM7'],
1200+
];
1201+
for (const kv of valMap) {
1202+
if (cpuname.includes(kv[0].toLowerCase())) {
1203+
devName = kv[1];
1204+
vendor = 'ARM';
1205+
break;
1206+
}
1207+
}
11861208
}
11871209

11881210
target.TargetName = prjConfig.config.name;

0 commit comments

Comments
 (0)