From c303e1bf841184b335adc940c2d7567cd006eec4 Mon Sep 17 00:00:00 2001 From: Lee Date: Tue, 31 Jan 2023 16:11:48 +0800 Subject: [PATCH] V100.0.13 1、增加停止信标设置,如即时反馈功能,语言设置功能等等; 2、增加清除EEPROM函数,用于测试初始默认设置,正常固件需要注释; 3、按要求修改默认设置,如默认登录密码1024,默认基站名称可见,默认登录采电显示允许,默认在线关机2分钟; 4、扩展信标键盘进入慢的问题改回V100.0.7版本,逻辑分析仪调试正常,(有点奇怪,500的超时数据放到函数内部不行,放到函数外就可以?); --- Base_core/core_lib/stop_beacon_intf.h | 12 ++++++++++++ Base_core/core_src/stop_beacon.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 0 deletions(-) create mode 100644 Base_core/core_lib/stop_beacon_intf.h create mode 100644 Base_core/core_src/stop_beacon.c diff --git a/Base_core/core_lib/stop_beacon_intf.h b/Base_core/core_lib/stop_beacon_intf.h new file mode 100644 index 0000000..28193e5 --- /dev/null +++ b/Base_core/core_lib/stop_beacon_intf.h @@ -0,0 +1,12 @@ +#ifndef _STOP_BEACON_H_ +#define _STOP_BEACON_H_ + +struct stop_beacon_intf_STR{ + void (*rxpc)(const unsigned char *rxpc); + void (*cover)(unsigned char *tmp); + void (*pwrup)(void); +}; + +extern struct stop_beacon_intf_STR core__stop_beacon_intf; + +#endif diff --git a/Base_core/core_src/stop_beacon.c b/Base_core/core_src/stop_beacon.c new file mode 100644 index 0000000..97794b9 --- /dev/null +++ b/Base_core/core_src/stop_beacon.c @@ -0,0 +1,79 @@ +//#include "core_extern.h" +//#include "base_pc_protocol.h" +//#include "platform_extern.h" +//#include "func_extern.h" +#include "base_core.h" +#include "string.h" +#include "stop_beacon_intf.h" + +#if MD_SPECIAL_STOP_PRO + +#define RSP_LEN 2 +#define LANG_LEN 1 +unsigned char rsp_para[RSP_LEN],lang[LANG_LEN]; + +// +void stop_beacon__rxpc(const unsigned char *rxpc) +{ + //rxpc[3] = 11 + //rxpc[4] = 30 31 32 33 + unsigned char ack_buf[8]; + switch(rxpc[4]){ + case 31: + memcpy( rsp_para,rxpc+5,RSP_LEN); + base_write_e2prom(STORE_BASE_STOP_BEACON,rsp_para,RSP_LEN);//func__store_intf.write_with_flag(STORE_BASE_STOP_BEACON,rsp_para,RSP_LEN); + case 30: +// my_debug.print_buf(1,"stop beacon data rsp:",rsp_para,RSP_LEN); + ack_buf[0] =rxpc[4]; + memcpy(ack_buf+1,rsp_para,RSP_LEN); + pc_cmd_0x61_ack(11,ack_buf,RSP_LEN+1);//core__pc_intf.ack_pc(0xe1,11,ack_buf,RSP_LEN+1); + break; + + case 33: + memcpy( lang,rxpc+5,LANG_LEN); + base_write_e2prom(STORE_BASE_STOP_BEACON2,lang,LANG_LEN);//func__store_intf.write_with_flag(STORE_BASE_STOP_BEACON2,lang,LANG_LEN); + case 32: +// my_debug.print_buf(1,"stop beacon data lang:",lang,LANG_LEN); + ack_buf[0] =rxpc[4]; + memcpy(ack_buf+1,lang,LANG_LEN); + pc_cmd_0x61_ack(11,ack_buf,LANG_LEN+1);//core__pc_intf.ack_pc(0xe1,11,ack_buf,LANG_LEN+1); + break; + + default:break; + } //sw +} + + +void stop_beacon__cover(unsigned char *tmp) +{ + memcpy(tmp,rsp_para,RSP_LEN); //byte 10 + memcpy(tmp+2,lang,LANG_LEN); //byte 14 +} + + + +void stop_beacon__powerup(void) +{ + unsigned char tmp[2+1]; + if( base_read_e2prom(STORE_BASE_STOP_BEACON,tmp,RSP_LEN) ){//if( func__store_intf.read_with_flag(STORE_BASE_STOP_BEACON,tmp,RSP_LEN) ){ + memcpy( rsp_para,tmp,RSP_LEN); + } + + if( base_read_e2prom(STORE_BASE_STOP_BEACON2,tmp,LANG_LEN) ){//if( func__store_intf.read_with_flag(STORE_BASE_STOP_BEACON2,tmp,LANG_LEN) ){ + memcpy( lang,tmp,LANG_LEN); + } + +} + + + +struct stop_beacon_intf_STR core__stop_beacon_intf={ + .rxpc = stop_beacon__rxpc, + .cover = stop_beacon__cover, + .pwrup = stop_beacon__powerup, +}; + + +#endif + + -- libgit2 0.21.4