| //пªÆÕË®¿Ø³ÌÐò |
| #include "stdio.h" |
| #include "stdlib.h" |
| #include "string.h" |
| #include "sp_config.h" |
| #include "sp_display.h" |
| #include "sp_data.h" |
| #include "sp_util.h" |
| #include "sp_consume.h" |
| #include "sp_communicate.h" |
| |
| static sp_pos_t POS; |
| |
| int main(void) |
| { |
| uint32 tick = 0; |
| uint32 lasttick = 0; |
| sp_cardworkstate_t cardWorkState; |
| MEMCLEAR(&POS, sizeof(POS)); |
| MEMCLEAR(&cardWorkState, sizeof(cardWorkState)); |
| sp_init(); |
| sp_key_init(); |
| Delay_ms(DELAY_TIME1s); |
| sp_load_config(&POS); |
| |
| show_home(&POS); |
| |
| while(1) |
| { |
| tick = sp_get_ticker(); |
| sp_feed_dog(); |
| sp_valve_control(); |
| sp_confirm_paymode(&POS, &cardWorkState); |
| sp_communicate(&POS); |
| if(POS.paymode == PAYMODE_QRCODE) |
| { |
| //if(tick - lasttick >= DELAY_TIME100ms) |
| //{ |
| // lasttick = tick; |
| sp_qrcode_handle(&POS, &cardWorkState); |
| //} |
| } |
| else |
| { |
| if(tick - lasttick >= DELAY_TIME100ms) |
| { |
| lasttick = tick; |
| sp_test_card_state(&POS, &cardWorkState, tick); |
| sp_card_handle(&POS, &cardWorkState); |
| } |
| } |
| } |
| } |