优化
diff --git a/supwisdom/sp_consume.c b/supwisdom/sp_consume.c
index d8e6bb1..cfa75b7 100644
--- a/supwisdom/sp_consume.c
+++ b/supwisdom/sp_consume.c
@@ -10,7 +10,6 @@
#include "sp_consume.h"
#include "sp_communicate.h"
-static uint32 count = 0;
static uint8 menu_cnt = 0;
static uint16 sp_calc_payamt_by_flowsensor(sp_pos_t* pos, sp_card_t* card)
{
@@ -34,8 +33,6 @@
return 0;
}
usedcount = sp_flowsensor_get_count()/pos->sysconf.flowsensor_unit;
- //usedcount = count/pos->sysconf.flowsensor_unit;
- count++;
if(usedcount < pos->purchase.paid_num)
{
//ûÓдﵽ¿Û·ÑÁ÷Á¿
@@ -178,23 +175,6 @@
return 0;
}
-static uint16 sp_card_valid_check(const sp_card_t* card)
-{
- uint8 ctime[6];
- /*
- if(card->cardno < 1)
- {
- return RC_CARDNO_EXCEPT;
- }
- */
- sp_get_bcdtime(ctime);
- if(memcmp(card->expiredate +1, ctime, 3) < 0)
- {
- return RC_CARD_EXPIRED;
- }
- return 0;
-}
-
static uint16 sp_check_dev(const sp_pos_t* pos)
{
uint16 ret;
@@ -238,8 +218,7 @@
ret = sp_card_read(card);
if(ret)
{
- ret = RC_CARD_INVALID;
- return ret;
+ return RC_CARD_INVALID;
}
if(pos->load_para_status)
{
@@ -256,16 +235,10 @@
return ret;
}
- ret = sp_card_valid_check(card);
- if(ret)
- {
- return ret;
- }
ret = sp_card_authentication(pos, card);
if(ret)
{
- ret = RC_CARD_AUTHENTICATION;
- return ret;
+ return RC_CARD_AUTHENTICATION;
}
ret = sp_prepare_behalf_transdtl(pos, card, &record);
if(ret)
@@ -290,7 +263,6 @@
static uint16 do_work(sp_pos_t* pos, sp_card_t* card)
{
uint16 ret;
- sp_valve_on();
//¼ÆËãÏû·Ñ½ð¶î
ret = sp_calc_payamt_by_flowsensor(pos, card);
if(ret)
@@ -335,7 +307,6 @@
}
pos->paymode = PAYMODE_INIT;
pos->sysconf.work_mode = 0;
- count = 0;
MEMCLEAR(&pos->purchase, sizeof(sp_purchase_t));
MEMCLEAR(card, sizeof(sp_card_t));
return 0;
@@ -364,7 +335,6 @@
show_error(pos,"²Ù×÷ʧ°Ü:",errcode);
pos->paymode = PAYMODE_INIT;
pos->sysconf.work_mode = 0;
- count = 0;
MEMCLEAR(&pos->purchase, sizeof(sp_purchase_t));
}
}