소스 검색

2024.06.28
版本:0904302E,
修改PL没有防住,进行了解析

Signed-off-by: gaochunhui <gaochunhui@cpyypt.cn>

gaochunhui 1 년 전
부모
커밋
cdfde687c0
3개의 변경된 파일25개의 추가작업 그리고 12개의 파일을 삭제
  1. 1 1
      App/public.h
  2. 23 10
      App/xspDataOpt.c
  3. 1 1
      Project/XspBoardPro.uvprojx

+ 1 - 1
App/public.h

@@ -7,7 +7,7 @@
 extern uint8_t g_bhavePrice;
 
 #define DEV_TYPE 0x0904
-#define APP_VERSION 0x0904302C
+#define APP_VERSION 0x0904302E
 
 
 #define BROADCAST_SN   0xFFFFFFFF // ¹ã²¥µØÖ·

+ 23 - 10
App/xspDataOpt.c

@@ -150,7 +150,7 @@ static int8_t check_segCode_first(uint8_t segcode[], Usrc7SegDa *seg, uint8_t *e
     }
     //printf("\n");
 
-    if(bpl == 0x01) goto ERROR_END;
+    if(bpl == 0x01){da = -1; goto ERROR_END;} // 说明已经是PL,
 
     if(da == 0x00){  //   考虑去掉P和L的情况
         if (sum == 0) da = -1;
@@ -181,7 +181,7 @@ ERROR_END:
         }
     }
     else if(g_logMsg.logType == LOG_TYPE_NULL){
-        if(timeout_isOut(&g_xspErrDa.timer) && flag == 1){
+        if(timeout_isOut(&g_xspErrDa.timer) && (flag == 1)){
             for(i=0;i<16;i++){
                 if(g_xspErrDa.lastsegDa[i] != g_xspErrDa.segDa[i]) {
                     memcpy(g_xspErrDa.lastsegDa,g_xspErrDa.segDa,16);
@@ -555,6 +555,7 @@ void save_record_to_flash(uint8_t recordMode)
 //    }
 
     g_xspCollDa.lastbSaveRecord = 0;
+    if(g_xspCollDa.curDisp.price > 5000) return; // 单价大于
     if((recordMode == 0x01) &&(g_xspCollDa.bcheckDa == 0) ){//
 
         if((g_xspCollDa.curDisp.amount == 888888) || (g_xspCollDa.curDisp.oil == 888888)) return;
@@ -572,7 +573,7 @@ void save_record_to_flash(uint8_t recordMode)
     {
         if((g_xspCollDa.lastDisp.amount == 888888) || (g_xspCollDa.lastDisp.oil == 888888)) return;
         if((g_xspCollDa.lastDisp.amount == 0) || (g_xspCollDa.lastDisp.oil == 0)) return ;
-        if(g_xspCollDa.lastDisp.amount == g_xspCollDa.lastDisp.oil) return;
+        //if(g_xspCollDa.lastDisp.amount == g_xspCollDa.lastDisp.oil) return; // 油量 和金额相同的
         if(g_xspCollDa.lastDisp.amount >=999999 || g_xspCollDa.lastDisp.oil>=999999) return;
         amount = g_xspCollDa.curDisp.amount - g_xspCollDa.lastDisp.amount;
         if((g_xspCollDa.curDisp.amount!=0) &&(amount>0) && (amount <50)){ // 和当前的值校正一下
@@ -831,12 +832,11 @@ void analysis_7seg_code(uint8_t _7egDa[])
         }
         else {
             if((temp.amount==0x00)&&(temp.oil==0x00)){
-                //printf("ccccccccccccccccccc\n");
-                if(g_xspCollDa.lastbSaveRecord == 0x01) {// 判断是否需要存储记录
-                    save_record_to_flash(0x00);
-                    printf("xsp change 01 save\n");
-                    g_xspCollDa.lastbSaveRecord = 0x00;
-                }
+//                if(g_xspCollDa.lastbSaveRecord == 0x01) {// 判断是否需要存储记录
+//                    save_record_to_flash(0x00);
+//                    printf("xsp change 01 save\n");
+//                    g_xspCollDa.lastbSaveRecord = 0x00;
+//                }
                 memset(&g_xspCollDa.lastDisp, 0, sizeof(dispData));
                 memset(&g_xspCollDa.curDisp, 0, sizeof(dispData));
                 g_xspCollDa.lastTick = Get_SysTick();
@@ -908,7 +908,7 @@ void analysis_7seg_code(uint8_t _7egDa[])
                 memcpy(&g_xspCollDa.lastDisp, &temp, sizeof(dispData));
                 g_xspCollDa.lastTick = Get_SysTick();  // 只有在加油时,记录时间戳
                 g_xspCollDa.curstatus = STATUS_PROG;
-                g_xspCollDa.bSaveRecode = 1;
+                //g_xspCollDa.bSaveRecode = 1;
             }
             else {
                 printf("数据查询 ");
@@ -1003,6 +1003,7 @@ void anay_7eg(void)
 {
     uint8_t i;//,j;
     uint8_t index,pos;//,bindex
+    static uint16_t  testflag = 1;
 //    dispData tempda;
 //    static uint8_t bfirst = 0;
 //    uint8_t ret = 0;
@@ -1033,6 +1034,18 @@ void anay_7eg(void)
 
     //g_7egDa[12] = 0xFE;//g_7egDa[12]&(~0x01);
     //g_7egDa[4] &= 0x3F;
+//    testflag++;
+//    if((testflag%23) == 0){
+//        g_7egDa[11]  &= 0xf2;
+//    }
+//    else if((testflag%33)==0){
+//        g_7egDa[11]  &= 0x5f;
+//    }
+//    else if((testflag%43) == 0) {
+//        g_7egDa[10]  &= 0x5f;
+//        testflag = 0x01;
+//    }
+//    g_7egDa[12] = g_7egDa[13] = g_7egDa[14] = g_7egDa[15] = 0;
     check_gun_status_to_save_record();
     analysis_7seg_code(g_7egDa);
 

+ 1 - 1
Project/XspBoardPro.uvprojx

@@ -83,7 +83,7 @@
             <RunUserProg1>1</RunUserProg1>
             <RunUserProg2>1</RunUserProg2>
             <UserProg1Name>fromelf --bin !L --output app.bin</UserProg1Name>
-            <UserProg2Name>wbjw_bin.exe -a 08018000 -d 0904 -f 3 -v 02C -r .\app.bin</UserProg2Name>
+            <UserProg2Name>wbjw_bin.exe -a 08018000 -d 0904 -f 3 -v 02E -r .\app.bin</UserProg2Name>
             <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
             <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
             <nStopA1X>0</nStopA1X>