ADD 1.增加硬件版本号和FPGA版本号;

main
wangbo 3 weeks ago
parent 78d95376ba
commit 8b9b7f108a

@ -248,6 +248,8 @@ typedef struct
int lines; /* System wide terminal lines. */
char *version; /* 版本号. */
char *compile; /* 编译时间. */
char *hardversion; /* 硬件版本号. */
char *FPGAversion; /* PFGA版本号. */
char configfile[FILE_NAME_LEN]; /* config file name of this host */
char bannerfile[FILE_NAME_LEN]; /* Banner configuration file name. */
} host_t;

@ -146,6 +146,8 @@ extern int printh(const char *format, ...);
extern char* version_get();
extern char* version_date_get();
extern uint16_t sofrware_version_get(void);
extern char* hardware_version_get();
extern char* fpga_version_date_get();
extern int32_t str_to_mac(char *mac_str, OUT uint8_t *mac);
extern int32_t str_to_id(char *id_str, OUT uint32_t *id);
extern int32_t bitmap_set(uint8_t *buf, int32_t nbit, int32_t buf_len);

@ -2398,6 +2398,8 @@ void cmd_init(void)
strncpy(host.configfile, "startup-config", FILE_NAME_LEN);
host.version = version_get();
host.compile = version_date_get();
host.hardversion = hardware_version_get();
host.FPGAversion = fpga_version_date_get();
host.lines = -1;
/* 安装命令行模式节点. */

@ -31,6 +31,8 @@ VERSION_FILE := $(SOURCE_DIR)/include/version.h
VERSION_LIB := version.a
DATE_STRING := `date "+%Y.%m.%d %k:%M:%S"`
VERSION_STRING := "10.0.1.0"
HARDWARE_VERSION := "A.1"
FPGA_VERSION := "1.0"
MV := mv -f
RM := rm -rf
@ -98,10 +100,14 @@ $(VERSION_LIB): $(CONFIG_FILE) $(libraries) version.c
@echo "#define VERSION \"$(VERSION_STRING)\"" >> $(VERSION_FILE)
@echo "#define DATE \"$(DATE_STRING)\"" >> $(VERSION_FILE)
@echo "#define HARDV_ERSION \"$(HARDWARE_VERSION)\"" >> $(VERSION_FILE)
@echo "#define FPGA_VERSION \"$(FPGA_VERSION)\"" >> $(VERSION_FILE)
@echo "" >> $(VERSION_FILE)
@echo "char* version_get();" >> $(VERSION_FILE)
@echo "char* version_date_get();" >> $(VERSION_FILE)
@echo "char* hardware_version_get();" >> $(VERSION_FILE)
@echo "char* fpga_version_date_get();" >> $(VERSION_FILE)
@echo "" >> $(VERSION_FILE)
@echo "#endif" >> $(VERSION_FILE)

Loading…
Cancel
Save