解决自动更新bootloader死机的问题
软件版本2.00 解决检测任务中重试失败后不会填充返回值的bug
This commit is contained in:
@@ -215,4 +215,5 @@
|
||||
2023.10.16
|
||||
解决自动更新bootloader死机的问题
|
||||
软件版本2.00
|
||||
解决检测任务中重试失败后不会填充返回值的bug
|
||||
|
||||
|
@@ -124,8 +124,8 @@ typedef struct {
|
||||
|
||||
#pragma pack()
|
||||
|
||||
extern BoartCheck_st board_st;
|
||||
extern BoardInfo_un boardinfo_un;
|
||||
extern volatile BoartCheck_st board_st;
|
||||
extern volatile BoardInfo_un boardinfo_un;
|
||||
|
||||
//检测小板初始化
|
||||
void Ye_BoardInit(void);
|
||||
|
@@ -24,14 +24,14 @@ static volatile uint16_t SMod_Read_Idle_C;
|
||||
static uint16_t firebus_idle_diff = SMod_Read_Idle_Filter;
|
||||
|
||||
const static uint16_t data2bit_signal[]={200,234,275,323,380,446};
|
||||
static uint16_t datapulus[6][2];
|
||||
volatile static uint16_t datapulus[6][2];
|
||||
//发送起始信号
|
||||
#define SMod_Begin_Plus() SMod_2Bit_Plus(4)
|
||||
//发送结束信号
|
||||
#define SMod_End_Plus() SMod_2Bit_Plus(5)
|
||||
uint8_t EW_CommBuf[EW_DMODE_FRAME_SIZE];
|
||||
uint16_t EW_DMOD_Peroid = 300;
|
||||
uint16_t EW_DMOD_READ_Timeout = 6000;
|
||||
volatile uint8_t EW_CommBuf[EW_DMODE_FRAME_SIZE];
|
||||
volatile uint16_t EW_DMOD_Peroid = 300;
|
||||
volatile uint16_t EW_DMOD_READ_Timeout = 6000;
|
||||
//发送唤醒信号
|
||||
static void SMod_Wake_Plus(void)
|
||||
{
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#include "hardware/power.h"
|
||||
#include "hardware/timer_cfg.h"
|
||||
#include "hardware/power.h"
|
||||
static uint16_t jq_idle_current;
|
||||
volatile static uint16_t jq_idle_current;
|
||||
|
||||
#define JQ_IDLE_NOISE 100
|
||||
|
||||
@@ -14,19 +14,19 @@ static uint16_t jq_idle_current;
|
||||
#else
|
||||
volatile uint16_t* JQ_Read_AD_V = FireBus_ADC_Buf;
|
||||
#endif
|
||||
static uint16_t jq_ad_last_sample;
|
||||
volatile static uint16_t jq_ad_last_sample;
|
||||
static volatile CurrentSample_Range_eu buscurrent_range = Current_Max;
|
||||
|
||||
uint16_t JQ_FreeBack_MaxCur;
|
||||
uint16_t JQ_FreeBack_MaxTime;
|
||||
uint16_t JQ_FreeBack_MinCur;
|
||||
uint16_t JQ_FreeBack_MinTime;
|
||||
volatile uint16_t JQ_FreeBack_MaxCur;
|
||||
volatile uint16_t JQ_FreeBack_MaxTime;
|
||||
volatile uint16_t JQ_FreeBack_MinCur;
|
||||
volatile uint16_t JQ_FreeBack_MinTime;
|
||||
|
||||
uint16_t JQ_CommEnd_MaxCur = 0;
|
||||
uint8_t JQ_CommEnd_CurEn = 0;
|
||||
volatile uint16_t JQ_CommEnd_MaxCur = 0;
|
||||
volatile uint8_t JQ_CommEnd_CurEn = 0;
|
||||
|
||||
|
||||
uint16_t JQ_EnFreeBack_Test = 0;
|
||||
volatile uint16_t JQ_EnFreeBack_Test = 0;
|
||||
|
||||
static void JQ_CommBegin()
|
||||
{
|
||||
|
@@ -16,12 +16,12 @@
|
||||
#define JQ_Read_AD_Sample_C 140
|
||||
#define JQ_Read_AD_Sample_C_IDLE 80
|
||||
|
||||
extern uint16_t JQ_FreeBack_MaxCur;
|
||||
extern uint16_t JQ_FreeBack_MaxTime;
|
||||
extern uint16_t JQ_FreeBack_MinCur;
|
||||
extern uint16_t JQ_FreeBack_MinTime;
|
||||
extern uint16_t JQ_CommEnd_MaxCur ;
|
||||
extern uint8_t JQ_CommEnd_CurEn ;
|
||||
extern volatile uint16_t JQ_FreeBack_MaxCur;
|
||||
extern volatile uint16_t JQ_FreeBack_MaxTime;
|
||||
extern volatile uint16_t JQ_FreeBack_MinCur;
|
||||
extern volatile uint16_t JQ_FreeBack_MinTime;
|
||||
extern volatile uint16_t JQ_CommEnd_MaxCur ;
|
||||
extern volatile uint8_t JQ_CommEnd_CurEn ;
|
||||
|
||||
|
||||
//@brief 读OTP
|
||||
|
@@ -1,9 +1,9 @@
|
||||
#include "XTDriver.h"
|
||||
#include "hardware/adc_cfg.h"
|
||||
#include "hardware/timer_cfg.h"
|
||||
uint32_t XT_SquareCount = 0; //发送载波个数
|
||||
uint16_t XT_FreeBackMaxCur,XT_FreeBackMinCur,XT_FreeBackMaxTime,XT_FreeBackMinTime,XT_CommEndMaxCur;
|
||||
uint8_t XT_EnFreeBack_Test,XT_CommEnd_CurEn;
|
||||
volatile uint32_t XT_SquareCount = 0; //发送载波个数
|
||||
volatile uint16_t XT_FreeBackMaxCur,XT_FreeBackMinCur,XT_FreeBackMaxTime,XT_FreeBackMinTime,XT_CommEndMaxCur;
|
||||
volatile uint8_t XT_EnFreeBack_Test,XT_CommEnd_CurEn;
|
||||
volatile uint8_t XT_SendSquareFlag = 1; //发送方波标志
|
||||
volatile uint8_t XT_ReadUIDFlag = 1; //扫描标志
|
||||
|
||||
@@ -18,8 +18,8 @@ volatile uint16_t* XT_ADC_Buf = FireBus_ADC_Buf;//AD采样缓存区
|
||||
|
||||
volatile uint8_t XT_ADCCollectStartFlag = 1; //ADC采集标志
|
||||
|
||||
uint32_t XT_ADC_BaseValue = 0; //ADC采集最低电压
|
||||
uint32_t XT_ADC_CollectValue_sum = 0; //ADC采集电压和
|
||||
volatile uint32_t XT_ADC_BaseValue = 0; //ADC采集最低电压
|
||||
volatile uint32_t XT_ADC_CollectValue_sum = 0; //ADC采集电压和
|
||||
#define XT_FreeBack_Noise 800
|
||||
|
||||
//static uint32_t XT_ADCCollectIncrementValue = XTCollectIncrementValue;
|
||||
|
@@ -129,8 +129,8 @@
|
||||
#define XT_CMDC_MEASURE_RES 0x2F //测量药头电阻_C
|
||||
|
||||
|
||||
extern uint16_t XT_FreeBackMaxCur,XT_FreeBackMinCur,XT_FreeBackMaxTime,XT_FreeBackMinTime,XT_CommEndMaxCur;
|
||||
extern uint8_t XT_EnFreeBack_Test,XT_CommEnd_CurEn;
|
||||
extern volatile uint16_t XT_FreeBackMaxCur,XT_FreeBackMinCur,XT_FreeBackMaxTime,XT_FreeBackMinTime,XT_CommEndMaxCur;
|
||||
extern volatile uint8_t XT_EnFreeBack_Test,XT_CommEnd_CurEn;
|
||||
|
||||
//************************************************************************//
|
||||
/*
|
||||
|
@@ -94,7 +94,12 @@ static int elec_parper_power(void)
|
||||
ret=checker_runcfg.excue_rtv;
|
||||
if(ret){
|
||||
DBG_WARN("parper power failed,ret=%d.",ret);
|
||||
}else{
|
||||
checker_runcfg.power_prapare_exe=1;
|
||||
}
|
||||
JQBUS_OFF;
|
||||
delay_ms(20);
|
||||
PowerCalibration_set(POWER_DEF_V,POWER_DEF_V-10);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -133,7 +138,7 @@ array_def *elec_bootinfo(void)
|
||||
Ye_BoardCheck();
|
||||
board_st.hard_v=sys_param()->hard_version;
|
||||
board_st.resistor_diff=sys_param()->resistor_diff;
|
||||
board_st.hard_v=15;
|
||||
board_st.hard_v=19;
|
||||
array_def *r=arr_creat();
|
||||
arr_append(r,0);
|
||||
arr_appends(r,&board_st,sizeof(BoartCheck_st));
|
||||
@@ -294,11 +299,11 @@ static int elec_code_param_check(array_def *uid_psw)
|
||||
if((uid_psw==0)||(arr_length(uid_psw)==0)){
|
||||
return 1;
|
||||
}
|
||||
if(arr_length(uid_psw)!=(arr_get(uid_psw,0)+arr_get(uid_psw,1)+1)){
|
||||
if(arr_length(uid_psw)!=(arr_get(uid_psw,0)+arr_get(uid_psw,1)+3)){
|
||||
return 2;
|
||||
}
|
||||
if(arr_get(uid_psw,2)!=0){
|
||||
return 2;
|
||||
return 3;
|
||||
}
|
||||
if((arr_get(uid_psw,0)>13)||(arr_get(uid_psw,1)>8)){
|
||||
return 4;
|
||||
@@ -365,10 +370,11 @@ array_def *elec_check_with_scheme(array_def *uid_psw)
|
||||
uint8_t res=0;
|
||||
array_def *r=arr_creat();
|
||||
CHECK_DO(s->data,arr_delete);
|
||||
res=checker_runcfg.power_prapare_exe;
|
||||
memset(&checker_runcfg,0,sizeof(Checker_RunCfg_st));
|
||||
checker_runcfg.power_prapare_exe=res;
|
||||
chip_type=(board_st.plan_id >> 12 ) & 0x0F;
|
||||
if(elec_code_param_check(uid_psw)==0){
|
||||
checker_runcfg.code_bind_check_flag = 1;//检测 绑定一起执行
|
||||
elec_code_load_param(uid_psw);
|
||||
}
|
||||
|
||||
@@ -402,13 +408,18 @@ array_def *elec_check_with_scheme(array_def *uid_psw)
|
||||
break;
|
||||
checker_runcfg.rtv_index-=checker_runcfg.rtv_count;
|
||||
}
|
||||
DBG_LOG("task_index:%d,taskid:%d,ret=%d.",task_index,taskid,checker_runcfg.excue_rtv);
|
||||
if(checker_runcfg.excue_rtv){
|
||||
checker_runcfg.rtv_index+=checker_runcfg.rtv_count;
|
||||
}
|
||||
DBG_LOG("task_index:%d,taskid:%d,ret=%d,rtv_index=%d.",task_index,taskid,checker_runcfg.excue_rtv,
|
||||
checker_runcfg.rtv_index);
|
||||
|
||||
// 找寻下一个任务
|
||||
task_index++;
|
||||
if(checker_runcfg.excue_rtv != 0){
|
||||
uint8_t err_to=checker_runcfg.task_info.error_jumpto;
|
||||
uint8_t temp;
|
||||
if(err_to==0xff) continue;
|
||||
if(err_to>s->task_num-1) err_to=s->task_num-1;
|
||||
for(;task_index<err_to;task_index++){
|
||||
Checker_MaskResult(1,task_index);
|
||||
|
@@ -4,14 +4,14 @@
|
||||
#include "timer_cfg.h"
|
||||
#include "base/utility.h"
|
||||
#include "power.h"
|
||||
uint16_t ad0_adc_sample[AD_SCAN_SAMPLE*AD_SCAN_COUNT];
|
||||
volatile uint16_t ad0_adc_sample[AD_SCAN_SAMPLE*AD_SCAN_COUNT];
|
||||
#define ADC1_SAMPLE_BUF_LEN 200
|
||||
#define ADC1_SAMPLE_BUF_LEN2 20
|
||||
|
||||
volatile uint16_t FireBus_ADC_Buf[FIREBUS_ADC_BUF_LEN];
|
||||
|
||||
|
||||
uint16_t adc1_sample_buf[ADC1_SAMPLE_BUF_LEN];
|
||||
volatile uint16_t adc1_sample_buf[ADC1_SAMPLE_BUF_LEN];
|
||||
void AdcDef_Init(void)
|
||||
{
|
||||
|
||||
@@ -185,7 +185,7 @@ uint32_t GetADC2_Value(uint32_t channel)
|
||||
void GetADC1_Value(uint32_t channel,uint16_t* buf,uint16_t len)
|
||||
{
|
||||
uint8_t i = 0;
|
||||
uint16_t* buf_head = 0;
|
||||
volatile uint16_t* buf_head = 0;
|
||||
switch(channel)
|
||||
{
|
||||
case VCC_2V5_CH: buf_head = ad0_adc_sample;break;
|
||||
@@ -251,7 +251,7 @@ uint16_t ADC_GetBaseStableCur(void)
|
||||
ul_base = (ul_base*8 + adc1_sample_buf[us_count]*2 )/10;
|
||||
adc1_sample_buf[us_count] = ul_base;
|
||||
}
|
||||
Bubble_Sort_u16(adc1_sample_buf,us_count);
|
||||
Bubble_Sort_u16((uint16_t *)adc1_sample_buf,us_count);
|
||||
|
||||
us_count = (ADC1_SAMPLE_BUF_LEN>>2);
|
||||
us_temp = ADC1_SAMPLE_BUF_LEN - (ADC1_SAMPLE_BUF_LEN>>2);
|
||||
@@ -297,7 +297,7 @@ uint16_t ADC_Comm1p6mA_EndCur(void)
|
||||
ul_base = (ul_base*8 + adc1_sample_buf[us_count]*2 )/10;
|
||||
adc1_sample_buf[us_count] = ul_base;
|
||||
}
|
||||
Bubble_Sort_u16(adc1_sample_buf,us_count);
|
||||
Bubble_Sort_u16((uint16_t *)adc1_sample_buf,us_count);
|
||||
|
||||
us_count = (ADC1_SAMPLE_BUF_LEN2>>2);
|
||||
us_temp = ADC1_SAMPLE_BUF_LEN2 - (ADC1_SAMPLE_BUF_LEN2>>2);
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#include "dac_cfg.h"
|
||||
#include "gpio_cfg.h"
|
||||
#include "base/delay.h"
|
||||
/*
|
||||
@brief 默认初始化
|
||||
*/
|
||||
@@ -43,13 +44,16 @@ void DAC_Definit(void)
|
||||
*/
|
||||
void C_H_DAC_Set(uint16_t dac_val)
|
||||
{
|
||||
uint16_t read=0;
|
||||
read=DAC_GetDataOutputValue(DAC_Channel_1);
|
||||
if(dac_val==read) return;
|
||||
DAC_SetChannel1Data(DAC_Align_12b_R, dac_val);
|
||||
DAC_SoftwareTriggerCmd(DAC_Channel_1,ENABLE);
|
||||
// dac_output_buffer_enable(DAC0);
|
||||
// dac_data_set(DAC0,DAC_ALIGN_12B_R,dac_val);
|
||||
// dac_trigger_enable(DAC0);
|
||||
// dac_enable(DAC0);
|
||||
// dac_software_trigger_enable(DAC0);
|
||||
|
||||
do{
|
||||
DAC_SoftwareTriggerCmd(DAC_Channel_1,ENABLE);
|
||||
read=DAC_GetDataOutputValue(DAC_Channel_1);
|
||||
}while(read!=dac_val);
|
||||
|
||||
}
|
||||
/*
|
||||
@brief 设置高电平电压
|
||||
@@ -57,13 +61,15 @@ void C_H_DAC_Set(uint16_t dac_val)
|
||||
*/
|
||||
void C_M_DAC_Set(uint16_t dac_val)
|
||||
{
|
||||
uint16_t read=0;
|
||||
read=DAC_GetDataOutputValue(DAC_Channel_2);
|
||||
if(dac_val==read) return;
|
||||
DAC_SetChannel2Data(DAC_Align_12b_R, dac_val);
|
||||
DAC_SoftwareTriggerCmd(DAC_Channel_2,ENABLE);
|
||||
// dac_output_buffer_enable(DAC1);
|
||||
// dac_data_set(DAC1,DAC_ALIGN_12B_R,dac_val);
|
||||
// dac_trigger_enable(DAC1);
|
||||
// dac_enable(DAC1);
|
||||
// dac_software_trigger_enable(DAC1);
|
||||
do{
|
||||
DAC_SoftwareTriggerCmd(DAC_Channel_2,ENABLE);
|
||||
delay_us(2);
|
||||
read=DAC_GetDataOutputValue(DAC_Channel_2);
|
||||
}while(read!=dac_val);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -10,8 +10,8 @@
|
||||
#include "base/utility.h"
|
||||
//#include "yecan.h"
|
||||
#include "hardware/jw3425iic.h"
|
||||
BoartCheck_st board_st;
|
||||
BoardInfo_un boardinfo_un;
|
||||
volatile BoartCheck_st board_st;
|
||||
volatile BoardInfo_un boardinfo_un;
|
||||
|
||||
void test_timer_function()
|
||||
{
|
||||
@@ -71,7 +71,7 @@ void Ye_BoardCheck(void)
|
||||
LED1_Out = 0;
|
||||
}
|
||||
PowerCalibration_set(POWER_DEF_V,45);
|
||||
delay_ms(100);
|
||||
delay_ms(5);
|
||||
board_st.bus_5p5v = Power_GetHPowerV();
|
||||
//
|
||||
#ifdef CHECKER_DEV
|
||||
|
@@ -4,13 +4,13 @@
|
||||
#include "base/delay.h"
|
||||
#define PowerCurr_AD_BUF_LEN 40
|
||||
#define POWER_SET_COUNT 20
|
||||
static CurrentSample_Range_eu latest_range = Current_Max;
|
||||
static PowerInfo_st def_power_st;
|
||||
static volatile CurrentSample_Range_eu latest_range = Current_Max;
|
||||
static volatile PowerInfo_st def_power_st;
|
||||
//static uint16_t PowerCurr_AD_buf[PowerCurr_AD_BUF_LEN];
|
||||
static float f_cur_k;
|
||||
static float f_cur_b;
|
||||
static uint8_t uc_power_cal_flag = 0;
|
||||
PowerInfo_st powerinfo_arrayst[POWER_SET_COUNT] ;
|
||||
static volatile float f_cur_k;
|
||||
static volatile float f_cur_b;
|
||||
static volatile uint8_t uc_power_cal_flag = 0;
|
||||
volatile PowerInfo_st powerinfo_arrayst[POWER_SET_COUNT] ;
|
||||
|
||||
/*
|
||||
@brief 获取内部基准1.2V电压对应的AD
|
||||
@@ -106,13 +106,13 @@ uint32_t Power_GetBousV()
|
||||
abus_v = Power_ADVGetCalVal_106(abus_v);
|
||||
abus_v = abus_v*11/100000;
|
||||
|
||||
hbus_v=Power_GetHPowerV();
|
||||
// hbus_v=Power_GetHPowerV();
|
||||
|
||||
//? 验证电压失调
|
||||
// 电压相差过大的时候输出一个离谱的值
|
||||
if((hbus_v>abus_v+10)||(abus_v>hbus_v+10)){
|
||||
abus_v=500;
|
||||
}
|
||||
// if((hbus_v>abus_v+10)||(abus_v>hbus_v+10)){
|
||||
// abus_v=500;
|
||||
// }
|
||||
|
||||
return abus_v;
|
||||
}
|
||||
@@ -451,15 +451,15 @@ void PowerCalibration(PowerInfo_st* info_st)
|
||||
//设置总线电压
|
||||
void PowerSetVoltage(PowerInfo_st* info_st)
|
||||
{
|
||||
memcpy(&def_power_st,info_st,sizeof(PowerInfo_st));
|
||||
memcpy((void *)&def_power_st,info_st,sizeof(PowerInfo_st));
|
||||
PowerUpFilter(info_st->V_LAH_DAC);
|
||||
C_H_DAC_Set(info_st->V_LAH_DAC);
|
||||
C_M_DAC_Set(info_st->V_LAM_DAC);
|
||||
POWER_ON;
|
||||
//? 验证电压失调
|
||||
delay_ms(5);
|
||||
C_H_DAC_Set(info_st->V_LAH_DAC);
|
||||
C_M_DAC_Set(info_st->V_LAM_DAC);
|
||||
// delay_ms(5);
|
||||
// C_H_DAC_Set(info_st->V_LAH_DAC);
|
||||
// C_M_DAC_Set(info_st->V_LAM_DAC);
|
||||
}
|
||||
//获取当前电压配置值
|
||||
void PowerGetSet(PowerInfo_st* info_st)
|
||||
@@ -503,7 +503,7 @@ uint8_t PowerCalibration_set(uint16_t h_v,uint16_t m_v)
|
||||
//在现有电压列表中能够查询到校准后的电压
|
||||
if(ul_index < POWER_SET_COUNT)
|
||||
{
|
||||
memcpy(&powerinfo_st,&powerinfo_arrayst[ul_index],sizeof(PowerInfo_st));
|
||||
memcpy((void *)&powerinfo_st,(void *)&powerinfo_arrayst[ul_index],sizeof(PowerInfo_st));
|
||||
PowerSetVoltage(&powerinfo_st);
|
||||
return 0;
|
||||
}
|
||||
@@ -524,7 +524,7 @@ uint8_t PowerCalibration_set(uint16_t h_v,uint16_t m_v)
|
||||
{
|
||||
if( powerinfo_arrayst[ul_index].V_LAH_DAC == 0 || powerinfo_arrayst[ul_index].V_LAM_DAC == 0)
|
||||
{
|
||||
memcpy(&powerinfo_arrayst[ul_index],&powerinfo_st,sizeof(PowerInfo_st));
|
||||
memcpy((void *)&powerinfo_arrayst[ul_index],&powerinfo_st,sizeof(PowerInfo_st));
|
||||
break;
|
||||
}
|
||||
ul_index++;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include "base/define.h"
|
||||
#include "timer_cfg.h"
|
||||
#include "base/delay.h"
|
||||
Timerupdatefunc p_timer4update_func = NULL;
|
||||
volatile Timerupdatefunc p_timer4update_func = NULL;
|
||||
|
||||
|
||||
/*
|
||||
@@ -11,7 +11,7 @@ Timerupdatefunc p_timer4update_func = NULL;
|
||||
*/
|
||||
static volatile uint16_t amend_plus_count = 0;
|
||||
|
||||
TimerTriger p_timertriger = NULL;
|
||||
volatile TimerTriger p_timertriger = NULL;
|
||||
void FireBus_ClkAmend(uint16_t pre_us,uint16_t trigger_us,uint16_t count,void *p_fun)
|
||||
{
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
Checker_RunCfg_st checker_runcfg;
|
||||
uint8_t Checker_FacBuf[CHECKER_FAC_BUF_LEN];
|
||||
volatile uint8_t ThreeBindResult_flag = 1;
|
||||
uint16_t Checker_First_Set_Voltage = 88;
|
||||
volatile uint16_t Checker_First_Set_Voltage = 88;
|
||||
/*
|
||||
@brief 标记执行结果
|
||||
@param rtv 执行返回值 1表示失败 0 表示成功
|
||||
|
@@ -51,7 +51,7 @@ extern Checker_RunCfg_st checker_runcfg;
|
||||
#define CHECKER_FAC_BUF_LEN 50 //len+crc8+48bytes
|
||||
extern uint8_t Checker_FacBuf[CHECKER_FAC_BUF_LEN];
|
||||
extern volatile uint8_t ThreeBindResult_flag ;
|
||||
extern uint16_t Checker_First_Set_Voltage ;//方案设置内部第一个电压
|
||||
extern volatile uint16_t Checker_First_Set_Voltage ;//方案设置内部第一个电压
|
||||
/*
|
||||
@brief 标记执行结果
|
||||
@param rtv 执行返回值 1表示失败 0 表示成功
|
||||
|
@@ -753,7 +753,7 @@ void JQ_Test_EnCommEndCur(void)
|
||||
void JQ_Test_GetCommEndCur(void)
|
||||
{
|
||||
JQ_CommEnd_CurEn = 0;
|
||||
Checker_SetRtv(&JQ_CommEnd_MaxCur,checker_runcfg.rtv_count);
|
||||
Checker_SetRtv((uint16_t *)&JQ_CommEnd_MaxCur,checker_runcfg.rtv_count);
|
||||
Checker_MaskResult(0,checker_runcfg.task_info.runindex);
|
||||
}
|
||||
/*
|
||||
|
@@ -701,7 +701,7 @@ void XT_Test_EnCommEndCur(void)
|
||||
void XT_Test_GetCommEndCur(void)
|
||||
{
|
||||
XT_CommEnd_CurEn = 0;
|
||||
Checker_SetRtv(&XT_CommEndMaxCur,checker_runcfg.rtv_count);
|
||||
Checker_SetRtv((uint16_t *)&XT_CommEndMaxCur,checker_runcfg.rtv_count);
|
||||
Checker_MaskResult(0,checker_runcfg.task_info.runindex);
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
|
||||
#define BUILD_DATE "2023-10-16 09:54:53"
|
||||
#define BUILD_DATE "2023-10-16 18:50:56"
|
||||
#define SOFT_VERSION "2.00"
|
||||
|
||||
|
||||
|
@@ -19,7 +19,7 @@
|
||||
typedef struct{
|
||||
ucport_def u;
|
||||
rt_timer_t timer;
|
||||
int *host_type;// 主机接口类型0串口,1can
|
||||
// int *host_type;// 主机接口类型0串口,1can
|
||||
}slave_def;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ typedef struct{
|
||||
static slave_def *slave_creat(void)
|
||||
{
|
||||
slave_def *u=calloc(1,sizeof(slave_def));
|
||||
u->host_type=app_variable("host_if",0,0);
|
||||
//u->host_type=app_variable("host_if",0,0);
|
||||
return u;
|
||||
}
|
||||
|
||||
@@ -145,6 +145,7 @@ typedef struct{
|
||||
uint8_t cmd;
|
||||
int host_type;
|
||||
array_def *data;
|
||||
array_def *(*check_fun)(array_def *uid);
|
||||
}check_def;
|
||||
static check_def g_check;
|
||||
static void check_set_data(check_def *u,array_def *data)
|
||||
@@ -170,7 +171,9 @@ static void check_submit_later(void *t)
|
||||
static void check_later(void *t)
|
||||
{
|
||||
check_def *s=(check_def *)t;
|
||||
elec_check_with_scheme(s->data);
|
||||
if(s->check_fun){
|
||||
s->check_fun(s->data);
|
||||
}
|
||||
if(s->host_type==1)
|
||||
{
|
||||
s->submit_times=10;
|
||||
@@ -181,7 +184,7 @@ static void check_later(void *t)
|
||||
s->cmd=0;
|
||||
}
|
||||
}
|
||||
static int check_with_scheme_dolater(ucport_def *u,uint8_t cmd,array_def *data,char *err_str)
|
||||
static int check_dolater(ucport_def *u,uint8_t cmd,array_def *data,char *err_str)
|
||||
{
|
||||
slave_def *s=(slave_def *)u;
|
||||
check_def *c=&g_check;
|
||||
@@ -189,7 +192,6 @@ static int check_with_scheme_dolater(ucport_def *u,uint8_t cmd,array_def *data,c
|
||||
if(c->cmd==0){
|
||||
c->cmd=cmd;
|
||||
c->tran=s->u.p;
|
||||
c->host_type=*s->host_type;
|
||||
check_set_data(c,data);
|
||||
later_execute(check_later,c,10);
|
||||
}
|
||||
@@ -201,18 +203,37 @@ static int check_with_scheme_dolater(ucport_def *u,uint8_t cmd,array_def *data,c
|
||||
emit tran_reply_signal(u->p,arr_temp(r));
|
||||
return 0;
|
||||
}
|
||||
static ucport_def *check_with_scheme(tran_def *t, uint8_t cmd,array_def *data)
|
||||
|
||||
static ucport_def *check_self(tran_def *t, uint8_t cmd,array_def *data,
|
||||
array_def *(*fun)(array_def *))
|
||||
{
|
||||
int ret=0;
|
||||
check_def *c=&g_check;
|
||||
slave_def *u=slave_creat();
|
||||
u->u.p=t;
|
||||
u->u.del=slave_del;
|
||||
u->u.dolater=check_with_scheme_dolater;
|
||||
u->u.dolater=check_dolater;
|
||||
c->check_fun=fun;
|
||||
|
||||
u->u.dolater(&u->u,cmd,data,"ok");
|
||||
return (ucport_def *)u;
|
||||
}
|
||||
|
||||
static ucport_def *check_with_scheme(tran_def *t, uint8_t cmd,array_def *data)
|
||||
{
|
||||
check_def *c=&g_check;
|
||||
c->host_type=*(int *)app_variable("host_if",0,0);
|
||||
return check_self(t,cmd,data,elec_check_with_scheme);
|
||||
}
|
||||
transmit_export(ym_slave,0x0b,check_with_scheme)
|
||||
transmit_export(ym_slave,0x0c,check_with_scheme)
|
||||
static ucport_def *check_code(tran_def *t, uint8_t cmd,array_def *data)
|
||||
{
|
||||
check_def *c=&g_check;
|
||||
c->host_type=0;
|
||||
return check_self(t,cmd,data,elec_code);
|
||||
}
|
||||
transmit_export(ym_slave,0x17,check_code)
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user