diff --git a/checher_slave.uvoptx b/checher_slave.uvoptx index 35f8f2d..2d8676c 100644 --- a/checher_slave.uvoptx +++ b/checher_slave.uvoptx @@ -299,7 +299,7 @@ 1 0 - 1 + 0 18 @@ -523,7 +523,7 @@ 1 0 - 0 + 1 18 @@ -601,7 +601,24 @@ - + + + 0 + 0 + 959 + 1 +
134254474
+ 0 + 0 + 0 + 0 + 0 + 1 + D:\work\SVN\鍐夊窛\mcu_program\checker_slave\source\elec_det\driver\EWDriver.c + + \\checker_slave_app\source/elec_det/driver/EWDriver.c\959 +
+
0 @@ -613,7 +630,7 @@ 1 1 - 0x200033B0 + APP_TEST_PLAN_ADDR 0 @@ -1123,7 +1140,7 @@ dev - 0 + 1 0 0 0 @@ -1743,7 +1760,7 @@ soft - 0 + 1 0 0 0 diff --git a/source/ReadMe.txt b/source/ReadMe.txt index cd006d9..57da295 100644 --- a/source/ReadMe.txt +++ b/source/ReadMe.txt @@ -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 diff --git a/source/codec/codec.c b/source/codec/codec.c index 2b74911..2d0ae8f 100644 --- a/source/codec/codec.c +++ b/source/codec/codec.c @@ -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); } diff --git a/source/elec_det/driver/EWDriver.c b/source/elec_det/driver/EWDriver.c index 9aaeb61..5e836d7 100644 --- a/source/elec_det/driver/EWDriver.c +++ b/source/elec_det/driver/EWDriver.c @@ -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 读取的数量 diff --git a/source/elec_det/elec_cmd.c b/source/elec_det/elec_cmd.c index da7a273..0c843f0 100644 --- a/source/elec_det/elec_cmd.c +++ b/source/elec_det/elec_cmd.c @@ -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;ishort_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((tempinit(g_data.uart,0);\ }\ diff --git a/source/task/prot_uc.c b/source/task/prot_uc.c index 229fb67..85bb2d5 100644 --- a/source/task/prot_uc.c +++ b/source/task/prot_uc.c @@ -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{ diff --git a/source/task/prot_uc.h b/source/task/prot_uc.h index 07d87b7..fcc3134 100644 --- a/source/task/prot_uc.h +++ b/source/task/prot_uc.h @@ -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;