解决任务重试会导致返回数据长度增加的问题
修改jwt读取空闲判线算法以自适应返回电流挡位,未验证
This commit is contained in:
@@ -491,7 +491,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>core</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<TargetName>app</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
@@ -185,6 +185,7 @@
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>0</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<RvdsCdeCp>0</RvdsCdeCp>
|
||||
<hadIRAM2>0</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
@@ -351,7 +352,7 @@
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<uClangAs>0</uClangAs>
|
||||
<ClangAsOpt>4</ClangAsOpt>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
@@ -1247,6 +1248,7 @@
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>0</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<RvdsCdeCp>0</RvdsCdeCp>
|
||||
<hadIRAM2>0</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
@@ -1413,7 +1415,7 @@
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<uClangAs>0</uClangAs>
|
||||
<ClangAsOpt>4</ClangAsOpt>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
@@ -1860,7 +1862,7 @@
|
||||
<NoWarn>2</NoWarn>
|
||||
<uSurpInc>2</uSurpInc>
|
||||
<useXO>2</useXO>
|
||||
<uClangAs>2</uClangAs>
|
||||
<ClangAsOpt>0</ClangAsOpt>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
@@ -2924,7 +2926,7 @@
|
||||
<NoWarn>2</NoWarn>
|
||||
<uSurpInc>2</uSurpInc>
|
||||
<useXO>2</useXO>
|
||||
<uClangAs>2</uClangAs>
|
||||
<ClangAsOpt>0</ClangAsOpt>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
@@ -3466,7 +3468,7 @@
|
||||
<NoWarn>2</NoWarn>
|
||||
<uSurpInc>2</uSurpInc>
|
||||
<useXO>2</useXO>
|
||||
<uClangAs>2</uClangAs>
|
||||
<ClangAsOpt>0</ClangAsOpt>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
@@ -3570,7 +3572,7 @@
|
||||
<NoWarn>2</NoWarn>
|
||||
<uSurpInc>2</uSurpInc>
|
||||
<useXO>2</useXO>
|
||||
<uClangAs>2</uClangAs>
|
||||
<ClangAsOpt>0</ClangAsOpt>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
@@ -3649,7 +3651,7 @@
|
||||
<NoWarn>2</NoWarn>
|
||||
<uSurpInc>2</uSurpInc>
|
||||
<useXO>2</useXO>
|
||||
<uClangAs>2</uClangAs>
|
||||
<ClangAsOpt>0</ClangAsOpt>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
|
@@ -191,4 +191,6 @@
|
||||
2023.10.9
|
||||
实现通过iic下载模块程序,期间自动开启和关闭总线
|
||||
实现通过总线下载模块程序,crc32校验失败
|
||||
|
||||
2023.10.9
|
||||
解决任务重试会导致返回数据长度增加的问题
|
||||
修改jwt读取空闲判线算法以自适应返回电流挡位,未验证
|
||||
|
@@ -17,7 +17,7 @@ static volatile CurrentSample_Range_eu buscurrent_range = Current_Max;
|
||||
|
||||
#define SMod_Read_Idle_Filter 90
|
||||
// 根据反码电流改变
|
||||
#define DMod_Read_Idle_Filter 300
|
||||
#define DMod_Read_Idle_Filter 50
|
||||
|
||||
volatile uint16_t* EW_Read_AD_V = FireBus_ADC_Buf;
|
||||
static volatile uint16_t SMod_Read_Idle_C;
|
||||
@@ -483,6 +483,7 @@ uint8_t DMod_FireBusReadDatasV2(uint8_t* buf, uint8_t len, uint32_t time_out)
|
||||
uint32_t us_dataT_Or;//数据周期
|
||||
uint32_t us_temp1,us_temp2;
|
||||
uint16_t ad_max = 0,ad_max_temp = 0;
|
||||
uint16_t ad_high_value=0;
|
||||
CurrentSample_Range_eu range = buscurrent_range;//档位保存
|
||||
Power_SetSampleCurrentRange(R10_2mA_30mA_MC);
|
||||
ADC_CurChnnelSet(AN_MAL_CH,ADC_SPEED_HFAST);
|
||||
@@ -492,40 +493,45 @@ uint8_t DMod_FireBusReadDatasV2(uint8_t* buf, uint8_t len, uint32_t time_out)
|
||||
//延时等待电流稳定
|
||||
delay_us(800);
|
||||
//COM_PH2_Out = 0;
|
||||
PBout(I2IC_SCL_Pin_Nu) = 0;
|
||||
PBout(I2IC_SCL_Pin_Nu) = 0;
|
||||
delay_us(200);
|
||||
//获取中电平电流
|
||||
PBout(I2IC_SCL_Pin_Nu) = 1 ;
|
||||
PBout(I2IC_SCL_Pin_Nu) = 1 ;
|
||||
DMod_GetIdle2V();
|
||||
PBout(I2IC_SCL_Pin_Nu) = 0 ;
|
||||
PBout(I2IC_SCL_Pin_Nu) = 0 ;
|
||||
//读取指定长度数据
|
||||
//读取单字节数据
|
||||
ul_data = 0;
|
||||
//等待起始信号唤醒信号
|
||||
us_plus_H = 0;
|
||||
us_plus_T = 0;
|
||||
us_time_out = 2000 + time_out;
|
||||
do{
|
||||
//读取单字节数据
|
||||
ul_data = 0;
|
||||
//等待起始信号唤醒信号
|
||||
us_plus_H = 0;
|
||||
us_plus_T = 0;
|
||||
us_time_out = 2000 + time_out;
|
||||
do{
|
||||
|
||||
ul_ad_sample = ADC_GetCurADCFast();
|
||||
if(ad_max < ul_ad_sample)
|
||||
ad_max = ul_ad_sample;
|
||||
if(ul_ad_sample > SMod_Read_Idle_C)
|
||||
{
|
||||
us_plus_H++;
|
||||
}else{
|
||||
us_plus_H = 0;
|
||||
}
|
||||
delay_us(2);
|
||||
us_time_out--;
|
||||
}
|
||||
while((us_plus_H < 4) && (us_time_out > 0));
|
||||
if(us_time_out < 1)//等待起始信号超时
|
||||
{
|
||||
EW_DIFF_MOD_H;
|
||||
Power_SetSampleCurrentRange(range);
|
||||
return 1;
|
||||
}
|
||||
ul_ad_sample = ADC_GetCurADCFast();
|
||||
if(ad_max < ul_ad_sample)
|
||||
ad_max = ul_ad_sample;
|
||||
if(ul_ad_sample > SMod_Read_Idle_C)
|
||||
{
|
||||
us_plus_H++;
|
||||
ad_high_value=ad_high_value/2+ul_ad_sample/2;
|
||||
}else{
|
||||
us_plus_H = 0;
|
||||
ad_high_value=0;
|
||||
}
|
||||
delay_us(2);
|
||||
us_time_out--;
|
||||
}
|
||||
while((us_plus_H < 4) && (us_time_out > 0));
|
||||
if(us_time_out < 1)//等待起始信号超时
|
||||
{
|
||||
EW_DIFF_MOD_H;
|
||||
Power_SetSampleCurrentRange(range);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 空闲判线以最高电平为基准
|
||||
SMod_Read_Idle_C=ad_high_value-50;
|
||||
|
||||
while(len > 0)
|
||||
{
|
||||
@@ -916,7 +922,7 @@ uint8_t EW_WriteMTP(uint16_t addr,uint8_t mtpaddr,uint8_t* buf,uint8_t len)
|
||||
len = 10;
|
||||
}
|
||||
EW_CommBuf[3] = len;
|
||||
memcpy((void*)EW_CommBuf+4,buf,len);
|
||||
memcpy((void*)(EW_CommBuf+4),buf,len);
|
||||
DMod_SendBytes((uint8_t*)EW_CommBuf,len+4,EW_DMOD_Peroid,uc_readflag);
|
||||
if(uc_readflag == 0)
|
||||
{
|
||||
@@ -956,7 +962,7 @@ uint8_t EW_ReadMTP(uint16_t addr,uint8_t mtpaddr,uint8_t* buf,uint8_t len)
|
||||
len = 10;
|
||||
}
|
||||
EW_CommBuf[3] = len;
|
||||
memcpy((void*)EW_CommBuf+4,buf,len);
|
||||
memcpy((void*)(EW_CommBuf+4),buf,len);
|
||||
DMod_SendBytes((uint8_t*)EW_CommBuf,len+4,EW_DMOD_Peroid,uc_readflag);
|
||||
if(uc_readflag == 0)
|
||||
{
|
||||
@@ -987,7 +993,7 @@ uint8_t EW_RunBootLoader(uint16_t addr,uint8_t reboot)
|
||||
{
|
||||
ul_bootflag = 0x9966AA55;
|
||||
}
|
||||
memcpy((void*)EW_CommBuf+2,&ul_bootflag,4);
|
||||
memcpy((void*)(EW_CommBuf+2),&ul_bootflag,4);
|
||||
DMod_SendBytes((uint8_t*)EW_CommBuf,6,EW_DMOD_Peroid,0);
|
||||
return 0;
|
||||
}
|
||||
@@ -1009,7 +1015,7 @@ uint8_t EW_WriteRunCfg(uint16_t addr,RunCfg_un* runcfg)
|
||||
addr = (addr & 0xFFC0) | 20;
|
||||
EW_CommBuf[0] = addr&0xFF;
|
||||
EW_CommBuf[1] = (addr >> 8)&0xFF;
|
||||
memcpy((void*)EW_CommBuf+2,&runcfg,3);
|
||||
memcpy((void*)(EW_CommBuf+2),&runcfg,3);
|
||||
DMod_SendBytes((uint8_t*)EW_CommBuf,6,EW_DMOD_Peroid,uc_readflag);
|
||||
if(uc_readflag == 0)
|
||||
{
|
||||
@@ -1045,7 +1051,7 @@ uint8_t EW_SetAddrByUID(uint16_t addr,uint8_t* uid,uint8_t uid_len,uint8_t* ack_
|
||||
addr = (addr & 0xFFC0) | 21;
|
||||
EW_CommBuf[0] = addr&0xFF;
|
||||
EW_CommBuf[1] = (addr >> 8)&0xFF;
|
||||
memcpy((void*)EW_CommBuf+2,uid,uid_len);
|
||||
memcpy((void*)(EW_CommBuf+2),uid,uid_len);
|
||||
DMod_SendBytes((uint8_t*)EW_CommBuf,uid_len+2,EW_DMOD_Peroid,uc_readflag);
|
||||
if(uc_readflag == 0)
|
||||
{
|
||||
@@ -1084,7 +1090,7 @@ uint8_t EW_FastSetByUID(uint16_t addr,uint16_t delay, uint8_t pwd_flag,uint8_t*
|
||||
EW_CommBuf[0] = addr&0xFF;
|
||||
EW_CommBuf[1] = (addr >> 8)&0xFF;
|
||||
EW_CommBuf[2] = pwd_flag;
|
||||
memcpy(((void*)(EW_CommBuf)+3),&delay,2);
|
||||
memcpy((void*)(EW_CommBuf+3),&delay,2);
|
||||
memcpy((void*)(EW_CommBuf+5),uid,uid_len);
|
||||
uid_len +=5;
|
||||
DMod_SendBytes(((uint8_t*)(EW_CommBuf)),uid_len,EW_DMOD_Peroid,uc_readflag);
|
||||
@@ -1115,7 +1121,7 @@ uint8_t EW_SetDelay(uint16_t addr,uint16_t delay)
|
||||
addr = (addr & 0xFFC0) | 23;
|
||||
EW_CommBuf[0] = addr&0xFF;
|
||||
EW_CommBuf[1] = (addr >> 8)&0xFF;
|
||||
memcpy((void*)EW_CommBuf+2,&delay,2);
|
||||
memcpy((void*)(EW_CommBuf+2),&delay,2);
|
||||
DMod_SendBytes((uint8_t*)EW_CommBuf,4,EW_DMOD_Peroid,0);
|
||||
uc_ack = DMod_FireBusReadDatasV2((uint8_t*)EW_CommBuf+2,2,EW_DMOD_READ_Timeout);
|
||||
if(EW_CommBuf[0] != EW_CommBuf[2] || EW_CommBuf[1] != EW_CommBuf[3])
|
||||
@@ -1139,7 +1145,7 @@ uint8_t EW_VerfyPWD(uint16_t addr,uint8_t* pwd,uint8_t pwd_len)
|
||||
addr = (addr & 0xFFC0) | 24;
|
||||
EW_CommBuf[0] = addr&0xFF;
|
||||
EW_CommBuf[1] = (addr >> 8)&0xFF;
|
||||
memcpy((void*)EW_CommBuf+2,pwd,pwd_len);
|
||||
memcpy((void*)(EW_CommBuf+2),pwd,pwd_len);
|
||||
pwd_len += 2;
|
||||
DMod_SendBytes((uint8_t*)EW_CommBuf,pwd_len,EW_DMOD_Peroid,0);
|
||||
return 0;
|
||||
@@ -1417,7 +1423,7 @@ uint8_t EW_UpdateCommAddr(uint8_t addr,uint16_t new_addr)
|
||||
addr = (addr & 0xFFC0) | 36;
|
||||
EW_CommBuf[0] = addr&0xFF;
|
||||
EW_CommBuf[1] = (addr >> 8)&0xFF;
|
||||
memcpy((void*)EW_CommBuf+2,&new_addr,2);
|
||||
memcpy((void*)(EW_CommBuf+2),&new_addr,2);
|
||||
DMod_SendBytes((uint8_t*)EW_CommBuf,4,EW_DMOD_Peroid,uc_readflag);
|
||||
if(uc_readflag == 0)
|
||||
{
|
||||
|
@@ -196,7 +196,7 @@ static void elec_load_scheme(void)
|
||||
array_def *elec_check_with_scheme(array_def *uid_psw)
|
||||
{
|
||||
self_def *s=&g_self;
|
||||
const uint8_t* ptaskindex = (uint8_t*)(APP_TEST_PLAN_ADDR+4);
|
||||
const uint8_t* taskid_table = (uint8_t*)(APP_TEST_PLAN_ADDR+4);
|
||||
CheckerTask *tasks_fun_table[]={jqtaskArray,xttaskArray,ewtaskArray};
|
||||
CheckerTask_Info_st *task_par=0;
|
||||
uint8_t chip_type=0;
|
||||
@@ -219,9 +219,9 @@ array_def *elec_check_with_scheme(array_def *uid_psw)
|
||||
int task_index=0;
|
||||
int err_flag=0;
|
||||
LED1_Out_Off;
|
||||
while((ptaskindex[task_index]!=0xff)&&(task_index<PLAN_MAX_TASK)){
|
||||
while((taskid_table[task_index]!=0xff)&&(task_index<PLAN_MAX_TASK)){
|
||||
memset(&checker_runcfg.task_info,0,sizeof(CheckerTask_Info_st));
|
||||
taskid=ptaskindex[task_index];
|
||||
taskid=taskid_table[task_index];
|
||||
memset(checker_runcfg.params,0,20);
|
||||
checker_runcfg.param_count = 0;//参数个数
|
||||
checker_runcfg.rtv_count = 0;//返回值个数
|
||||
@@ -256,6 +256,7 @@ array_def *elec_check_with_scheme(array_def *uid_psw)
|
||||
Checker_Excueindex(task_index);
|
||||
if(checker_runcfg.excue_rtv==0)
|
||||
break;
|
||||
checker_runcfg.rtv_index-=checker_runcfg.rtv_count;
|
||||
}
|
||||
|
||||
// 找寻下一个任务
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
|
||||
#define BUILD_DATE "2023-10-09 17:54:49"
|
||||
#define BUILD_DATE "2023-10-09 22:54:36"
|
||||
#define SOFT_VERSION "0.03"
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user