测量阻值是5是返回校准值

升级用的延时改为delay_os_ms
This commit is contained in:
ranchuan
2023-12-28 13:44:25 +08:00
parent d22fdc1ccb
commit c676f81758
4 changed files with 55 additions and 21 deletions

View File

@@ -153,7 +153,24 @@
<Name></Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>185</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>.\source\rt_thread\libcpu\arm\cortex-m3\context_rvds.S</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
<Ww>
<count>0</count>
@@ -299,7 +316,7 @@
<OPTFL>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget>
<IsCurrentTarget>0</IsCurrentTarget>
</OPTFL>
<CpuCode>18</CpuCode>
<DebugOpt>
@@ -381,18 +398,18 @@
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>100</LineNumber>
<LineNumber>185</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134265794</Address>
<Address>134234652</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\interface\JQChecker.c</Filename>
<Filename>.\source\rt_thread\libcpu\arm\cortex-m3\context_rvds.S</Filename>
<ExecCommand></ExecCommand>
<Expression>\\checker_slave_app\source/elec_det/interface/JQChecker.c\100</Expression>
<Expression>\\checker_slave_app\source/rt_thread/libcpu/arm/cortex-m3/context_rvds.S\185</Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
@@ -540,7 +557,7 @@
<OPTFL>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>0</IsCurrentTarget>
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
<CpuCode>18</CpuCode>
<DebugOpt>
@@ -635,6 +652,22 @@
<ExecCommand></ExecCommand>
<Expression>\\checker_slave_app\source/rt_thread/board.c\108</Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>185</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>.\source\rt_thread\libcpu\arm\cortex-m3\context_rvds.S</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
<Ww>

View File

@@ -154,6 +154,7 @@ void Checker_ResistorSample(void)
case 2: us_resistor = aus_sample[2];break;
case 3: us_resistor = aus_sample[3];break;
case 4: us_resistor = aus_sample[4];break;
case 5: us_resistor = board_st.resistor_diff;break;
default : us_resistor = 0;break;
}
Checker_MaskResult(0,checker_runcfg.task_info.runindex);

View File

@@ -39,7 +39,7 @@ static uint8_t EW_bootErease(void)
uint8_t read[4]={0};
uint8_t ret=0;
DMod_SendBytesXor(data,2,1);
delay_ms(50);
delay_os_ms(50);
ret=DMod_ReadBytesXor(read,4,100);
DBG_LOG("ret=%d,dat=%02x,%02x,%02x,%02x,",ret,read[0],read[1],read[2],read[3]);
return ret;
@@ -245,7 +245,7 @@ commend_export(jwt_app_commtest,cmd_jwt_app_commtest,"jwt commtest in app")
static void EW_appRunBoot(void)
{
EW_Charge(1,0,0);
delay_ms(6000);
delay_os_ms(6000);
EW_RunBootLoader(1,1);
DBG_LOG("run boot");
}
@@ -279,7 +279,7 @@ typedef struct{
int EW_HardReset(ew_updata_def *e)
{
EW_BUS_OFF;
delay_ms(e->time_poweroff);
delay_os_ms(e->time_poweroff);
EW_BUS_ON;
return 0;
}
@@ -290,14 +290,14 @@ int EW_HardReset(ew_updata_def *e)
int EW_CheckState(ew_updata_def *e)
{
uint16_t ret=0;
delay_ms(100);
delay_os_ms(100);
ret=EW_bootCharg();
if(ret==0){
delay_ms(e->time_charg);
delay_os_ms(e->time_charg);
e->state=1;
}else{
EW_HardReset(e);
delay_ms(e->time_loadapp);
delay_os_ms(e->time_loadapp);
ret=EW_appCommTest();
delay_ms(5);
if(ret==0){
@@ -319,7 +319,7 @@ static int EW_TurnToBoot1(ew_updata_def *e)
EW_EnWriteMTP(0,1);
delay_ms(5);
EW_RunBootLoader(0,0);
delay_ms(500);
delay_os_ms(500);
if(EW_bootCharg()==0)
return 0;
else
@@ -410,7 +410,7 @@ void EW_Updata(void)
DBG_LOG("erase app");
ret=EW_bootErease();
if(ret) {ret=2;goto err;}
delay_ms(600);
delay_os_ms(600);
while(len>0){
pack_len=len>UPDATA_PACK_LEN?UPDATA_PACK_LEN:len;
LED1_Out=!LED1_Out;
@@ -428,10 +428,10 @@ void EW_Updata(void)
DBG_LOG("module crc:0x%04x.",crc_module);
if(ret) {ret=4;goto err;}
if(crc!=crc_module){ret=5;goto err;}
delay_ms(50);
delay_os_ms(50);
ret=EW_bootJump();
if(ret) {ret=6;goto err;}
delay_ms(ew_updata.time_loadapp);
delay_os_ms(ew_updata.time_loadapp);
ret=EW_EnWriteMTP(0,1);
if(ret) {ret=7;goto err;}
DBG_LOG("EW_EnWriteMTP success.");
@@ -440,7 +440,7 @@ void EW_Updata(void)
ret=EW_WriteMTP(1,(uint8_t)(UPDATA_FLAG_ADDR/4),UPDATA_FLAG,4);
if(ret) {ret=8;goto err;}
DBG_LOG("EW_WriteMTP success.");
delay_ms(20);
delay_os_ms(20);
ret=EW_ReadMTP(1,(uint8_t)(UPDATA_FLAG_ADDR/4),read_buf,4);
if(ret) {ret=9;goto err;}
if(memcmp(read_buf,UPDATA_FLAG,4)!=0){
@@ -450,9 +450,9 @@ void EW_Updata(void)
DBG_LOG("EW_ReadMTP check success.");
delay_ms(5);
XTBUS_OFF;
delay_ms(ew_updata.time_poweroff);
delay_os_ms(ew_updata.time_poweroff);
XTBUS_ON;
delay_ms(ew_updata.time_loadapp);
delay_os_ms(ew_updata.time_loadapp);
ret=EW_appCommTest();
if(ret) {ret=11;goto err;}
DBG_LOG("EW_appCommTest success.");

View File

@@ -6,7 +6,7 @@
#define BUILD_DATE "2023-12-26 17:20:22"
#define BUILD_DATE "2023-12-27 11:39:17"
#define SOFT_VERSION "2.10"