卡单次金额上限
diff --git a/supwisdom/sp_communicate.c b/supwisdom/sp_communicate.c
index ee067c4..98d6096 100644
--- a/supwisdom/sp_communicate.c
+++ b/supwisdom/sp_communicate.c
@@ -135,6 +135,10 @@
     {
       card->feepara.fee_start = (uint8)field.val.intval;
     }
+    else if(IS_KEY(PK_INT_AMOUNT_LIMIT,field.key))
+    {
+      card->amountlimit = (uint32)field.val.intval;
+    }
   }
   //disp_hint_info(pos,"Éí·ÝÈÏÖ¤³É¹¦",DELAY_TIME1s);
   return 0;
diff --git a/supwisdom/sp_communicate.h b/supwisdom/sp_communicate.h
index 8a6f59a..2885435 100644
--- a/supwisdom/sp_communicate.h
+++ b/supwisdom/sp_communicate.h
@@ -81,6 +81,7 @@
 #define PK_INT_FEESTART				"17"
 #define PK_INT_PERMIT				"18"
 #define PK_STR_LIMITMSG				"19"
+#define PK_INT_AMOUNT_LIMIT			"20"
 
 #define SP_CMD_UPGRADE 0x20         	//ÔÚÏßÉý¼¶
 #define SP_CMD_TRANSDTL_ACCOUNT 0x22    //¼ÇÕËÁ÷Ë®
diff --git a/supwisdom/sp_config.h b/supwisdom/sp_config.h
index 13375f3..a277477 100644
--- a/supwisdom/sp_config.h
+++ b/supwisdom/sp_config.h
@@ -232,8 +232,9 @@
   uint8 cardtype;
   uint8 expiredate[4];
 
-  uint16 waterlimit;		//µ¥´Î³öË®ÉÏÏÞ£¨100ml£©
-  uint32 cobillno;		//½»Ò×¶©µ¥±àºÅ,BCDÂë
+  uint16 waterlimit;		//µ¥´Î³öË®Á÷Á¿ÉÏÏÞ£¨100ml£©
+  uint16 amountlimit;		//µ¥´Î³öË®½ð¶îÉÏÏÞ (·Ö)
+  uint32 cobillno;		//½»Ò×¶©µ¥±àºÅ
   uint8	permit;			//ÊÇ·ñÔÊÐíÏû·Ñ£¬0-ÔÊÐí£¬1-²»ÔÊÐí
   char limitmsg[45];		//ÏÞÖÆÏû·ÑÐÅÏ¢
   sp_qrcode_t qrcode;	//¶þάÂë
diff --git a/supwisdom/sp_consume.c b/supwisdom/sp_consume.c
index da6ab83..5d28351 100644
--- a/supwisdom/sp_consume.c
+++ b/supwisdom/sp_consume.c
@@ -241,6 +241,7 @@
   uint16 ret;
   sp_transdtl_t record;
   MEMCLEAR(&record, sizeof(record));
+  MEMCLEAR(card,sizeof(sp_card_t));
   card->cardtype = pos->cardState.tag_type;
   MEMCPY(card->cardphyid, pos->cardState.snr, 4);
   ret = sp_card_read(card);
@@ -448,7 +449,12 @@
     }
     if(pos->purchase.paid_num > card->waterlimit)
     {
-      disp_hint_info_two(pos,"Í£Ö¹³öË®","ÒÑ´ïµ¥´Î³öË®ÉÏÏÞ",DELAY_TIME2s);
+      disp_hint_info_two(pos, "Í£Ö¹³öË®","ÒÑ´ïµ¥´Î³öË®ÉÏÏÞ", DELAY_TIME2s);
+      cardWorkState->current_state = CARDWORKSTATUS_STOPPING;
+    }
+    else if(pos->purchase.paid_sum > card->amountlimit)
+    {
+      disp_hint_info_two(pos, "Í£Ö¹³öË®","ÒÑ´ïµ¥´Î½ð¶îÉÏÏÞ", DELAY_TIME2s);
       cardWorkState->current_state = CARDWORKSTATUS_STOPPING;
     }
     cardWorkState->pause_tick = timer_get_ticker();
@@ -640,6 +646,7 @@
       break;
     }
     disp_hint_info_two(pos, "ÇëÇó¶þάÂë","ÇëÉÔµÈ...",0);
+	MEMCLEAR(&CARD,sizeof(sp_card_t));
     ret = sp_qrcode_init(pos, &CARD);
     if(ret)
     {
@@ -704,11 +711,16 @@
       cardWorkState->current_state = CARDWORKSTATUS_ERROR;
       break;
     }
-    if(pos->purchase.paid_num > CARD.waterlimit)
+    if(pos->purchase.paid_num >CARD.waterlimit)
     {
       disp_hint_info_two(pos, "Í£Ö¹³öË®","ÒÑ´ïµ¥´Î³öË®ÉÏÏÞ", DELAY_TIME2s);
       cardWorkState->current_state = CARDWORKSTATUS_STOPPING;
     }
+    else if(pos->purchase.paid_sum > CARD.amountlimit)
+    {
+      disp_hint_info_two(pos, "Í£Ö¹³öË®","ÒÑ´ïµ¥´Î½ð¶îÉÏÏÞ", DELAY_TIME2s);
+      cardWorkState->current_state = CARDWORKSTATUS_STOPPING;
+    }
     cardWorkState->last_state = cardWorkState->current_state;
     cardWorkState->pause_tick = sp_get_ticker();
     break;