增加CPUID

This commit is contained in:
Stone 2014-07-30 00:08:00 +00:00
parent 9b56a0240e
commit 23860ffa21
2 changed files with 2 additions and 1 deletions

View File

@ -227,7 +227,7 @@ TSys::TSys()
ID[1] = *(__IO uint *)(0X1FFFF7B0); // ID[1] = *(__IO uint *)(0X1FFFF7B0); //
ID[2] = *(__IO uint *)(0X1FFFF7AC); // 低字节 ID[2] = *(__IO uint *)(0X1FFFF7AC); // 低字节
#endif #endif
//MCUID = *(__IO uint *)(0xE0042000); // MCU编码。低字设备版本高字子版本 CPUID = SCB->CPUID; // MCU编码。低字设备版本高字子版本
MCUID = DBGMCU->IDCODE; // MCU编码。低字设备版本高字子版本 MCUID = DBGMCU->IDCODE; // MCU编码。低字设备版本高字子版本
FlashSize = *(__IO ushort *)(0x1FFFF7E0); // 容量 FlashSize = *(__IO ushort *)(0x1FFFF7E0); // 容量
IsGD = Get_JTAG_ID() == 0x7A3; IsGD = Get_JTAG_ID() == 0x7A3;

1
Sys.h
View File

@ -49,6 +49,7 @@ public:
byte MessagePort; // 消息口默认0表示USART1 byte MessagePort; // 消息口默认0表示USART1
uint ID[3]; // 芯片ID uint ID[3]; // 芯片ID
uint FlashSize; // 芯片Flash容量 uint FlashSize; // 芯片Flash容量
uint CPUID; // CPUID
uint MCUID; // MCU编码。低字设备版本高字子版本 uint MCUID; // MCU编码。低字设备版本高字子版本
bool IsGD; // 是否GD芯片 bool IsGD; // 是否GD芯片