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