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

📄 debug.lst

📁 Philips LPC2138 Demo Application with Keil C
💻 LST
📖 第 1 页 / 共 2 页
字号:
               
               /*****************************************************************************/
               #endif
  168          #endif
  169          /*****************************************************************************/
  170          
  171          
  172          /*****************************************************************************/
  173          #ifdef DEBUG
  174          #ifdef HW_ENDPOINT_ATMEGA128_SD
               /*****************************************************************************/
               
               void debug(const eint8 *format, ...)
               {
                   eint8 dbgstring[90];
                   va_list ap;
                   euint8 i=0;
                   eint8 c;
                   
                   va_start(ap, format);
                   vsprintf_P(dbgstring, format, ap);
                   va_end(ap);
                   
                   
                   while (( (c=dbgstring[i++]) && (i<90) ))
                       debug_sendByte(c);
ARM COMPILER V2.42,  debug                                                                 27/03/06  10:45:48  PAGE 4   

                       
                   if(i>=90)
                       debug(PSTR("<BREAK>\n"));
               }
               /*****************************************************************************/
               
               void debug_init(void)
               {
                   unsigned short ubrr;
                   
                   ubrr = ((unsigned short)DEBUG_UBRR);
                   
                   switch(DEBUG_PORT){
                       case 0:
                           UBRR0H = (euint8) (ubrr>>8);
                           UBRR0L = (euint8) (ubrr);
                           UCSR0B = ( (1<<RXEN) | (1<<TXEN) );
                           break;
                       case 1: 
                           UBRR1H = (euint8) (ubrr>>8);
                           UBRR1L = (euint8) (ubrr);
                           UCSR1B = ( (1<<RXEN) | (1<<TXEN) );
                           break;
                       default:
                           /* INVALID CONFIG FILE */
                           break;
                   }
               }
               /*****************************************************************************/
               
               void debug_end(void)
               {
                   /* Nothing to do here, function is here for compatibility */
               }
               /*****************************************************************************/
               
               void debug_sendByte(euint8 data)
               {
                   /* If sending a newline, add a return first */
                   if(data=='\n')
                       debug_sendByte('\r');
               
                   switch(DEBUG_PORT){
                       case 0:
                           while ( !(UCSR0A & (1<<UDRE0)) )
                               _NOP();     /* Wait for empty transmit buffer */
                           UDR0 = data;    /* Start transmittion */
                           break;
                       case 1:
                           while ( !(UCSR1A & (1<<UDRE1)) ) 
                               _NOP();     /* Wait for empty transmit buffer */
                           UDR1 = data;    /* Start transmittion */
                           break;
                       default:
                           /* INVALID CONFIG FILE */
                           break;
                   }
               }
               /*****************************************************************************/
               
               unsigned char debug_getByte()
               {
                   switch(DEBUG_PORT){
                       case 0:
                           while ( !(UCSR0A & (1<<RXC0)) )
                               _NOP();
ARM COMPILER V2.42,  debug                                                                 27/03/06  10:45:48  PAGE 5   

                           return(UDR0);
                           break;
                       case 1:
                           while ( !(UCSR1A & (1<<RXC1)) )
                               _NOP();
                           return(UDR1);
                           break;
                   }
               }
               /*****************************************************************************/
               
               euint8 debug_getString(euint8 *data,euint16 length)
               {
                   euint8 i=0;
                   euint8 c;
               
                   do
                   {
                       c=debug_getByte();
                       if(c!='\n' && c!='\r')
                           data[i++]=c;
                       debug_sendByte(c);
                   }
                   while(c!='\n' && c!='\r' && i<length);
                   data[i]='\0';
               
                   return(i);
               }
               /*****************************************************************************/
               
               
               /*****************************************************************************/
               #endif
  290          #endif
  291          /*****************************************************************************/
  292          
  293          
  294          
  295          
  296          /*****************************************************************************/
  297          #ifdef DEBUG
  298          #ifdef HW_ENDPOINT_DSP_TI6713_SD
               /*****************************************************************************/
               
               void dbg(const char *format, ...)
               {
                   printf(format);
               }
               /*****************************************************************************/
               
               void debug_init()
               {
               }
               /*****************************************************************************/
               
               void debug_end()
               {
               }
               /*****************************************************************************/
               
               /*****************************************************************************/
               #endif
  319          #endif
  320          /*****************************************************************************/
  321          
ARM COMPILER V2.42,  debug                                                                 27/03/06  10:45:48  PAGE 6   

ASSEMBLY LISTING OF GENERATED OBJECT CODE




Module Information          Static
----------------------------------
  code size            =    ------
  data size            =    ------
  const size           =    ------
End of Module Information.


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

⌨️ 快捷键说明

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