diff --git a/checher_slave.uvoptx b/checher_slave.uvoptx
index 30bd841..08f7f77 100644
--- a/checher_slave.uvoptx
+++ b/checher_slave.uvoptx
@@ -377,40 +377,7 @@
-
-
- 0
- 0
- 291
- 1
- 134275382
- 0
- 0
- 0
- 0
- 0
- 1
- D:\work\SVN\鍐夊窛\mcu_program\checker_slave\source\interface\if_can.c
-
- \\checker_slave_app\source/interface/if_can.c\291
-
-
- 1
- 0
- 22
- 1
- 134303466
- 0
- 0
- 0
- 0
- 0
- 1
- D:\work\SVN\鍐夊窛\mcu_program\checker_slave\source\rt_thread\core_delay.c
-
- \\checker_slave_app\source/rt_thread/core_delay.c\22
-
-
+
0
@@ -1210,7 +1177,7 @@
dev
- 0
+ 1
0
0
0
diff --git a/checher_slave.uvprojx b/checher_slave.uvprojx
index b363148..5432fa1 100644
--- a/checher_slave.uvprojx
+++ b/checher_slave.uvprojx
@@ -3627,6 +3627,57 @@
XTDriver.c
1
.\source\elec_det\driver\XTDriver.c
+
+
+ 2
+ 0
+ 0
+ 0
+ 0
+ 0
+ 2
+ 2
+ 2
+ 2
+ 11
+
+
+ 1
+
+
+
+ 2
+ 0
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 0
+ 2
+ 2
+ 2
+ 2
+ 2
+ 0
+ 0
+ 2
+ 2
+ 2
+ 2
+ 2
+
+
+
+
+
+
+
+
+
BaseChecker.c
@@ -3642,6 +3693,57 @@
XTChecker.c
1
.\source\elec_det\interface\XTChecker.c
+
+
+ 2
+ 0
+ 0
+ 0
+ 0
+ 0
+ 2
+ 2
+ 2
+ 2
+ 11
+
+
+ 1
+
+
+
+ 2
+ 0
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 0
+ 2
+ 2
+ 2
+ 2
+ 2
+ 0
+ 0
+ 2
+ 2
+ 2
+ 2
+ 2
+
+
+
+
+
+
+
+
+
EWChecker.c
@@ -5060,6 +5162,57 @@
XTDriver.c
1
.\source\elec_det\driver\XTDriver.c
+
+
+ 2
+ 0
+ 0
+ 0
+ 0
+ 0
+ 2
+ 2
+ 2
+ 2
+ 11
+
+
+ 1
+
+
+
+ 2
+ 0
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 0
+ 2
+ 2
+ 2
+ 2
+ 2
+ 0
+ 0
+ 2
+ 2
+ 2
+ 2
+ 2
+
+
+
+
+
+
+
+
+
BaseChecker.c
@@ -5075,6 +5228,57 @@
XTChecker.c
1
.\source\elec_det\interface\XTChecker.c
+
+
+ 2
+ 0
+ 0
+ 0
+ 0
+ 0
+ 2
+ 2
+ 2
+ 2
+ 11
+
+
+ 1
+
+
+
+ 2
+ 0
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 0
+ 2
+ 2
+ 2
+ 2
+ 2
+ 0
+ 0
+ 2
+ 2
+ 2
+ 2
+ 2
+
+
+
+
+
+
+
+
+
EWChecker.c
@@ -5110,6 +5314,57 @@
XTCheckerTest.c
1
.\source\elec_det\test\XTCheckerTest.c
+
+
+ 2
+ 0
+ 0
+ 0
+ 0
+ 0
+ 2
+ 2
+ 2
+ 2
+ 11
+
+
+ 1
+
+
+
+ 2
+ 0
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 0
+ 2
+ 2
+ 2
+ 2
+ 2
+ 0
+ 0
+ 2
+ 2
+ 2
+ 2
+ 2
+
+
+
+
+
+
+
+
+
elec_cmd.c
diff --git a/source/ReadMe.txt b/source/ReadMe.txt
index b5c843d..2b618fc 100644
--- a/source/ReadMe.txt
+++ b/source/ReadMe.txt
@@ -338,3 +338,8 @@
2021.2.3
充能统计添加中间值滤波
修改晶振起振超时时间和flash相关以适应gd32
+2024.3.7
+ 此日期之前的累计更新
+ V2.15 屏蔽XT相关代码、开路电流判线改为30、充能统计添加数据记录;
+ 修改写MTP任务写入数据不对的bug;
+ JQ写三码任务自动使能OTP
diff --git a/source/elec_det/elec_det.c b/source/elec_det/elec_det.c
index fc0c167..f4b01a2 100644
--- a/source/elec_det/elec_det.c
+++ b/source/elec_det/elec_det.c
@@ -69,7 +69,8 @@ typedef struct{
static self_def g_self={
.taskid_table=(uint8_t*)(APP_TEST_PLAN_ADDR+4),
- .tasks_fun_table={jqtaskArray,xttaskArray,ewtaskArray},
+ // .tasks_fun_table={jqtaskArray,xttaskArray,ewtaskArray},
+ .tasks_fun_table={jqtaskArray,0,ewtaskArray},
};
@@ -496,7 +497,9 @@ CheckerTask elec_get_task_fun(uint8_t taskid)
CheckerTask **tasks_fun_table=s->tasks_fun_table;
uint8_t chip_type=s->chip_type;
if(taskid=CHECKER_MAXID_COUNT)&&
(taskid<(CHECKER_MAXID_COUNT+CHECKER_EXTID_COUNT)))
{
@@ -621,7 +624,7 @@ array_def *elec_code(array_def *uid_psw)
return arr_temp(r);
}
elec_code_load_param(uid_psw);
- ret = XT_UID_PWD_Bind();
+ // ret = XT_UID_PWD_Bind();
arr_append(r,ret);
s->data=arr_duplicate(r);
return arr_temp(r);
diff --git a/source/elec_det/elec_judge.c b/source/elec_det/elec_judge.c
index 42fe458..906fe07 100644
--- a/source/elec_det/elec_judge.c
+++ b/source/elec_det/elec_judge.c
@@ -410,7 +410,7 @@ void elec_judge(elec_judge_def *e,int task_num,uint8_t *exe_ack,
e->judge_fun_table=g_judge_fun_table[elec_extract_chip(e->scheme->plan_id)];
e->judge_fun_num=elec_calc_judge_fun_num(e->judge_fun_table);
e->short_circuited=1500;
- e->open_circuited=80;
+ e->open_circuited=30;
e->exe_ack=exe_ack;
if(task_num>e->scheme->task_num)
task_num=e->scheme->task_num;
diff --git a/source/elec_det/hardware/adc_cfg.c b/source/elec_det/hardware/adc_cfg.c
index a65cfcd..4d753f9 100644
--- a/source/elec_det/hardware/adc_cfg.c
+++ b/source/elec_det/hardware/adc_cfg.c
@@ -6,6 +6,7 @@
#include "power.h"
#include "filter.h"
#include "core_delay.h"
+#include "debug.h"
volatile uint16_t ad0_adc_sample[AD_SCAN_SAMPLE*AD_SCAN_COUNT];
#define ADC1_SAMPLE_BUF_LEN 200
@@ -447,13 +448,12 @@ uint16_t AD_CurMonitor_(uint32_t ul_times)
-
/*rc{
使用过滤算法的充能统计
这个函数给出的都是adc原始值
sample_timeout 单位是0.1ms
}*/
-uint16_t AD_GetChgEnergy(uint16_t sample_timeout, uint16_t end_adv,uint16_t* max_cul,uint16_t *shake_adv)
+uint16_t AD_GetChgEnergy_(uint16_t sample_timeout, uint16_t end_adv,uint16_t* max_cul,uint16_t *shake_adv)
{
uint16_t adc_max = 0;
uint16_t adc_temp,adc_shake=0;
@@ -470,9 +470,12 @@ uint16_t AD_GetChgEnergy(uint16_t sample_timeout, uint16_t end_adv,uint16_t* max
do{
adc_value=adc_get_value(ADC_CURR_DE);
adc_start(ADC_CURR_DE);
-// adc_value = GetADC_Fast(ADC_CURR_DE);
+ DBG_LOG("adc_value=%d",adc_value);
filter_insert(&f,adc_value);
filter_value=filter_get_head(&f);
+ if(adc_max 0) && ( ADC_GetFlagStatus(ADC_CURR_DE,ADC_FLAG_EOC) == RESET))
-// {
-// time_out--;
-// }
-// aus_adc_v[us_count] = ADC_GetConversionValue(ADC_CURR_DE) & 0x0FFF;
+ time_out = 2000;
+ while((time_out > 0) && ( ADC_GetFlagStatus(ADC_CURR_DE,ADC_FLAG_EOC) == RESET))
+ {
+ time_out--;
+ }
+ aus_adc_v[us_count] = ADC_GetConversionValue(ADC_CURR_DE) & 0x0FFF;
aus_adc_v[us_count] = GetADC_Fast(ADC_CURR_DE);
aus_adv_shake[us_shake_count] = aus_adc_v[us_count];
-// ADC_ClearFlag(ADC_CURR_DE,ADC_FLAG_EOC);//清除转换结束标志
-// ADC_SoftwareStartConvCmd(ADC_CURR_DE, ENABLE); //启动转换
+ ADC_ClearFlag(ADC_CURR_DE,ADC_FLAG_EOC);//清除转换结束标志
+ ADC_SoftwareStartConvCmd(ADC_CURR_DE, ENABLE); //启动转换
us_count++;
us_shake_count++;
us_count %= 5;
@@ -602,6 +608,9 @@ uint16_t AD_GetChgEnergy_(uint16_t sample_timeout, uint16_t end_adv,uint16_t* ma
if(us_count == 0)
{
Bubble_Sort_u16(aus_adc_v,5);
+ if(g_adc_value_index<1023){
+ g_adc_values[g_adc_value_index++]=aus_adc_v[2];
+ }
if((aus_adc_v[0] > end_adv) && start_flag == 0)
{
start_flag = 1;
@@ -610,26 +619,36 @@ uint16_t AD_GetChgEnergy_(uint16_t sample_timeout, uint16_t end_adv,uint16_t* ma
//连续5个都大于判线值
else if(start_flag >0 )
{
- if(*max_cul < aus_adc_v[2])
- {
- *max_cul = aus_adc_v[2];
- }
+ if(*max_cul < aus_adc_v[2])
+ {
+ *max_cul = aus_adc_v[2];
+ }
if(aus_adc_v[4] < end_adv)
{
LED1_Out = 0;
- return Get100usCount();
+ time_cost =Get100usCount();
+ goto end;
}
}else if(start_flag == 0)
{
if(GetCountTimerCnt() > 10000)
{
- return 0;
+ time_cost =0;
+ goto end;
}
}
}
}
- return 40000;
+ time_cost=sample_timeout+1;
+ end:
+ // if(time_cost<10){
+ DBG_LOG("adc_value num=%d",g_adc_value_index);
+ for(int i=0;i