Quellcode durchsuchen

2024.06.18

Signed-off-by: gaochunhui <gaochunhui@cpyypt.cn>
gaochunhui vor 1 Jahr
Ursprung
Commit
a2771ece97
3 geänderte Dateien mit 11 neuen und 3 gelöschten Zeilen
  1. 1 1
      App/public.h
  2. 9 1
      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 0x0904302A
+#define APP_VERSION 0x0904302B
 
 
 #define BROADCAST_SN   0xFFFFFFFF // ¹ã²¥µØÖ·

+ 9 - 1
App/xspDataOpt.c

@@ -85,11 +85,13 @@ static int8_t check_segCode(uint8_t segcode,uint8_t *error)
 static int8_t check_segCode_first(uint8_t segcode[], Usrc7SegDa *seg, uint8_t *error)
 {
     int8_t da = 0x00;
-    uint8_t i = 0;
+    uint8_t i = 0,bpl = 0x00;
     uint16_t sum = 0;
     static uint8_t flag = 0;
 
     g_xspCollDa.bcorrect = 0;
+
+    bpl = 0x00;
     for (i = 0; i < 16; i++) {
         switch (segcode[i]) {
         case 0x3E: case 0x3B: case 0x37: case 0x1F:  *error = 1;
@@ -133,6 +135,7 @@ static int8_t check_segCode_first(uint8_t segcode[], Usrc7SegDa *seg, uint8_t *e
         case 0x72: case 0x38: case 0xF2: case 0xB8: // 去掉P和L的情况
             *error = 1;
             da = -1;
+            bpl = 0x01;
             break;
         case 0x00: // 处理没有显示的数据
             seg->val[i] = segcode[i];
@@ -146,11 +149,15 @@ static int8_t check_segCode_first(uint8_t segcode[], Usrc7SegDa *seg, uint8_t *e
         //printf("%02x,",segcode[i]);
     }
     //printf("\n");
+
+    if(bpl == 0x01) goto ERROR_END;
+
     if(da == 0x00){  //   考虑去掉P和L的情况
         if (sum == 0) da = -1;
         else da = 1;
     }
 
+
     if(*error == 0x00) return da;
 ERROR_END:
     for(i=0;i<16;i++){
@@ -800,6 +807,7 @@ void analysis_7seg_code(uint8_t _7egDa[])
 
         ret = get_data_from_7segCode(src7Da, &temp);
         if(ret == 0) goto ERROR_END;
+        if(((temp.oil == 0x00) && (temp.amount!= 0x00))||((temp.oil!=0)&&(temp.amount==0))) return;
         tampTime = Get_SysTick()-g_xspCollDa.lastcomTick;
         g_xspCollDa.lastcomTick  = Get_SysTick();
         if ((g_xspCollDa.curstatus == STATUS_START) ) {

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