⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yibiao.c

📁 这是我在我们公司做的C51加油单片机程序
💻 C
📖 第 1 页 / 共 5 页
字号:
#pragma large
#include "reg52.h"
#include <intrins.h>
#include <absacc.h>
#include <string.h>
#include <ctype.h>
#include <c:\comm_d\comm_pub.H>
#include <c:\comm_d\Jl2key.h>
#include <c:\comm_d\yibiao_p.h>
#include <c:\comm_d\zk.h>
typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned char uchar;
typedef unsigned long nlong;
main()
{
 /*********主程序开始**********/

    bit debug=0;
    unsigned char xdata pd=0,i;
    unsigned int xdata abc;
    unsigned char car_num=0;
    bit car_kk=0;
    uchar xdata yy3;
skdf:
   SP=0x90;
   WP=1;
   ZK_CS=1;
   dog();
   XBYTE[0xc007]=1;
   dl(2000);
   dog();
   init();
   zderror=0;
   init_xs();
        for(i=0;i<8;i++)
	{
		clr_hang(i);
	}
   dog();

   read_main(flash,10,1859,0);
   if ((flash[0]==0xff)&&(flash[1]==0xff)&&(flash[2]==0xff)&&(flash[3]==0xff)&&(flash[4]==0xff)&&(flash[5]==0xff))
   {
          goto cshcc;
   }
   else
   {

        dog();
        read_main(flash,10,1860,0);
        if ((flash[0]==0xff)&&(flash[1]==0xff)&&(flash[2]==0xff)&&(flash[3]==0xff)&&(flash[4]==0xff)&&(flash[5]==0xff))
        {
 cshcc:               xs_hhz(0,0,CXYX);
                xs_hhz(2,0,JYJCSH);
                dog();
               for(abc=0;abc<100;abc++)
                       ashram[abc]=0;
               for(abc=0;abc<263;abc++)
                       flash[abc]=0;

               // we_main(flash,263,1859,0);
               // we_main(flash,263,1860,0);
                for(abc=0;abc<103;abc++)
                  we_main(flash,263,1859+abc,0);
                for(abc=0;abc<10;abc++)
                       we_main(flash,263,2000+abc,0);
                we_main(flash,263,999,0);
                dog();
                we_main(flash,200,1962,0);
	        we_main(flash,2,3076,0);
	        we_main(flash,2,1028,0);
	        we_main(flash,2,1041,0);  /*debug*/
                dog();
	        we_main(flash,2,1053,0);
	        we_main(flash,2,1855,0);
                dog();
                we_main(flash,2,1857,0);
                we_main(flash,2,1856,262);

                we_main(flash,263,1027,0);
                we_main(flash,263,1040,0);

                we_main(flash,263,1026,0);

                we_main(flash,263,1025,0);
        }
   }
   clear();
   comm_status=0;
   ssfl=0;
   dyjy=0;
   xs_hhz(0,0,XTCSH1);
   xs_hhz(2,0,XTCSH2);
   abc=0;
   pddc=0;

huakuang(6,8,0);
   cuorse(10);
    dl(2000);
   while(1)
   {
        dey=send_jl(1,0xa0);
        if (dey==0)
        {
              youjia[0]=rekk[0];
              youjia[1]=rekk[1];
          break;
        }
        abc++;
        if (abc==100)
           break;
   }
   cuorse(40);
   dl(600);
   cuorse(90);
   power_init();
   //if (power_init())
   //{
       // clear();
       // xs_hhz(0,0,SJDS);
       // xs_hhz(2,0,XTCSHCC);
   // }
   yp_download_flag=0;/*油价修改标志清0*/
   cuorse(123);
   dog();
   clear();
   xs_hhz(0,0,XTZJ1);
   xs_hhz(2,0,XTZJ2);
   huakuang(6,8,0);
   cuorse(10);
   if (SKFSIC==0)
      psam1_reset();
   dog();
   getVer();

   cuorse(40);
   if (SKFSIC==0)
   {
        card_err_state=read_psam_0015_file();
        if (card_err_state!=0)
        {
                clear();
                xs_hhz(0,8,PSAMER);
                an_key_back();
                goto skdf;
        }
        we_main(psam0015file,10,2000,0);
   }
   cuorse(90);
   dl(500);
   de30ms();
    if (SKFSIC==0)
   {
   card_err_state=rd_terminal();
   if (card_err_state!=0)
   {
        clear();
        xs_hhz(0,8,PSAMER);
        an_key_back();
        goto skdf;
   }
   select_psam_pse();
   }
   cuorse(123);
   lw:
   clear();
   XTLW_F=1;
   xs_hhz(0,0,XTLW1);
   xs_hhz(2,0,XTLW2);
   huakuang(6,8,0);
   cuorse(10);
   dog();
   while(1)
   {
        main_comm();
        if (COMM_CS==3)
        {
            clear();
            xs_hhz(0,0,LWSB1);
            xs_hhz(2,0,LWSB2);
            while(1)
            {
                key=getkey();
                if (key=='k')
                {
                        NET=1;
                        //timesz();
                        goto  start1;
                }
                if (key=='l')
                {
                   COMM_CS=0;
                   goto lw;
                }
                dog();
            }
        }
        if (XTLW_F==0)
        {
           NET=0;
           break;
        }
   }
   cuorse(40);
   dl(600);
   cuorse(90);
   dl(500);
   cuorse(123);
   dog();

 zdsend=0;
 ljgdj=0;
 start1:
      clear();
      huakuang(6,8,0);
      if (NET)
         xs_shu(6,4,(yi_1+192),1);
start:
   //menu_2();
   xs_time();
   clear();
   if (SKFSIC==1)
   {
      while(1)
      {
                xs_time();
                ygkjycz(0);
      }
   }

   if (veraa[6]==0)
   {
        clear();
        xs_hhz(2,8,YZTYXX);
        while (1)
        {
                getVer();
                dog();
                if (veraa[6]!=0)
                {
                  zhan_msg_change();
                  break;
                }
                xs_time();
        }
   }
   else
   {
        zhan_msg_change();
   }
   flash[0]=0xfa;
   flash[1]=0xff;
   trade_record_flash(flash);
   read_main(flash,100,1040,0);
   if (flash[17]=='s')
   {
   use_pse_inf[10]=flash[0];
   use_pse_inf[11]=flash[1];
   use_pse_inf[12]=flash[2];
   use_pse_inf[13]=flash[3];
   use_pse_inf[14]=flash[4];
   use_pse_inf[15]=flash[5];
   use_pse_inf[16]=flash[6];
   use_pse_inf[17]=flash[7];
   use_pse_inf[18]=flash[8];
   use_pse_inf[19]=flash[9];
   balance[0]=flash[10];
   balance[1]=flash[11];
   balance[2]=flash[12];
   balance[3]=flash[13];
   yx=flash[14];
   ygmm[0]=flash[15];
   ygmm[1]=flash[16];
   yjsb=1;
   ck_flag=1;
   goto j311;
   }
   pd=0;/*记录密码验证的次数*/
   zdrenum=0;
   clear();
   car_num=0;
   xs_hhz(0,40,JYS);
   xs_hhz(2,0,FR);
   xs_hhz(4,16,ICK);
   while(1)
   {
           key=getkey();
           i=XBYTE[0xc010];
           if ((i&0x04)==0x04)
           {
               card_err_state=use_reset();  /*插卡后,用户卡复位*/
               if (card_err_state!=0)
               {
                        clear();
                        dog();
                        xs_hhz(2,32,FJYK);
                        key=0xff;
                        while(1)
                        {
                                dog();
                                jiao=1;
                                key=getkey();
                                if (key!=0xff)
                                {
                                    out_card();
                                    goto start;
                                }
                                xs_time();
                        }
               }
               card_err_state=read_use_list(1);/*读第一条记录*/
               if (card_err_state!=0)
               {
                       kybc();
                       goto start;
               }
               for(i=0;i<12;i++)
               {
                     use_sel_adf_name[i]=uselistfile[i+4];
               }

               card_err_state=select_pse();/*选择应用*/
               if (card_err_state!=0)
               {
                       kybc();
                       goto start;
               }
               if (card_init())
               {
                        out_card();
                        goto start;
               }
               /*now_time[0]=0x20;
               now_time[1]=year;
               now_time[2]=month;
               now_time[3]=day;
               card_time[0]=use_pse_inf[24];
               card_time[1]=use_pse_inf[25];
               card_time[2]=use_pse_inf[26];
               card_time[3]=use_pse_inf[27];*/
               //判断卡是否过期
               card_err_state=read_use_001b_file();/*读'27'文件*/
               if (card_err_state!=0)
               {
                       kybc();
                       goto start;
               }
               if (use_pse_inf[12]==0x02)
               {
                      menu_2();  /*插入管理卡*/
                      out_card();
                      goto start;
               }
               if (use_pse_inf[12]!=0x04)
               {
                   clear();
                   xs_hhz(2,32,FYGK);
                   while(1)
                   {
                        key=getkey();
                        if (key=='t')
                        {
                           out_card();
                           break;
                        }
                        xs_time();
                        jiao=1;
                   }
                   goto start;
               }
               yx=use_001b_file[1];
               ygmm[0]=use_001b_file[2];
               ygmm[1]=use_001b_file[3];
               break;
           }
           if (key!=0xff)
           {
                debug=1;
                clear();
                xs_hhz(2,20,JYJXB);
           }
           if (debug==1)
              dey++;
           car_num++;
           if (dey>40)
           {
                 clear();
                 xs_hhz(0,40,JYS);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -