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

📄 debug.lst

📁 51单片机C语言常用模块与综合系统设计实例精讲
💻 LST
📖 第 1 页 / 共 3 页
字号:
 168   6                                              }
 169   5                                      }
 170   4                                      else if(!strcmp(dbcmd[0],"ry")){
 171   5                                              SD2000_read_time(&rtc);
 172   5                                              printk(" year=%bx",rtc.year);
 173   5                                              printk(" month=%bx",rtc.month);
 174   5                                              printk(" dayom=%bx",rtc.dayom);
 175   5                                              printk(" week=%bx",rtc.week);
 176   5                                              printk(" hour=%bx",rtc.hour);
 177   5                                              printk(" minute=%bx",rtc.minute);//becuase it is bcd code.
 178   5                                      }
 179   4                                      else if(!strcmp(dbcmd[0],"rh")){
C51 COMPILER V7.06   DEBUG                                                                 10/10/2006 14:03:22 PAGE 4   

 180   5                                              SD2000_read_hour(&rtc);
 181   5                                      }
 182   4                                      else if(!strcmp(dbcmd[0],"h24")){//24 hour
 183   5                                              SD2000_set_status(0x02);//24hour 1HZ interrupt.
 184   5                                      }
 185   4                                      else if(!strcmp(dbcmd[0],"rtcsta")){//
 186   5                                              ch=xatouc(dbcmd[1]);
 187   5                                              SD2000_set_status(ch);
 188   5                                              printk(" rtcsta=%bx.",ch);
 189   5                                      }
 190   4                                      else if(!strcmp(dbcmd[0],"h12")){//12 hour
 191   5                                      }
 192   4                                      else if(!strcmp(dbcmd[0],"year")){
 193   5                                              if(argc==2){    
 194   6                                                      intnum=atoi(dbcmd[1]);
 195   6                                                      intnum %=100;
 196   6                                                      ch=(unsigned char )intnum;
 197   6                                                      if(ch<99){
 198   7                                                              rtc.year=chtobcd(ch);
 199   7                                                              SD2000_set_time(&rtc);
 200   7                                                              printk("\n Set year=%c ok.",ch);
 201   7                                                      }
 202   6                                              }
 203   5                                      }
 204   4                                      else if(!strcmp(dbcmd[0],"month")){
 205   5                                              if(argc==2){    
 206   6                                                      intnum=atoi(dbcmd[1]);
 207   6                                                      ch=(unsigned char )intnum;
 208   6                                                      if(ch<13){
 209   7                                                              rtc.month=chtobcd(ch);
 210   7                                                              SD2000_set_time(&rtc);
 211   7                                                              printk("\n Set month=%c ok.",ch);
 212   7                                                      }
 213   6                                              }
 214   5                                      }
 215   4                                      else if(!strcmp(dbcmd[0],"day")){
 216   5                                              if(argc==2){    
 217   6                                                      intnum=atoi(dbcmd[1]);
 218   6                                                      ch=(unsigned char )intnum;
 219   6                                                      if(ch<32){
 220   7                                                              rtc.dayom=chtobcd(ch);
 221   7                                                              SD2000_set_time(&rtc);
 222   7                                                              printk("\n Set day=%c ok.",ch);
 223   7                                                      }
 224   6                                              }
 225   5                                      }
 226   4                                      else if(!strcmp(dbcmd[0],"hour")){
 227   5                                              if(argc==2){    
 228   6                                                      intnum=atoi(dbcmd[1]);
 229   6                                                      ch=(unsigned char )intnum;
 230   6                                                      if(ch<24){
 231   7                                                              rtc.hour=chtobcd(ch);
 232   7                                                              SD2000_set_time(&rtc);
 233   7                                                              printk("\n Set hour=%c rtc.hour=%bx ok.",ch,rtc.hour);
 234   7                                                      }
 235   6                                              }
 236   5                                      }
 237   4                                      else if(!strcmp(dbcmd[0],"minute")){
 238   5                                              if(argc==2){    
 239   6                                                      intnum=atoi(dbcmd[1]);
 240   6                                                      ch=(unsigned char )intnum;
 241   6                                                      if(ch<60){
C51 COMPILER V7.06   DEBUG                                                                 10/10/2006 14:03:22 PAGE 5   

 242   7                                                              rtc.minute=chtobcd(ch);
 243   7                                                              SD2000_set_time(&rtc);
 244   7                                                              printk("\n Set minute=%c ok.",ch);
 245   7                                                      }
 246   6                                              }
 247   5                                      }
 248   4                                      else if(!strcmp(dbcmd[0],"second")){
 249   5                                              if(argc==2){    
 250   6                                                      intnum=atoi(dbcmd[1]);
 251   6                                                      ch=(unsigned char )intnum;
 252   6                                                      if(ch<60){
 253   7                                                              rtc.second=chtobcd(ch);
 254   7                                                              SD2000_set_time(&rtc);
 255   7                                                              printk("\n Set second=%c ok.",ch);
 256   7                                                      }
 257   6                                              }
 258   5                                      }
 259   4                                      else if(!strcmp(dbcmd[0],"time")){
 260   5                                              if(argc==4){    
 261   6                                                      intnum=atoi(dbcmd[1]);
 262   6                                                      ch=(unsigned char )intnum;
 263   6                                                      rtc.hour=chtobcd(ch);
 264   6                                                      intnum=atoi(dbcmd[2]);
 265   6                                                      ch=(unsigned char )intnum;
 266   6                                                      rtc.minute=chtobcd(ch);
 267   6                                                      intnum=atoi(dbcmd[3]);
 268   6                                                      ch=(unsigned char )intnum;
 269   6                                                      rtc.second=chtobcd(ch);
 270   6                                                      SD2000_set_time(&rtc);
 271   6                                                      send_hbs_msg(MSG_HBS_UPD_TIME);
 272   6                                                      printk("\n Set hour minute second ok.",ch);
 273   6                                              }
 274   5                                      }
 275   4                                      else if(!strcmp(dbcmd[0],"m")){
 276   5                                              if(argc==2){    
 277   6                                                      intnum=atoi(dbcmd[1]);
 278   6                                                      ch=(unsigned char )intnum;
 279   6                                                      if(ch<60){
 280   7                                                              rtc.minute=chtobcd(ch);
 281   7                                                              SD2000_set_time(&rtc);
 282   7                                                              printk("\n Set minute=%c ok.",ch);
 283   7                                                      }
 284   6                                              }
 285   5                                      }
 286   4                                      else if(!strcmp(dbcmd[0],"setf")){
 287   5                              extern void SD2000_set_freq(unsigned char ch1,unsigned char ch2, unsigned char ch3);
 288   5                                              flash_rbuf[0]=xatouc(dbcmd[1]);
 289   5                                              flash_rbuf[1]=xatouc(dbcmd[2]);
 290   5                                              flash_rbuf[2]=xatouc(dbcmd[3]);
 291   5                                              SD2000_set_freq(flash_rbuf[0],flash_rbuf[1], flash_rbuf[2]);
 292   5                                      }
 293   4                                      else if(!strcmp(dbcmd[0],"wd")){
 294   5                                              if(argc==2){
 295   6                                                      if(!strcmp(dbcmd[1],"s")){
 296   7                                                              tmstart();
 297   7                                                              printk("\n start convert...");
 298   7                                                      }
 299   6                                                      else if(!strcmp(dbcmd[1],"r")){
 300   7                                                              others.temperature=tmrtemp_all();
 301   7                                                              printk("\n temperature=%c.",others.temperature);
 302   7                                                      }
 303   6                                                      else if(!strcmp(dbcmd[1],"p")){
C51 COMPILER V7.06   DEBUG                                                                 10/10/2006 14:03:22 PAGE 6   

 304   7                                                              others.print |=PRNT_TM;
 305   7                                                              printk("\n Print temperature convert result.");
 306   7                                                      }
 307   6                                                      else if(!strcmp(dbcmd[1],"np")){
 308   7                                                              others.print &=~PRNT_TM;
 309   7                                                              printk("\n Don't print temperature convert result.");
 310   7                                                      }
 311   6                                                      else if(!strcmp(dbcmd[1],"show")){
 312   7                                                              show_wd_on=1;
 313   7                                                              printk("\n Show temperate.");
 314   7                                                      }
 315   6                                                      else if(!strcmp(dbcmd[1],"hide")){
 316   7                                                              show_wd_on=0;
 317   7      #ifdef HB320
                                                              clr_area(POS_SHOW_WDX,POS_SHOW_WDY,8,16);
              #else
 320   7                                                      clr_area(POS_SHOW_WDX,POS_SHOW_WDY,20,33);
 321   7      #endif
 322   7                                                              printk("\n Hide temperate.");
 323   7                                                      }
 324   6                                              }
 325   5                                              else{
 326   6                                                      printk("\n temperature=%c.",others.temperature);
 327   6                                              }                                                               
 328   5                                      }
 329   4                                      else if(!strcmp(dbcmd[0],"weeprom")){
 330   5                                              eeprom_dbgadd=32;
 331   5                                              AT24C64_wbytes((unsigned char *)&eeprom_dbgadd,8,flash_wbuf);
 332   5                                              printk("\n Write eeprom=");
 333   5                                              for(i=0;i<8;i++){
 334   6                                                      printk(" %bx",flash_wbuf[i]);
 335   6                                              }
 336   5                                      }
 337   4                                      else if(!strcmp(dbcmd[0],"reeprom")){
 338   5                                              eeprom_dbgadd=32;
 339   5                                              AT24C64_rbytes((unsigned char *)&eeprom_dbgadd,8,flash_rbuf);
 340   5                                              printk("\n read eeprom=");
 341   5                                              for(i=0;i<8;i++){

⌨️ 快捷键说明

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