Sys不要引用复杂类
This commit is contained in:
parent
99feb00538
commit
e9ca9b3370
|
@ -33,14 +33,13 @@ TSys::TSys()
|
|||
{
|
||||
OnInit();
|
||||
|
||||
OnSleep = nullptr;
|
||||
OnSleep = nullptr;
|
||||
|
||||
Code = 0x0000;
|
||||
Ver = 0x0300;
|
||||
#ifndef TINY
|
||||
Name = "SmartOS";
|
||||
Company = "NewLife_Embedded_Team";
|
||||
//BuildTime = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
Interrupt.Init();
|
||||
#endif
|
||||
|
@ -69,9 +68,10 @@ void TSys::ShowInfo() const
|
|||
{
|
||||
#if DEBUG
|
||||
//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:%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();
|
||||
|
||||
|
|
|
@ -77,10 +77,10 @@ public:
|
|||
uint Clock; // 系统时钟
|
||||
uint CystalClock;// 晶振时钟
|
||||
|
||||
String Name; // 系统名称
|
||||
String Company; // 系统厂商
|
||||
cstring Name; // 系统名称
|
||||
cstring Company; // 系统厂商
|
||||
ushort Code; // 产品代码
|
||||
Version Ver; // 系统版本
|
||||
ushort Ver; // 系统版本
|
||||
byte ID[12]; // 芯片ID。
|
||||
ushort DevID; // MCU编码。低字设备版本,高字子版本
|
||||
ushort RevID; // MCU编码。低字设备版本,高字子版本
|
||||
|
|
|
@ -169,25 +169,11 @@ void TSys::OnInit()
|
|||
InitHeapStack(StackTop());
|
||||
#endif
|
||||
|
||||
OnSleep = nullptr;
|
||||
|
||||
#ifdef STM32F1
|
||||
// 关闭JTAG仿真接口,只打开SW仿真。
|
||||
RCC->APB2ENR |= RCC_APB2ENR_AFIOEN; // 打开时钟
|
||||
AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; //关闭JTAG仿真接口,只打开SW仿真。
|
||||
#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
|
||||
|
|
|
@ -59,7 +59,7 @@ void TinyClient::Open()
|
|||
}
|
||||
|
||||
HardCrc = Crc::Hash16(Buffer(Sys.ID, 16));
|
||||
if(Sys.Ver.Major > 1) Encryption = true;
|
||||
if(Sys.Ver > 1) Encryption = true;
|
||||
|
||||
Control->Mode = 0; // 客户端只接收自己的消息
|
||||
Control->Open();
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// 初始化消息,各字段为0
|
||||
HelloMessage::HelloMessage() : Cipher(1), Key(0)
|
||||
{
|
||||
Version = Sys.Ver.Major;
|
||||
Version = Sys.Ver;
|
||||
|
||||
ushort code = _REV16(Sys.Code);
|
||||
Type = Buffer(&code, 2).ToHex();
|
||||
|
|
|
@ -19,7 +19,7 @@ void TokenConfig::Init()
|
|||
Length = Size();
|
||||
ServerIP = 0;
|
||||
|
||||
SoftVer = Sys.Ver.Major;
|
||||
SoftVer = Sys.Ver;
|
||||
PingTime = 10;
|
||||
//User[16] = '\0';
|
||||
//Key[15] = '\0';
|
||||
|
|
Loading…
Reference in New Issue