Quellcode durchsuchen

2024.07.03
版本:0904312D,测试版本

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

gaochunhui vor 1 Jahr
Ursprung
Commit
cea443198e
3 geänderte Dateien mit 23 neuen und 17 gelöschten Zeilen
  1. 1 1
      App/public.h
  2. 21 15
      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 0x0904302E
+#define APP_VERSION 0x0904312D
 
 
 #define BROADCAST_SN   0xFFFFFFFF // ¹ã²¥µØÖ·

+ 21 - 15
App/xspDataOpt.c

@@ -132,7 +132,7 @@ static int8_t check_segCode_first(uint8_t segcode[], Usrc7SegDa *seg, uint8_t *e
         case 0x80:// 只有点的情况,不算是错误码,直接转成空即不显示
             seg->val[i] = 0x00;
             break;
-        case 0x72: case 0x38: case 0xF2: case 0xB8: // 去掉P和L的情况
+        case 0x73: case 0x38: case 0xF3: case 0xB8: // 去掉P和L的情况
             *error = 1;
             da = -1;
             bpl = 0x01;
@@ -150,9 +150,12 @@ static int8_t check_segCode_first(uint8_t segcode[], Usrc7SegDa *seg, uint8_t *e
     }
     //printf("\n");
 
-    if(bpl == 0x01){da = -1; goto ERROR_END;} // 说明已经是PL,
-
-    if(da == 0x00){  //   考虑去掉P和L的情况
+    if(bpl == 0x01){// 说明已经是PL,
+        da = -1;
+        printf("显示为___P\n");
+        goto ERROR_END;
+    }
+    else if(da == 0x00){  //   考虑去掉P和L的情况
         if (sum == 0) da = -1;
         else da = 1;
     }
@@ -822,7 +825,9 @@ void analysis_7seg_code(uint8_t _7egDa[])
                     g_xspCollDa.startToprog++;
                     g_xspCollDa.lastTick = Get_SysTick();
                 }
-                if((g_xspCollDa.startToprog > 5)||(g_xspCollDa.gunStatus==GUN_UP)){//||(g_gunStatus[0].curst==HIGHT_LOW)||(g_gunStatus[0].curst == LOW_LEVEL)
+                else g_xspCollDa.startToprog = 0;
+
+                if((g_xspCollDa.startToprog > 5)){//||((g_xspCollDa.gunStatus==GUN_UP))  //||(g_gunStatus[0].curst==HIGHT_LOW)||(g_gunStatus[0].curst == LOW_LEVEL)
                     g_xspCollDa.curstatus = STATUS_PROG; // 加油过程
                     memcpy(&g_xspCollDa.lastDisp, &temp, sizeof(dispData));
                 }
@@ -831,20 +836,21 @@ void analysis_7seg_code(uint8_t _7egDa[])
 
         }
         else {
-            if((temp.amount==0x00)&&(temp.oil==0x00)){
+//            if((temp.amount==0x00)&&(temp.oil==0x00) &&(g_xspCollDa.curstatus==STATUS_STOP)){
 //                if(g_xspCollDa.lastbSaveRecord == 0x01) {// 判断是否需要存储记录
 //                    save_record_to_flash(0x00);
 //                    printf("xsp change 01 save\n");
 //                    g_xspCollDa.lastbSaveRecord = 0x00;
+//                    g_xspCollDa.bSaveRecode = 0x00;
 //                }
-                memset(&g_xspCollDa.lastDisp, 0, sizeof(dispData));
-                memset(&g_xspCollDa.curDisp, 0, sizeof(dispData));
-                g_xspCollDa.lastTick = Get_SysTick();
-                g_xspCollDa.startTime = Get_SysTick();
-                g_xspCollDa.startToprog = 0;
-                g_xspCollDa.bcheckDa = 0;
-                g_xspCollDa.curstatus = STATUS_START; // 加油开始
-            }
+//                memset(&g_xspCollDa.lastDisp, 0, sizeof(dispData));
+//                memset(&g_xspCollDa.curDisp, 0, sizeof(dispData));
+//                g_xspCollDa.lastTick = Get_SysTick();
+//                g_xspCollDa.startTime = Get_SysTick();
+//                g_xspCollDa.startToprog = 0;
+//                g_xspCollDa.bcheckDa = 0;
+//                g_xspCollDa.curstatus = STATUS_START; // 加油开始
+//            }
         }
 
         memcpy(&g_xspCollDa.curDisp, &temp, sizeof(dispData));
@@ -901,7 +907,7 @@ void analysis_7seg_code(uint8_t _7egDa[])
         else if (g_xspCollDa.curstatus == STATUS_STOP) { // 停止后,又开始变化的,要判断一下当前的数据是继续加油还是数据的查询
             eAmount = abs((int)temp.amount - (int)g_xspCollDa.lastDisp.amount);
             eOil = abs((int)temp.oil - (int)g_xspCollDa.lastDisp.oil);
-            if ((eAmount < 100) && (eOil < 10)) {
+            if ((eAmount < 100) && (eOil < 50)) {
                 printf("加油继续........(%010u) ", Get_SysTick());
                 printf("%d,%d,%d\n", temp.amount, temp.oil, temp.price);
 

+ 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 02E -r .\app.bin</UserProg2Name>
+            <UserProg2Name>wbjw_bin.exe -a 08018000 -d 0904 -f 3 -v 12D -r .\app.bin</UserProg2Name>
             <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
             <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
             <nStopA1X>0</nStopA1X>