debug.c

Go to the documentation of this file.
00001 /*This file is prepared for Doxygen automatic documentation generation.*/
00015 
00016 /* Copyright (c) 2009 Atmel Corporation. All rights reserved.
00017  *
00018  * Redistribution and use in source and binary forms, with or without
00019  * modification, are permitted provided that the following conditions are met:
00020  *
00021  * 1. Redistributions of source code must retain the above copyright notice,
00022  * this list of conditions and the following disclaimer.
00023  *
00024  * 2. Redistributions in binary form must reproduce the above copyright notice,
00025  * this list of conditions and the following disclaimer in the documentation
00026  * and/or other materials provided with the distribution.
00027  *
00028  * 3. The name of Atmel may not be used to endorse or promote products derived
00029  * from this software without specific prior written permission.
00030  *
00031  * 4. This software may only be redistributed and used in connection with an Atmel
00032  * AVR product.
00033  *
00034  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
00035  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00036  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY AND
00037  * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,
00038  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00039  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00040  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00041  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00042  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00043  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00044  */
00045 
00046 #define _TRACE_ (DISABLE)
00047 //_____  I N C L U D E S ___________________________________________________
00048 #include "config.h"
00049 #include "debug.h"
00050 
00051 
00052 //_____ M A C R O S ________________________________________________________
00053 
00054 
00055 //_____ D E F I N I T I O N S ______________________________________________
00056 // Board Config
00057 
00058 
00059 //_____ D E C L A R A T I O N S ____________________________________________
00060 
00061 
00062 
00063 #if (_TRACE_==ENABLE)
00064 U8 _MEM_TYPE_SLOW_ g_trace_en=TRUE;
00065 
00066 
00067 
00072 void trace_u32( U32 val )
00073 {
00074    if( FALSE==g_trace_en ) return;
00075    printf("%lu",val);
00076 }
00077 
00082 void trace_u16( U16 val )
00083 {
00084    if( FALSE==g_trace_en ) return;
00085    printf("%u",val);
00086 }
00087 
00092 void trace_u8( U8 val )
00093 {
00094    if( FALSE==g_trace_en ) return;
00095    printf("%u",val);
00096 }
00097 
00102 void trace_hex( U8 val )
00103 {
00104    if( FALSE==g_trace_en ) return;
00105    printf("0x%02X",val);
00106 }
00107 #endif
00108 
00109 #if (_TRACE_==ENABLE)
00114 void trace( const U8* str )
00115 {
00116    if( FALSE==g_trace_en ) return;
00117    printf((const char*)str);
00118 }
00119 
00120 
00121 void trace_hex16(U16 val)
00122 {
00123    printf("0x%04X",val);
00124 }
00125 
00126 void trace_hex32(U32 val)
00127 {
00128    printf("0x%08lX",val);
00129 }
00130 
00131 void trace_nl()
00132 {
00133    trace("\n\r");
00134 }
00135 
00136 #endif
00137 

Generated on Mon Sep 14 13:14:17 2009 for ATMEL by  doxygen 1.5.3