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

📄 ch_frame.lst

📁 单片机C源程序souce
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.06   CH_FRAME                                                              11/20/2006 17:07:19 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE CH_FRAME
OBJECT MODULE PLACED IN ch_frame.OBJ
COMPILER INVOKED BY: E:\keil\C51\BIN\C51.EXE ch_frame.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          /**************************************
   2          File          :  CH_FRAME.C
   3          Project       :  BDTRV20_MCU_V07
   4          Description   :  分解DSP输出的各帧,提取并存储参数
   5          Created       :  2006.11.7
   6          Last updata   :  
   7          Author        :  Sunzehui   sunzehui@zzvcom.com
   8          Compile Tool  :  Keil uVision2
   9          Target Device :  SST89V564RD
  10          Circuit Board :  BD7700
  11          ************************************
  12          Modification History
  13          ************************************
  14           Version      : v2.0
  15           Date         : MM/DD/YYYY
  16           Modifier     :
  17           Description  :
  18          
  19           **********************************
  20           -- Copyright (c)
  21          *************************************/
  22          
  23          #include <string.h>
  24          
  25          #include "ext_temp.h"
  26          //extern unsigned long asc_to_long(unsigned char *p,bit m);
  27          extern unsigned char asc_to_char(unsigned char a1,unsigned char a2,bit m);
  28          extern unsigned char fromasc(unsigned m);
  29          extern unsigned long tosec(unsigned char hour, unsigned char min, unsigned char sec, unsigned char date, u
             -nsigned char mon, unsigned int year);
  30          extern unsigned char *sectodata(unsigned long tod);
  31          extern send_lp_dsp(void);
  32          extern SendDSP(void);
  33          extern send_lla(void); 
  34          extern send_ofs(void);
  35          extern wdt(void);
  36          
  37          extern ch_frame(void)
  38                  {
  39   1              unsigned char temp,i;//,tmp,b[8];
  40   1              unsigned char *point;
  41   1              unsigned long  xdata p,tmp,lp_sec_tmp; 
  42   1               
  43   1          wdt();
  44   1              if (sdata[3]=='Z'&&sdata[4]=='D'&&sdata[5]=='A') //$BDZDA帧
  45   1                      {
  46   2                      //temp=(sdata[7]-0x30)*10;
  47   2                      //hour=temp+(sdata[8]-0x30);//提取小时
  48   2                      hour=asc_to_char(sdata[7],sdata[8],0);
  49   2      
  50   2                      //temp=(sdata[9]-0x30)*10;
  51   2                      //min=temp+(sdata[10]-0x30);//提取分钟
  52   2                      min=asc_to_char(sdata[9],sdata[10],0);
  53   2      
  54   2                      //temp=(sdata[11]-0x30)*10;
C51 COMPILER V7.06   CH_FRAME                                                              11/20/2006 17:07:19 PAGE 2   

  55   2                      //sec=temp+(sdata[12]-0x30);//提取秒
  56   2                      sec=asc_to_char(sdata[11],sdata[12],0);
  57   2      
  58   2                      //temp=(sdata[17]-0x30)*10;
  59   2                      //day=temp+(sdata[18]-0x30);//提取天
  60   2                      day=asc_to_char(sdata[17],sdata[18],0);
  61   2      
  62   2      
  63   2                      //temp=(sdata[20]-0x30)*10;
  64   2                      //month=temp+(sdata[21]-0x30);//提取月
  65   2                      month=asc_to_char(sdata[20],sdata[21],0);
  66   2      
  67   2                      year=(sdata[23]-0x30)*1000+(sdata[24]-0x30)*100+(sdata[25]-0x30)*10+(sdata[26]-0x30);//提取年
  68   2                      //year=year+100;//only for test 2000
  69   2                      
  70   2                      /******************得到秒值************************************************/
  71   2                      if (channel_sta_2&0x40==0x40)
  72   2                              {       
  73   3                              p = tosec(hour,min,sec,day,month,year); //BD时间秒值
  74   3                              
  75   3                              /*if (UTC_mode_fg==1)//UTC模式
  76   3                          {
  77   3                                   if ((cur_lp_sec==0&&fur_lp_sec==0)||(cur_lp_sec!=0&&(fur_lp_sec-cur_lp_sec==1)))//有正闰秒或无闰秒
  78   3                                            cur_time_sec=p+UTC_sec;
  79   3                                       else
  80   3                                           cur_time_sec=p-UTC_sec;
  81   3                           }
  82   3                              else //GPS模式
  83   3                                 {*/
  84   3                                 tmp=gmth*3600+gmtm*60;
  85   3                                      if ((cur_lp_sec==0&&fur_lp_sec==0)||(cur_lp_sec!=0&&(fur_lp_sec-cur_lp_sec==1))) //有正闰秒或无闰秒
  86   3                                         {
  87   4                                         if (gmts==0x00)//GMT符号为正
  88   4                                           cur_time_sec=p+tmp;// //cur_time = (gps0+gmt=bds-13-pp-8*3600)+gmt = bds-pp+gmt-28813
  89   4                                         else if(gmts==0xff)//GMT符号为负
  90   4                                           cur_time_sec=p-tmp;//
  91   4                                         cur_time_sec-= 28800;
  92   4                        // cur_time_sec = cur_time_sec + UTC_sec;
  93   4                                         if (UTC_mode_fg==0) //GPS模式
  94   4                                            {
  95   5                                                cur_time_sec = cur_time_sec + UTC_sec - 13;
  96   5                                                }
  97   4                                         }
  98   3                                      else if(cur_lp_sec !=0&&(fur_lp_sec-cur_lp_sec==-1))//有负闰秒
  99   3                                         {
 100   4                                         if (gmts==0x00)
 101   4                                           cur_time_sec=p+tmp;//-UTC_sec;  //cur_time = (gps0+gmt=bds-13-pp-8*3600)+gmt = bds-pp+gmt-28813
 102   4                                         else if(gmts==0xff)
 103   4                                           cur_time_sec=p-tmp;//-UTC_sec;
 104   4                                         cur_time_sec -= 28800;
 105   4                                         //cur_time_sec = cur_time_sec - UTC_sec;
 106   4                                         if (UTC_mode_fg==0) //GPS模式
 107   4                                            {
 108   5                                                cur_time_sec=cur_time_sec - UTC_sec - 13;
 109   5                                                }
 110   4                                         }
 111   3                                 
 112   3                      /******************************************************************/
 113   3                      //重新得到年月日时分秒
 114   3                      /*******************************************************************/
 115   3                              point=sectodata(cur_time_sec);
 116   3                              hour =*point++; //时
C51 COMPILER V7.06   CH_FRAME                                                              11/20/2006 17:07:19 PAGE 3   

 117   3                              min =*point++;  //分
 118   3                              sec =*point++;  //秒

⌨️ 快捷键说明

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