parent
f104249440
commit
a093f8d7a0
|
@ -6,20 +6,32 @@
|
||||||
TSys Sys;
|
TSys Sys;
|
||||||
const TTime Time;
|
const TTime Time;
|
||||||
|
|
||||||
|
// 系统配置
|
||||||
|
const SystemConfig g_Config = {
|
||||||
|
// 操作系统 v3.2.x
|
||||||
|
(0x03020000 | __BUILD_DATE__),
|
||||||
|
"SmartOS_CPU",
|
||||||
|
|
||||||
|
// 硬件
|
||||||
|
0x0,
|
||||||
|
|
||||||
|
// 应用软件
|
||||||
|
0x0,
|
||||||
|
0x0,
|
||||||
|
"WsLink",
|
||||||
|
"",
|
||||||
|
};
|
||||||
|
|
||||||
#if defined(BOOT) || defined(APP)
|
#if defined(BOOT) || defined(APP)
|
||||||
|
|
||||||
struct HandlerRemap StrBoot __attribute__((at(0x2000fff0)));
|
struct HandlerRemap StrBoot __attribute__((at(0x2000fff0)));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef BIT
|
|
||||||
#define BIT(x) (1 << (x))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// 关键性代码,放到开头
|
// 关键性代码,放到开头
|
||||||
INROOT TSys::TSys()
|
INROOT TSys::TSys()
|
||||||
{
|
{
|
||||||
Config = nullptr;
|
Config = &g_Config;
|
||||||
|
|
||||||
OnInit();
|
OnInit();
|
||||||
|
|
||||||
|
@ -48,11 +60,10 @@ void TSys::Init(void)
|
||||||
void TSys::ShowInfo() const
|
void TSys::ShowInfo() const
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
//byte* ver = (byte*)&Version;
|
|
||||||
debug_printf("%s::%s Code:%04X ", Company, Name, Code);
|
debug_printf("%s::%s Code:%04X ", Company, Name, Code);
|
||||||
//debug_printf("Ver:%x.%x Build:%s\r\n", *ver++, *ver++, BuildTime);
|
Version v(Config->Ver);
|
||||||
Version v(0, 0, Ver);
|
debug_printf("Ver:%s\r\n", v.ToString().GetBuffer());
|
||||||
debug_printf("Ver:%s Build:%s\r\n", v.ToString().GetBuffer(), v.Compile().ToString().GetBuffer());
|
debug_printf("Build:%s %s\r\n", __BUILD_USER__, __BUILD_COMPILE__);
|
||||||
|
|
||||||
OnShowInfo();
|
OnShowInfo();
|
||||||
|
|
||||||
|
|
22
Kernel/Sys.h
22
Kernel/Sys.h
|
@ -144,18 +144,17 @@ class SystemConfig
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// 操作系统
|
// 操作系统
|
||||||
|
uint Ver; // 系统版本。Version格式
|
||||||
char Name[16]; // 系统名称。如:SmartOS-M3-10x
|
char Name[16]; // 系统名称。如:SmartOS-M3-10x
|
||||||
uint Ver; // 系统版本。系统内
|
|
||||||
|
|
||||||
// 硬件
|
// 硬件
|
||||||
uint HardVer; // 硬件版本
|
uint HardVer; // 硬件版本
|
||||||
|
|
||||||
// 应用软件
|
// 应用软件
|
||||||
ushort Type; // 产品种类
|
ushort Code; // 产品种类
|
||||||
uint AppVer; // 产品版本
|
uint AppVer; // 产品版本
|
||||||
char Serial[16]; // 授权码
|
|
||||||
char Product[16];// 产品名称
|
|
||||||
char Company[16];// 公司
|
char Company[16];// 公司
|
||||||
|
char Product[16];// 产品批次
|
||||||
|
|
||||||
char DevID[16]; // 设备编码
|
char DevID[16]; // 设备编码
|
||||||
char Server[32]; // 服务器。重置后先尝试厂商前端,再尝试原服务器
|
char Server[32]; // 服务器。重置后先尝试厂商前端,再尝试原服务器
|
||||||
|
@ -207,6 +206,21 @@ public:
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// 编译信息兼容性处理
|
||||||
|
#ifndef __BUILD_DATE__
|
||||||
|
#define __BUILD_DATE__ 0
|
||||||
|
#endif
|
||||||
|
#ifndef __BUILD_TIME__
|
||||||
|
#define __BUILD_TIME__ 0
|
||||||
|
#endif
|
||||||
|
#ifndef __BUILD_COMPILE__
|
||||||
|
#define __BUILD_COMPILE__ ""
|
||||||
|
#endif
|
||||||
|
#ifndef __BUILD_USER__
|
||||||
|
#define __BUILD_USER__ ""
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif //_Sys_H_
|
#endif //_Sys_H_
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -17,6 +17,7 @@ build.AddFiles("..\\Test");
|
||||||
build.AddFiles("..\\TinyIP", "*.c;*.cpp", false, "HttpClient");
|
build.AddFiles("..\\TinyIP", "*.c;*.cpp", false, "HttpClient");
|
||||||
build.AddFiles("..\\TinyNet");
|
build.AddFiles("..\\TinyNet");
|
||||||
build.AddFiles("..\\TokenNet");
|
build.AddFiles("..\\TokenNet");
|
||||||
|
build.AlwaysBuild = "Sys.cpp";
|
||||||
build.Libs.Clear();
|
build.Libs.Clear();
|
||||||
//build.Preprocess = true;
|
//build.Preprocess = true;
|
||||||
build.CompileAll();
|
build.CompileAll();
|
||||||
|
|
Loading…
Reference in New Issue