广播命令时静默
This commit is contained in:
@@ -299,7 +299,7 @@
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
@@ -523,7 +523,7 @@
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
@@ -601,7 +601,24 @@
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<Breakpoint>
|
||||
<Bp>
|
||||
<Number>0</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>959</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>134254474</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>D:\work\SVN\鍐夊窛\mcu_program\checker_slave\source\elec_det\driver\EWDriver.c</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\checker_slave_app\source/elec_det/driver/EWDriver.c\959</Expression>
|
||||
</Bp>
|
||||
</Breakpoint>
|
||||
<WatchWindow1>
|
||||
<Ww>
|
||||
<count>0</count>
|
||||
@@ -613,7 +630,7 @@
|
||||
<Mm>
|
||||
<WinNumber>1</WinNumber>
|
||||
<SubType>1</SubType>
|
||||
<ItemText>0x200033B0</ItemText>
|
||||
<ItemText>APP_TEST_PLAN_ADDR</ItemText>
|
||||
<AccSizeX>0</AccSizeX>
|
||||
</Mm>
|
||||
</MemoryWindow1>
|
||||
@@ -1123,7 +1140,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>dev</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1743,7 +1760,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>soft</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -255,4 +255,12 @@
|
||||
V2.06
|
||||
CAN总线发送数据源地址强制改为本机地址,目标地址强制改为0
|
||||
EW模块升级添加运行在app判断
|
||||
2023.11.15
|
||||
广播命令时静默,不返回数据
|
||||
elec_judge 打印电流值
|
||||
添加极性切换命令 bus_polarity
|
||||
使用 DMod_FireBusReadDatasV2_RC 替换 DMod_FireBusReadDatasV2
|
||||
添加跳转到bootloader命令 jwt_app_runboot
|
||||
解决 EW WriteMTP 命令异常
|
||||
debug 输出设备改为 host
|
||||
|
||||
|
@@ -77,6 +77,7 @@ array_def *protu_decode(protu_def *p,array_def *data)
|
||||
// }
|
||||
p->cmd_no=cmd_no;
|
||||
p->cmd=arr_get(data,4);
|
||||
p->silent=0;
|
||||
// 数据负载
|
||||
arr_delete(r);
|
||||
if(p->is_big_data==0)
|
||||
@@ -158,6 +159,7 @@ array_def *protu_decode2(protu_def *p,array_def *data)
|
||||
}
|
||||
p->cmd_no=arr_get(data,5)|(arr_get(data,6)<<8);
|
||||
p->cmd=arr_get(data,4);
|
||||
p->silent=0;
|
||||
// 数据负载
|
||||
arr_delete(r);
|
||||
if(p->is_big_data==0)
|
||||
@@ -215,7 +217,7 @@ array_def *protm_decode(protu_def *p,array_def *data)
|
||||
}
|
||||
uint8_t src=arr_get(data,4);
|
||||
uint8_t dst=arr_get(data,5);
|
||||
if((src!=0)||(dst!=elec_local_addr())){
|
||||
if((src!=0)||((dst!=elec_local_addr())&&(dst!=0x1f))){
|
||||
DBG_WARN("src_addr/dst_addr not allowed.");
|
||||
DBG_WARN("data=%s",str_temp(arr_string(data)));
|
||||
str_set(p->str_err,"src_addr/dst_addr not allowed.");
|
||||
@@ -245,6 +247,11 @@ array_def *protm_decode(protu_def *p,array_def *data)
|
||||
str_set(p->str_err,"crc check err.");
|
||||
}
|
||||
p->cmd=arr_get(data,6);
|
||||
if(dst==0x1f){
|
||||
p->silent=1;
|
||||
}else{
|
||||
p->silent=0;
|
||||
}
|
||||
arr_delete(r);
|
||||
return arr_mid(data,9,len-10);
|
||||
}
|
||||
|
@@ -999,6 +999,10 @@ uint8_t DMod_ReadBytesXor(uint8_t* buf, uint8_t len,uint16_t retry_times)
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define DMod_FireBusReadDatasV2 DMod_FireBusReadDatasV2_RC
|
||||
|
||||
|
||||
/*
|
||||
@brief 差分模式读取为应答
|
||||
@param count 读取的数量
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#include "commend.h"
|
||||
#include "mystring.h"
|
||||
#include "mystdlib.h"
|
||||
#include "base/delay.h"
|
||||
#include "hardware/jw3425iic.h"
|
||||
#include "hardware/power.h"
|
||||
#include "interface/BaseChecker.h"
|
||||
@@ -138,3 +139,40 @@ static int cmd_set_bus_power(list_def *argv)
|
||||
commend_export(bus_power,cmd_set_bus_power,"set bus power,param:bus_high_v,bus_mid_v")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 切换总线极性
|
||||
static int cmd_turn_polarity(list_def *argv)
|
||||
{
|
||||
if(list_length(argv)<3){
|
||||
cmd_print("param num too less.");
|
||||
return -1;
|
||||
}
|
||||
int ret=0;
|
||||
int us=str_atoi(list_get_str(argv,1));
|
||||
int times=str_atoi(list_get_str(argv,2));
|
||||
for(int i=0;i<times;i++)
|
||||
{
|
||||
EW_DIFF_MOD_L;
|
||||
delay_us(us);
|
||||
EW_DIFF_MOD_H;
|
||||
delay_us(us);
|
||||
}
|
||||
cmd_print("cmd end,ret=%d.",ret);
|
||||
return 0;
|
||||
}
|
||||
commend_export(bus_polarity,cmd_turn_polarity,"set bus polarity,param:delay_us,times")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -118,8 +118,14 @@ static void elec_current(elec_judge_def *e,int index,uint8_t *data)
|
||||
uint16_t temp,temp2;
|
||||
uint16_t short_c=e->short_circuited;
|
||||
uint16_t open_c=e->open_circuited;
|
||||
DBG_LOG("task index=%d.",index);
|
||||
if(EXE_ACK_CHECK(index)){
|
||||
elec_add_errcode(e,task->err);
|
||||
DBG_WARN("task execute err:%d.",task->err);
|
||||
}
|
||||
temp=GET_RET_DATA(0);
|
||||
temp2=GET_RET_DATA(1);
|
||||
DBG_LOG("task curr1:%d,curr2:%d",temp,temp2);
|
||||
if((temp<open_c)&&(temp2<open_c))
|
||||
{
|
||||
// 接触异常
|
||||
@@ -243,9 +249,9 @@ const static elec_judge_fun g_ew_judge_table[]={
|
||||
elec_task_judge, //0 电源准备
|
||||
elec_task_judge, //1 上电充能
|
||||
elec_task_judge, //2 设置总线电压
|
||||
elec_current, //3 获取总线电流
|
||||
elec_task_judge, //4 扫描UID
|
||||
elec_task_judge, //5 写配置参数
|
||||
elec_task_judge, //3 扫描UID
|
||||
elec_task_judge, //4 写配置参数
|
||||
elec_current, //5 获取总线电流
|
||||
elec_task_judge, //6 验证配置
|
||||
elec_task_judge, //7 模拟注码
|
||||
elec_task_judge, //8 充能统计
|
||||
|
@@ -237,6 +237,22 @@ static int cmd_jwt_app_read(list_def *argv)
|
||||
commend_export(jwt_app_read,cmd_jwt_app_read,"jwt read in app")
|
||||
|
||||
|
||||
// app:runbootloader
|
||||
static void EW_appRunBoot(void)
|
||||
{
|
||||
EW_Charge(1,0,0);
|
||||
delay_ms(6000);
|
||||
EW_RunBootLoader(1,1);
|
||||
DBG_LOG("run boot");
|
||||
}
|
||||
static int cmd_jwt_app_runboot(list_def *argv)
|
||||
{
|
||||
int ret=0;
|
||||
EW_appRunBoot();
|
||||
return ret;
|
||||
}
|
||||
commend_export(jwt_app_runboot,cmd_jwt_app_runboot,"jwt turn to bootloader")
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -244,7 +260,7 @@ commend_export(jwt_app_read,cmd_jwt_app_read,"jwt read in app")
|
||||
void EW_Updata(void)
|
||||
{
|
||||
Checker_RunCfg_st *cfg=&checker_runcfg;
|
||||
uint8_t ret=0;
|
||||
uint16_t ret=0;
|
||||
uint8_t read_buf[4]={0};
|
||||
uint8_t *data=(uint8_t *)MC_CODE_ADDR+UPDATA_BASE_ADDR;
|
||||
uint16_t len=UPDATA_DATA_LEN;
|
||||
@@ -268,6 +284,8 @@ void EW_Updata(void)
|
||||
if(ret){
|
||||
// 有可能在app中
|
||||
delay_ms(time_loadapp);
|
||||
EW_Charge(1,0,0);
|
||||
delay_ms(time_charg);
|
||||
if(EW_appCommTest()==0){
|
||||
if(updata_mode==1){
|
||||
delay_ms(50);
|
||||
@@ -287,8 +305,18 @@ void EW_Updata(void)
|
||||
goto err;
|
||||
}
|
||||
}else{
|
||||
if(updata_mode!=2){
|
||||
// bootloader 和 app 都不能通信
|
||||
DBG_WARN("commit failed");
|
||||
delay_ms(50);
|
||||
EW_RunBootLoader(0,1);
|
||||
updata_mode=2;
|
||||
goto retry;
|
||||
}else{
|
||||
DBG_WARN("retry failed.");
|
||||
ret=13;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(ret) {ret=1;goto err;}
|
||||
@@ -344,11 +372,17 @@ void EW_Updata(void)
|
||||
|
||||
err:
|
||||
DBG_LOG("ret=%d",ret);
|
||||
Checker_SetRtv(&ret,checker_runcfg.rtv_count);
|
||||
Checker_MaskResult(ret,checker_runcfg.task_info.runindex);
|
||||
}
|
||||
static int cmd_jwt_updata(list_def *argv)
|
||||
{
|
||||
int ret=0;
|
||||
checker_runcfg.params[0]=6000;
|
||||
checker_runcfg.params[1]=6000;
|
||||
checker_runcfg.params[2]=1000;
|
||||
checker_runcfg.params[3]=0;
|
||||
checker_runcfg.rtv_count=0;
|
||||
EW_Updata();
|
||||
return ret;
|
||||
}
|
||||
|
@@ -198,7 +198,7 @@ static void EWDriverTest(int argc, char**argv)
|
||||
printf("EnWriteMTP Excute %d\n",us_temp);
|
||||
}else if(!rt_strcmp(argv[1], "WriteMTP")){
|
||||
HexStrings2Byte(argv+5,argc-5,(uint8_t*)us_array,sizeof(us_array));
|
||||
us_temp = EW_WriteMTP(checker_runcfg.params[0],checker_runcfg.params[1],(uint8_t*)us_array,checker_runcfg.params[3]);
|
||||
us_temp = EW_WriteMTP(checker_runcfg.params[0],checker_runcfg.params[1],(uint8_t*)us_array,checker_runcfg.params[2]);
|
||||
printf("WriteMTP Excute %d\n",us_temp);
|
||||
}else if(!rt_strcmp(argv[1], "ReadMTP")){
|
||||
puc_buf = (uint8_t*)us_array;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
|
||||
#define BUILD_DATE "2023-11-14 18:09:40"
|
||||
#define BUILD_DATE "2023-11-15 17:56:15"
|
||||
#define SOFT_VERSION "2.06"
|
||||
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
#define DBG_DEV_INIT()\
|
||||
{\
|
||||
g_data.uart=dev_get("uart1");\
|
||||
g_data.uart=dev_get("host");\
|
||||
if(g_data.uart){\
|
||||
g_data.uart->init(g_data.uart,0);\
|
||||
}\
|
||||
|
@@ -280,6 +280,8 @@ void protu_reply_call(protu_def *p,array_def *data)
|
||||
{
|
||||
param_check(p);
|
||||
array_def *t=0;
|
||||
if(p->silent)
|
||||
return;
|
||||
if(p->codec)
|
||||
t=p->codec->encode(p,data);
|
||||
// DBG_LOG("send encode:%s",arr_string(t));
|
||||
@@ -294,6 +296,8 @@ void protu_reply_call(protu_def *p,array_def *data)
|
||||
void protu_send_call(protu_def *p,uint8_t cmd,array_def *data)
|
||||
{
|
||||
array_def *t=0;
|
||||
if(p->silent)
|
||||
return;
|
||||
if(cmd!=0){
|
||||
p->cmd=cmd;
|
||||
// 上报数据不增加流水号 2023.7.14
|
||||
@@ -333,6 +337,7 @@ array_def *protu_decode_str(protu_def *p,array_def *data)
|
||||
p->cmd=0;
|
||||
if(str_is_print_str((const char *)arr_data(data),arr_length(data))==1)
|
||||
{
|
||||
p->silent=0;
|
||||
arr_append(data,0);
|
||||
arr_appends_from(r,data);
|
||||
}else{
|
||||
|
@@ -31,6 +31,7 @@ struct _protu_def{
|
||||
uint8_t cmd;
|
||||
int is_big_data;
|
||||
codec_item *codec;
|
||||
int silent;// 此项为1,不返回数据
|
||||
};
|
||||
typedef struct _protu_def protu_def;
|
||||
|
||||
|
Reference in New Issue
Block a user