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

📄 main.lst

📁 64x32led单元板的89s51显示控制程序,可以完成静太显示,向上平移,向右平移的动态显示.
💻 LST
📖 第 1 页 / 共 2 页
字号:
 137   1      //      P1=row_count+0x10;      
 138   1      //      P1=row_count;
 139   1              fulldata_flag=1;
 140   1              row_count++;
 141   1              if(row_count==16)row_count=0;
 142   1      }
 143          //*************************databuf 更新
 144          void full_databuf(uchar effict,uchar longth)
 145          {       
 146   1              uchar i;
 147   1              uchar *ptr;
 148   1              if(fulldata_flag==1)
 149   1              {
 150   2                      clrscree();     
 151   2                      if(effict==staticdis||effict==left)
 152   2                      {
 153   3                              for(i=0;i<18&&i<=(longth*2);i+=2)
 154   3                              {
 155   4                                      ptr=dataindex[i/2];
 156   4                                      if(ptr==0)break;
 157   4                                      databuf[i]=*(ptr+row_count*2);
 158   4                                      databuf[i+1]=*(ptr+row_count*2+1);
C51 COMPILER V7.06   MAIN                                                                  05/15/2008 16:21:15 PAGE 4   

 159   4                              }
 160   3                              if(effict==left)
 161   3                              {
 162   4                                      l_databuf(shift_add);
 163   4                              }
 164   3                      }
 165   2                      else if(effict==up)
 166   2                      {
 167   3                              for(i=0;i<18&&i<=(longth*2);i+=2)
 168   3                              {
 169   4                                      ptr=dataindex[i/2];
 170   4                                      if(ptr==0)break;
 171   4                                      if((shift_add+row_count)>15)
 172   4                                      {
 173   5                                      databuf[i]=*(ptr+134+(shift_add+row_count-15)*2);
 174   5                                      databuf[i+1]=*(ptr+134+(shift_add+row_count-15)*2+1);           
 175   5                                      }
 176   4                                      else
 177   4                                      {
 178   5                                      databuf[i]=*(ptr+(shift_add+row_count)*2);
 179   5                                      databuf[i+1]=*(ptr+(shift_add+row_count)*2+1);
 180   5                                      }
 181   4                              }               
 182   3                      }
 183   2                      fulldata_flag=0;
 184   2              }
 185   1      }
 186          void l_databuf(uchar i)//左移时数据BUF处理
 187          {
 188   1              uchar h;
 189   1              int j,k;
 190   1              if(i>=8)
 191   1              {
 192   2                      for(h=0;h<17;h++)
 193   2                      databuf[h]=databuf[h+1];
 194   2                      i-=8;
 195   2              }
 196   1              for(h=0;h<16;h++)
 197   1              {
 198   2                      j=databuf[h];
 199   2                      k=databuf[h+1];
 200   2                      j=j<<i;
 201   2                      k=k>>(8-i);
 202   2                      databuf[h]=j|k;
 203   2              }       
 204   1      }
 205          
 206          void full_index(uchar *prt,uchar effict,uchar longth)
 207          {
 208   1              uchar str1,str2;
 209   1              uchar *prt2;
 210   1              int i,j;
 211   1              if(fullindex_flag==1)
 212   1              {
 213   2                      
 214   2                      if(effict==staticdis)indexprt=prt;
 215   2                      else if(effict==up){indexprt=prt+8;longth-=4;}
 216   2                      else if(effict==left){indexprt=prt+2;longth-=1;}
 217   2                      clrindex();
 218   2                      for(i=0;i<12&&i<longth;i++,prt=prt+2)
 219   2                      {
 220   3                              str1=*prt;
C51 COMPILER V7.06   MAIN                                                                  05/15/2008 16:21:15 PAGE 5   

 221   3                              str2=*(prt+1);
 222   3                              if(str1=='\0') {disen=1;break;}
 223   3                              for(j=0;j<sizeof(GB_16)/sizeof(GB_16[0]);j++)
 224   3                              {
 225   4                                      if(str1 == GB_16[j].Index[0]&&str2 == GB_16[j].Index[1])
 226   4                                      break;
 227   4                              }
 228   3                              prt2=GB_16[j].Msk;
 229   3                              dataindex[i]=prt2;
 230   3                      }
 231   2                      
 232   2                      fullindex_flag=0;
 233   2              }               
 234   1      }
 235          void timeIRQ(void) interrupt 1
 236          {
 237   1              TH0=(65535-600)/256;
 238   1              TL0=(65535-600)%256;
 239   1              time_count++;
 240   1              if(fulldata_flag!=1)
 241   1              {
 242   2                      row_dis();
 243   2                      shift_count++;
 244   2                      if(shift_count==100)
 245   2                      {
 246   3                              shift_add++;
 247   3                              if(shift_add==16)
 248   3                              {
 249   4                                      shift_add=0;
 250   4                                      fullindex_flag=1;               
 251   4                              }                       
 252   3                      }
 253   2              }
 254   1      }
 255          
 256          void display(uchar *a,uchar effict)
 257          {
 258   1              uchar longth;
 259   1              indexprt=a;
 260   1              longth=str_longth(indexprt);
 261   1              disen=0;
 262   1              while(!disen)
 263   1              {
 264   2                      full_index(indexprt,effict,longth);
 265   2                      full_databuf(effict,longth);
 266   2              }
 267   1      }
 268          void delay_s(uint k)  // 
 269          {
 270   1              while(k!=0)
 271   1              {
 272   2                      if(time_count>=1000){time_count=0;k--;}
 273   2              }
 274   1      }
 275          uchar str_longth(uchar *a)
 276          {
 277   1              uchar i,str1;
 278   1              for(i=0;;i++,a+=2)
 279   1              {
 280   2              str1=*a;
 281   2              if(str1=='\0') return (i/2);
 282   2              }
C51 COMPILER V7.06   MAIN                                                                  05/15/2008 16:21:15 PAGE 6   

 283   1      }
 284          
 285          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   1069    ----
   CONSTANT SIZE    =    760    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     66      20
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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