Sys不要引用复杂类

This commit is contained in:
Stone 2016-06-14 13:05:27 +00:00
parent 99feb00538
commit e9ca9b3370
6 changed files with 10 additions and 24 deletions

View File

@ -33,14 +33,13 @@ TSys::TSys()
{ {
OnInit(); OnInit();
OnSleep = nullptr; OnSleep = nullptr;
Code = 0x0000; Code = 0x0000;
Ver = 0x0300; Ver = 0x0300;
#ifndef TINY #ifndef TINY
Name = "SmartOS"; Name = "SmartOS";
Company = "NewLife_Embedded_Team"; Company = "NewLife_Embedded_Team";
//BuildTime = "yyyy-MM-dd HH:mm:ss";
Interrupt.Init(); Interrupt.Init();
#endif #endif
@ -69,9 +68,10 @@ void TSys::ShowInfo() const
{ {
#if DEBUG #if DEBUG
//byte* ver = (byte*)&Version; //byte* ver = (byte*)&Version;
debug_printf("%s::%s Code:%04X ", Company.GetBuffer(), Name.GetBuffer(), Code); debug_printf("%s::%s Code:%04X ", Company, Name, Code);
//debug_printf("Ver:%x.%x Build:%s\r\n", *ver++, *ver++, BuildTime); //debug_printf("Ver:%x.%x Build:%s\r\n", *ver++, *ver++, BuildTime);
debug_printf("Ver:%s Build:%s\r\n", Ver.ToString().GetBuffer(), Ver.Compile().ToString().GetBuffer()); Version v(0, 0, Ver, 0);
debug_printf("Ver:%s Build:%s\r\n", v.ToString().GetBuffer(), v.Compile().ToString().GetBuffer());
OnShowInfo(); OnShowInfo();

View File

@ -77,10 +77,10 @@ public:
uint Clock; // 系统时钟 uint Clock; // 系统时钟
uint CystalClock;// 晶振时钟 uint CystalClock;// 晶振时钟
String Name; // 系统名称 cstring Name; // 系统名称
String Company; // 系统厂商 cstring Company; // 系统厂商
ushort Code; // 产品代码 ushort Code; // 产品代码
Version Ver; // 系统版本 ushort Ver; // 系统版本
byte ID[12]; // 芯片ID。 byte ID[12]; // 芯片ID。
ushort DevID; // MCU编码。低字设备版本高字子版本 ushort DevID; // MCU编码。低字设备版本高字子版本
ushort RevID; // MCU编码。低字设备版本高字子版本 ushort RevID; // MCU编码。低字设备版本高字子版本

View File

@ -169,25 +169,11 @@ void TSys::OnInit()
InitHeapStack(StackTop()); InitHeapStack(StackTop());
#endif #endif
OnSleep = nullptr;
#ifdef STM32F1 #ifdef STM32F1
// 关闭JTAG仿真接口只打开SW仿真。 // 关闭JTAG仿真接口只打开SW仿真。
RCC->APB2ENR |= RCC_APB2ENR_AFIOEN; // 打开时钟 RCC->APB2ENR |= RCC_APB2ENR_AFIOEN; // 打开时钟
AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; //关闭JTAG仿真接口只打开SW仿真。 AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; //关闭JTAG仿真接口只打开SW仿真。
#endif #endif
Code = 0x0000;
Ver = 0x0300;
#ifndef TINY
Name = "SmartOS";
Company = "NewLife_Embedded_Team";
//BuildTime = "yyyy-MM-dd HH:mm:ss";
Interrupt.Init();
#endif
Started = false;
} }
#pragma arm section code #pragma arm section code

View File

@ -59,7 +59,7 @@ void TinyClient::Open()
} }
HardCrc = Crc::Hash16(Buffer(Sys.ID, 16)); HardCrc = Crc::Hash16(Buffer(Sys.ID, 16));
if(Sys.Ver.Major > 1) Encryption = true; if(Sys.Ver > 1) Encryption = true;
Control->Mode = 0; // 客户端只接收自己的消息 Control->Mode = 0; // 客户端只接收自己的消息
Control->Open(); Control->Open();

View File

@ -10,7 +10,7 @@
// 初始化消息各字段为0 // 初始化消息各字段为0
HelloMessage::HelloMessage() : Cipher(1), Key(0) HelloMessage::HelloMessage() : Cipher(1), Key(0)
{ {
Version = Sys.Ver.Major; Version = Sys.Ver;
ushort code = _REV16(Sys.Code); ushort code = _REV16(Sys.Code);
Type = Buffer(&code, 2).ToHex(); Type = Buffer(&code, 2).ToHex();

View File

@ -19,7 +19,7 @@ void TokenConfig::Init()
Length = Size(); Length = Size();
ServerIP = 0; ServerIP = 0;
SoftVer = Sys.Ver.Major; SoftVer = Sys.Ver;
PingTime = 10; PingTime = 10;
//User[16] = '\0'; //User[16] = '\0';
//Key[15] = '\0'; //Key[15] = '\0';