|
|
@@ -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);
|
|
|
|