This file defines a set of functions to dump trace.
Definition in file tracedump.h.
#include <avr32/io.h>
#include "FreeRTOS.h"
Go to the source code of this file.
Defines | |
#define | DUMP_FAILURE -1 |
#define | DUMP_SUCCESS 0 |
#define | NAKED_TRACE_COM2(...) |
#define | TRACE_COM2(...) |
Functions | |
int | itracedump_Init (void) |
int | printk (const char *format,...) |
unsigned portSHORT | ustracedump_Print (const signed portCHAR *const pcString) |
void | v_tracedump_stopResources (void) |
Stop the tracedump module resources. | |
void | vtracedump_PrintBlocking (const signed portCHAR *const pcString) |
void | vtracedump_Putchar (signed portCHAR cByte) |
Put a char to the dump port. | |
void | vtracedump_Putchar_Block (signed portCHAR cByte) |
Put a char to the dump port. |
#define DUMP_FAILURE -1 |
Value returned by function when it was unable to complete successfully for some unspecified reason
Definition at line 58 of file tracedump.h.
Referenced by itracedump_Init().
#define DUMP_SUCCESS 0 |
Value returned by function when it completed successfully
Definition at line 54 of file tracedump.h.
Referenced by itracedump_Init().
#define NAKED_TRACE_COM2 | ( | ... | ) |
Definition at line 118 of file tracedump.h.
Referenced by b_MMI_do_nothing(), b_USBHostCopyCfg(), b_USBHostCopyLogs(), b_USBHostCopyWeb(), b_USBHostMoveLogs(), bsensor_start(), e_cptime_cmd_set_config(), e_fscmds_CheckNavError(), e_supervisor_switch_to_maintenance_mode(), portTASK_FUNCTION(), prv_v_leave_maintenance_mode(), prv_xopen_current_logfile(), prvCheckMallocHeap(), prvweb_ParseCGIRequest(), prvweb_ParseHTMLRequest(), prvweb_SendErrorPage(), prvweb_SendFile(), and v_syscmds_display_traces().
#define TRACE_COM2 | ( | ... | ) |
Definition at line 119 of file tracedump.h.
Referenced by b_sensor_get_value(), e_supervisor_switch_to_maintenance_mode(), portTASK_FUNCTION(), prv_cat(), prv_GetChar_From_Requester_Stream(), prv_Print_String_To_Requester_Stream(), prv_PutChar_To_Requester_Stream(), prv_v_common_leave_UsbDevice_mode(), v_shell_Print_String_To_Requester_Stream(), and x_supervisor_SemaphoreGive().
int itracedump_Init | ( | void | ) |
This function initializes a dump port.
Definition at line 76 of file tracedump.c.
References DUMP_FAILURE, DUMP_SUCCESS, dumpCOM2_BAUDRATE, dumpCOM2_BUFFER_LEN, serCOM2, TRACE_MSG_BANNER, vtracedump_PrintBlocking(), xComPort2Hndl, and xUsartInit().
Referenced by portTASK_FUNCTION().
00077 { 00078 int iStatus = DUMP_SUCCESS; 00079 00080 //** 00081 //** Init the port. 00082 //** 00083 // Init the COM Port2. 00084 xComPort2Hndl = xUsartInit(serCOM2, dumpCOM2_BAUDRATE, 0, dumpCOM2_BUFFER_LEN); 00085 if(xComPort2Hndl == 0) 00086 return(DUMP_FAILURE); 00087 00088 //** 00089 //** Dump a banner to the port. 00090 //** 00091 vtracedump_PrintBlocking((const signed portCHAR * const)TRACE_MSG_BANNER); 00092 00093 return(iStatus); 00094 }
int printk | ( | const char * | format, | |
... | ||||
) |
Definition at line 285 of file printf-stdarg.c.
References print().
00286 { 00287 va_list args; 00288 00289 va_start( args, format ); 00290 return print( 0, format, args ); 00291 }
unsigned portSHORT ustracedump_Print | ( | const signed portCHAR *const | pcString | ) |
Send a string of characters to the dump port.
pcString | The string to dump |
Definition at line 110 of file tracedump.c.
References usUsartPutString(), and xComPort2Hndl.
00111 { 00112 return( usUsartPutString( xComPort2Hndl, pcString, strlen( (const portCHAR * )pcString ) ) ); 00113 }
void v_tracedump_stopResources | ( | void | ) |
Stop the tracedump module resources.
Definition at line 99 of file tracedump.c.
References vSerialClose(), and xComPort2Hndl.
Referenced by e_syscmds_reboot().
00100 { 00101 vSerialClose( xComPort2Hndl ); 00102 }
void vtracedump_PrintBlocking | ( | const signed portCHAR *const | pcString | ) |
Send a string of characters to the dump port.
pcString | The string to dump |
Definition at line 121 of file tracedump.c.
References usUsartPutString(), and xComPort2Hndl.
Referenced by itracedump_Init().
00122 { 00123 unsigned portSHORT usRemainChar = 0; 00124 unsigned portSHORT usMsgLen = strlen((const portCHAR * )pcString); 00125 00126 usRemainChar = usMsgLen; 00127 do{ 00128 usRemainChar = usUsartPutString( xComPort2Hndl, 00129 (const signed portCHAR * const)(pcString + usMsgLen - usRemainChar), 00130 usRemainChar ); 00131 }while( usRemainChar ); 00132 }
void vtracedump_Putchar | ( | signed portCHAR | cByte | ) |
Put a char to the dump port.
cByte | The character to put |
Definition at line 140 of file tracedump.c.
References DUMPCOM2_NO_BLOCK, xComPort2Hndl, and xUsartPutChar().
00141 { 00142 xUsartPutChar( xComPort2Hndl, cByte, DUMPCOM2_NO_BLOCK ); 00143 }
void vtracedump_Putchar_Block | ( | signed portCHAR | cByte | ) |
Put a char to the dump port.
cByte | The character to put |
Definition at line 150 of file tracedump.c.
References xComPort2Hndl, and xUsartPutChar().
00151 { 00152 xUsartPutChar( xComPort2Hndl, cByte, -1 ); 00153 }