河北水利局项目
This commit is contained in:
59
APP/apl.c
Normal file
59
APP/apl.c
Normal file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file apl.c
|
||||
* @author William Liang
|
||||
* @version V1.0.0
|
||||
* @date 07/26/2013
|
||||
* @brief This file contains application layer task and the initializtion of the variable.
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "Basedefine.h"
|
||||
#include "apl.h"
|
||||
|
||||
//应用层版本
|
||||
// __root 保证没有使用的函数或者变量也能够包含在目标代码中
|
||||
__root const Manufacturer_Version aplVersion =
|
||||
{
|
||||
{'H', 'T',},//厂商代码
|
||||
{'T', 'X'},//芯片代码,表示全部所有共计8种转换器协议
|
||||
0x14, 0x12, 0x21,//日月年
|
||||
{0x09, 0x02}//版本
|
||||
};
|
||||
|
||||
|
||||
const Manufacturer_Version * get_apl_version_ptr(void)
|
||||
{
|
||||
return &aplVersion;
|
||||
}
|
||||
|
||||
|
||||
|
||||
u8 * get_veryw()
|
||||
{
|
||||
|
||||
return (u8 *)&aplVersion;
|
||||
}
|
||||
|
||||
void ReadVersion(void)
|
||||
{
|
||||
u8 buf[sizeof(Manufacturer_Version)];
|
||||
|
||||
buf[0] = aplVersion.venderID[0];
|
||||
buf[1] = aplVersion.venderID[1];
|
||||
buf[2] = aplVersion.chipID[0];
|
||||
buf[3] = aplVersion.chipID[1];
|
||||
buf[4] = aplVersion.date;
|
||||
buf[5] = aplVersion.month;
|
||||
buf[6] = aplVersion.year;
|
||||
buf[7] = aplVersion.version[0];
|
||||
buf[8] = aplVersion.version[1];
|
||||
|
||||
printf("APL Version=%c%c%c%c-%02x%02x%02x-V%02x.%02x\r\n", \
|
||||
buf[1], buf[0], buf[3], buf[2], buf[6], buf[5], buf[4], buf[8], buf[7]);
|
||||
|
||||
}
|
||||
|
||||
/************** (C) COPYRIGHT 2013 Robulink Technology Ltd.*****END OF FILE****/
|
||||
Reference in New Issue
Block a user