#line 1 "..\\src\\myprintf\\MyPrintf.c" #line 1 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\STDIO.h" #line 47 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\STDIO.h" typedef unsigned int size_t; typedef struct __va_list __va_list; typedef struct __fpos_t_struct { unsigned __int64 __pos; struct { unsigned int __state1, __state2; } __mbstate; } fpos_t; typedef struct __FILE FILE; #line 136 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\STDIO.h" extern FILE __stdin, __stdout, __stderr; extern FILE *__aeabi_stdin, *__aeabi_stdout, *__aeabi_stderr; #line 166 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\STDIO.h" extern __declspec(__nothrow) int remove(const char * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int rename(const char * , const char * ) __attribute__((__nonnull__(1,2))); extern __declspec(__nothrow) FILE *tmpfile(void); extern __declspec(__nothrow) char *tmpnam(char * ); extern __declspec(__nothrow) int fclose(FILE * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int fflush(FILE * ); extern __declspec(__nothrow) FILE *fopen(const char * __restrict , const char * __restrict ) __attribute__((__nonnull__(1,2))); extern __declspec(__nothrow) FILE *freopen(const char * __restrict , const char * __restrict , FILE * __restrict ) __attribute__((__nonnull__(2,3))); extern __declspec(__nothrow) void setbuf(FILE * __restrict , char * __restrict ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int setvbuf(FILE * __restrict , char * __restrict , int , size_t ) __attribute__((__nonnull__(1))); #pragma __printf_args extern __declspec(__nothrow) int fprintf(FILE * __restrict , const char * __restrict , ...) __attribute__((__nonnull__(1,2))); #pragma __printf_args extern __declspec(__nothrow) int _fprintf(FILE * __restrict , const char * __restrict , ...) __attribute__((__nonnull__(1,2))); #pragma __printf_args extern __declspec(__nothrow) int printf(const char * __restrict , ...) __attribute__((__nonnull__(1))); #pragma __printf_args extern __declspec(__nothrow) int _printf(const char * __restrict , ...) __attribute__((__nonnull__(1))); #pragma __printf_args extern __declspec(__nothrow) int sprintf(char * __restrict , const char * __restrict , ...) __attribute__((__nonnull__(1,2))); #pragma __printf_args extern __declspec(__nothrow) int _sprintf(char * __restrict , const char * __restrict , ...) __attribute__((__nonnull__(1,2))); #pragma __printf_args extern __declspec(__nothrow) int __ARM_snprintf(char * __restrict , size_t , const char * __restrict , ...) __attribute__((__nonnull__(3))); #pragma __printf_args extern __declspec(__nothrow) int snprintf(char * __restrict , size_t , const char * __restrict , ...) __attribute__((__nonnull__(3))); #pragma __printf_args extern __declspec(__nothrow) int _snprintf(char * __restrict , size_t , const char * __restrict , ...) __attribute__((__nonnull__(3))); #pragma __scanf_args extern __declspec(__nothrow) int fscanf(FILE * __restrict , const char * __restrict , ...) __attribute__((__nonnull__(1,2))); #pragma __scanf_args extern __declspec(__nothrow) int _fscanf(FILE * __restrict , const char * __restrict , ...) __attribute__((__nonnull__(1,2))); #pragma __scanf_args extern __declspec(__nothrow) int scanf(const char * __restrict , ...) __attribute__((__nonnull__(1))); #pragma __scanf_args extern __declspec(__nothrow) int _scanf(const char * __restrict , ...) __attribute__((__nonnull__(1))); #pragma __scanf_args extern __declspec(__nothrow) int sscanf(const char * __restrict , const char * __restrict , ...) __attribute__((__nonnull__(1,2))); #pragma __scanf_args extern __declspec(__nothrow) int _sscanf(const char * __restrict , const char * __restrict , ...) __attribute__((__nonnull__(1,2))); extern __declspec(__nothrow) int vfscanf(FILE * __restrict , const char * __restrict , __va_list) __attribute__((__nonnull__(1,2))); extern __declspec(__nothrow) int vscanf(const char * __restrict , __va_list) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int vsscanf(const char * __restrict , const char * __restrict , __va_list) __attribute__((__nonnull__(1,2))); extern __declspec(__nothrow) int _vfscanf(FILE * __restrict , const char * __restrict , __va_list) __attribute__((__nonnull__(1,2))); extern __declspec(__nothrow) int _vscanf(const char * __restrict , __va_list) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int _vsscanf(const char * __restrict , const char * __restrict , __va_list) __attribute__((__nonnull__(1,2))); extern __declspec(__nothrow) int __ARM_vsscanf(const char * __restrict , const char * __restrict , __va_list) __attribute__((__nonnull__(1,2))); extern __declspec(__nothrow) int vprintf(const char * __restrict , __va_list ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int _vprintf(const char * __restrict , __va_list ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int vfprintf(FILE * __restrict , const char * __restrict , __va_list ) __attribute__((__nonnull__(1,2))); extern __declspec(__nothrow) int vsprintf(char * __restrict , const char * __restrict , __va_list ) __attribute__((__nonnull__(1,2))); extern __declspec(__nothrow) int __ARM_vsnprintf(char * __restrict , size_t , const char * __restrict , __va_list ) __attribute__((__nonnull__(3))); extern __declspec(__nothrow) int vsnprintf(char * __restrict , size_t , const char * __restrict , __va_list ) __attribute__((__nonnull__(3))); extern __declspec(__nothrow) int _vsprintf(char * __restrict , const char * __restrict , __va_list ) __attribute__((__nonnull__(1,2))); extern __declspec(__nothrow) int _vfprintf(FILE * __restrict , const char * __restrict , __va_list ) __attribute__((__nonnull__(1,2))); extern __declspec(__nothrow) int _vsnprintf(char * __restrict , size_t , const char * __restrict , __va_list ) __attribute__((__nonnull__(3))); #pragma __printf_args extern __declspec(__nothrow) int asprintf(char ** , const char * __restrict , ...) __attribute__((__nonnull__(2))); extern __declspec(__nothrow) int vasprintf(char ** , const char * __restrict , __va_list ) __attribute__((__nonnull__(2))); #pragma __printf_args extern __declspec(__nothrow) int __ARM_asprintf(char ** , const char * __restrict , ...) __attribute__((__nonnull__(2))); extern __declspec(__nothrow) int __ARM_vasprintf(char ** , const char * __restrict , __va_list ) __attribute__((__nonnull__(2))); extern __declspec(__nothrow) int fgetc(FILE * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) char *fgets(char * __restrict , int , FILE * __restrict ) __attribute__((__nonnull__(1,3))); extern __declspec(__nothrow) int fputc(int , FILE * ) __attribute__((__nonnull__(2))); extern __declspec(__nothrow) int fputs(const char * __restrict , FILE * __restrict ) __attribute__((__nonnull__(1,2))); extern __declspec(__nothrow) int getc(FILE * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int (getchar)(void); extern __declspec(__nothrow) char *gets(char * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int putc(int , FILE * ) __attribute__((__nonnull__(2))); extern __declspec(__nothrow) int (putchar)(int ); extern __declspec(__nothrow) int puts(const char * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int ungetc(int , FILE * ) __attribute__((__nonnull__(2))); extern __declspec(__nothrow) size_t fread(void * __restrict , size_t , size_t , FILE * __restrict ) __attribute__((__nonnull__(1,4))); extern __declspec(__nothrow) size_t __fread_bytes_avail(void * __restrict , size_t , FILE * __restrict ) __attribute__((__nonnull__(1,3))); extern __declspec(__nothrow) size_t fwrite(const void * __restrict , size_t , size_t , FILE * __restrict ) __attribute__((__nonnull__(1,4))); extern __declspec(__nothrow) int fgetpos(FILE * __restrict , fpos_t * __restrict ) __attribute__((__nonnull__(1,2))); extern __declspec(__nothrow) int fseek(FILE * , long int , int ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int fsetpos(FILE * __restrict , const fpos_t * __restrict ) __attribute__((__nonnull__(1,2))); extern __declspec(__nothrow) long int ftell(FILE * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) void rewind(FILE * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) void clearerr(FILE * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int feof(FILE * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int ferror(FILE * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) void perror(const char * ); extern __declspec(__nothrow) int _fisatty(FILE * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) void __use_no_semihosting_swi(void); extern __declspec(__nothrow) void __use_no_semihosting(void); #line 1021 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\STDIO.h" #line 3 "..\\src\\myprintf\\MyPrintf.c" #line 1 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdarg.h" #line 27 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdarg.h" #line 57 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdarg.h" typedef struct __va_list { void *__ap; } va_list; #line 138 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdarg.h" #line 147 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdarg.h" #line 4 "..\\src\\myprintf\\MyPrintf.c" #line 5 "..\\src\\myprintf\\MyPrintf.c" #line 1 "..\\src\\myprintf\\MYPRINTF.H" int MyPrintf(const char *fmt,...); #line 6 "..\\src\\myprintf\\MyPrintf.c" #line 1 "..\\src\\RTT\\SEGGER_RTT.h" #line 1 "..\\src\\RTT\\SEGGER_RTT_Conf.h" #line 241 "..\\src\\RTT\\SEGGER_RTT_Conf.h" #line 296 "..\\src\\RTT\\SEGGER_RTT_Conf.h" #line 310 "..\\src\\RTT\\SEGGER_RTT_Conf.h" #line 324 "..\\src\\RTT\\SEGGER_RTT_Conf.h" #line 351 "..\\src\\RTT\\SEGGER_RTT_Conf.h" #line 383 "..\\src\\RTT\\SEGGER_RTT_Conf.h" #line 398 "..\\src\\RTT\\SEGGER_RTT_Conf.h" #line 415 "..\\src\\RTT\\SEGGER_RTT_Conf.h" #line 62 "..\\src\\RTT\\SEGGER_RTT.h" #line 125 "..\\src\\RTT\\SEGGER_RTT.h" #line 146 "..\\src\\RTT\\SEGGER_RTT.h" #line 158 "..\\src\\RTT\\SEGGER_RTT.h" #line 175 "..\\src\\RTT\\SEGGER_RTT.h" #line 192 "..\\src\\RTT\\SEGGER_RTT.h" #line 1 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdlib.h" #line 54 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdlib.h" typedef unsigned int size_t; #line 70 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdlib.h" typedef unsigned short wchar_t; #line 91 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdlib.h" typedef struct div_t { int quot, rem; } div_t; typedef struct ldiv_t { long int quot, rem; } ldiv_t; typedef struct lldiv_t { long long quot, rem; } lldiv_t; #line 112 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdlib.h" #line 131 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdlib.h" extern __declspec(__nothrow) int __aeabi_MB_CUR_MAX(void); extern __declspec(__nothrow) double atof(const char * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int atoi(const char * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) long int atol(const char * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) long long atoll(const char * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) double strtod(const char * __restrict , char ** __restrict ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) float strtof(const char * __restrict , char ** __restrict ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) long double strtold(const char * __restrict , char ** __restrict ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) long int strtol(const char * __restrict , char ** __restrict , int ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) unsigned long int strtoul(const char * __restrict , char ** __restrict , int ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) long long strtoll(const char * __restrict , char ** __restrict , int ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) unsigned long long strtoull(const char * __restrict , char ** __restrict , int ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int rand(void); extern __declspec(__nothrow) void srand(unsigned int ); struct _rand_state { int __x[57]; }; extern __declspec(__nothrow) int _rand_r(struct _rand_state *); extern __declspec(__nothrow) void _srand_r(struct _rand_state *, unsigned int); struct _ANSI_rand_state { int __x[1]; }; extern __declspec(__nothrow) int _ANSI_rand_r(struct _ANSI_rand_state *); extern __declspec(__nothrow) void _ANSI_srand_r(struct _ANSI_rand_state *, unsigned int); extern __declspec(__nothrow) void *calloc(size_t , size_t ); extern __declspec(__nothrow) void free(void * ); extern __declspec(__nothrow) void *malloc(size_t ); extern __declspec(__nothrow) void *realloc(void * , size_t ); extern __declspec(__nothrow) int posix_memalign(void ** , size_t , size_t ); typedef int (*__heapprt)(void *, char const *, ...); extern __declspec(__nothrow) void __heapstats(int (* )(void * , char const * , ...), void * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int __heapvalid(int (* )(void * , char const * , ...), void * , int ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) __declspec(__noreturn) void abort(void); extern __declspec(__nothrow) int atexit(void (* )(void)) __attribute__((__nonnull__(1))); #line 436 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdlib.h" extern __declspec(__nothrow) __declspec(__noreturn) void exit(int ); extern __declspec(__nothrow) __declspec(__noreturn) void _Exit(int ); extern __declspec(__nothrow) char *getenv(const char * ) __attribute__((__nonnull__(1))); extern __declspec(__nothrow) int system(const char * ); extern void *bsearch(const void * , const void * , size_t , size_t , int (* )(const void *, const void *)) __attribute__((__nonnull__(1,2,5))); #line 524 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdlib.h" extern void qsort(void * , size_t , size_t , int (* )(const void *, const void *)) __attribute__((__nonnull__(1,4))); #line 553 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdlib.h" extern __declspec(__nothrow) __attribute__((const)) int abs(int ); extern __declspec(__nothrow) __attribute__((const)) div_t div(int , int ); extern __declspec(__nothrow) __attribute__((const)) long int labs(long int ); extern __declspec(__nothrow) __attribute__((const)) ldiv_t ldiv(long int , long int ); extern __declspec(__nothrow) __attribute__((const)) long long llabs(long long ); extern __declspec(__nothrow) __attribute__((const)) lldiv_t lldiv(long long , long long ); #line 634 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdlib.h" typedef struct __sdiv32by16 { int quot, rem; } __sdiv32by16; typedef struct __udiv32by16 { unsigned int quot, rem; } __udiv32by16; typedef struct __sdiv64by32 { int rem, quot; } __sdiv64by32; __value_in_regs extern __declspec(__nothrow) __attribute__((const)) __sdiv32by16 __rt_sdiv32by16( int , short int ); __value_in_regs extern __declspec(__nothrow) __attribute__((const)) __udiv32by16 __rt_udiv32by16( unsigned int , unsigned short ); __value_in_regs extern __declspec(__nothrow) __attribute__((const)) __sdiv64by32 __rt_sdiv64by32( int , unsigned int , int ); extern __declspec(__nothrow) unsigned int __fp_status(unsigned int , unsigned int ); extern __declspec(__nothrow) int mblen(const char * , size_t ); extern __declspec(__nothrow) int mbtowc(wchar_t * __restrict , const char * __restrict , size_t ); extern __declspec(__nothrow) int wctomb(char * , wchar_t ); extern __declspec(__nothrow) size_t mbstowcs(wchar_t * __restrict , const char * __restrict , size_t ) __attribute__((__nonnull__(2))); extern __declspec(__nothrow) size_t wcstombs(char * __restrict , const wchar_t * __restrict , size_t ) __attribute__((__nonnull__(2))); extern __declspec(__nothrow) void __use_realtime_heap(void); extern __declspec(__nothrow) void __use_realtime_division(void); extern __declspec(__nothrow) void __use_two_region_memory(void); extern __declspec(__nothrow) void __use_no_heap(void); extern __declspec(__nothrow) void __use_no_heap_region(void); extern __declspec(__nothrow) char const *__C_library_version_string(void); extern __declspec(__nothrow) int __C_library_version_number(void); #line 892 "d:\\Keil\\ARM\\ARM_Compiler_5.06u7\\Bin\\..\\include\\stdlib.h" #line 195 "..\\src\\RTT\\SEGGER_RTT.h" #line 196 "..\\src\\RTT\\SEGGER_RTT.h" #line 218 "..\\src\\RTT\\SEGGER_RTT.h" typedef struct { const char* sName; char* pBuffer; unsigned SizeOfBuffer; unsigned WrOff; volatile unsigned RdOff; unsigned Flags; } SEGGER_RTT_BUFFER_UP; typedef struct { const char* sName; char* pBuffer; unsigned SizeOfBuffer; volatile unsigned WrOff; unsigned RdOff; unsigned Flags; } SEGGER_RTT_BUFFER_DOWN; typedef struct { char acID[16]; int MaxNumUpBuffers; int MaxNumDownBuffers; SEGGER_RTT_BUFFER_UP aUp[(3)]; SEGGER_RTT_BUFFER_DOWN aDown[(3)]; } SEGGER_RTT_CB; extern SEGGER_RTT_CB _SEGGER_RTT; int SEGGER_RTT_AllocDownBuffer (const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags); int SEGGER_RTT_AllocUpBuffer (const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags); int SEGGER_RTT_ConfigUpBuffer (unsigned BufferIndex, const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags); int SEGGER_RTT_ConfigDownBuffer (unsigned BufferIndex, const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags); int SEGGER_RTT_GetKey (void); unsigned SEGGER_RTT_HasData (unsigned BufferIndex); int SEGGER_RTT_HasKey (void); unsigned SEGGER_RTT_HasDataUp (unsigned BufferIndex); void SEGGER_RTT_Init (void); unsigned SEGGER_RTT_Read (unsigned BufferIndex, void* pBuffer, unsigned BufferSize); unsigned SEGGER_RTT_ReadNoLock (unsigned BufferIndex, void* pData, unsigned BufferSize); int SEGGER_RTT_SetNameDownBuffer (unsigned BufferIndex, const char* sName); int SEGGER_RTT_SetNameUpBuffer (unsigned BufferIndex, const char* sName); int SEGGER_RTT_SetFlagsDownBuffer (unsigned BufferIndex, unsigned Flags); int SEGGER_RTT_SetFlagsUpBuffer (unsigned BufferIndex, unsigned Flags); int SEGGER_RTT_WaitKey (void); unsigned SEGGER_RTT_Write (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes); unsigned SEGGER_RTT_WriteNoLock (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes); unsigned SEGGER_RTT_WriteSkipNoLock (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes); unsigned SEGGER_RTT_ASM_WriteSkipNoLock (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes); unsigned SEGGER_RTT_WriteString (unsigned BufferIndex, const char* s); void SEGGER_RTT_WriteWithOverwriteNoLock(unsigned BufferIndex, const void* pBuffer, unsigned NumBytes); unsigned SEGGER_RTT_PutChar (unsigned BufferIndex, char c); unsigned SEGGER_RTT_PutCharSkip (unsigned BufferIndex, char c); unsigned SEGGER_RTT_PutCharSkipNoLock (unsigned BufferIndex, char c); unsigned SEGGER_RTT_GetAvailWriteSpace (unsigned BufferIndex); unsigned SEGGER_RTT_GetBytesInBuffer (unsigned BufferIndex); unsigned SEGGER_RTT_ReadUpBuffer (unsigned BufferIndex, void* pBuffer, unsigned BufferSize); unsigned SEGGER_RTT_ReadUpBufferNoLock (unsigned BufferIndex, void* pData, unsigned BufferSize); unsigned SEGGER_RTT_WriteDownBuffer (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes); unsigned SEGGER_RTT_WriteDownBufferNoLock (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes); int SEGGER_RTT_SetTerminal (unsigned char TerminalId); int SEGGER_RTT_TerminalOut (unsigned char TerminalId, const char* s); int SEGGER_RTT_printf(unsigned BufferIndex, const char * sFormat, ...); int SEGGER_RTT_vprintf(unsigned BufferIndex, const char * sFormat, va_list * pParamList); #line 388 "..\\src\\RTT\\SEGGER_RTT.h" #line 397 "..\\src\\RTT\\SEGGER_RTT.h" #line 406 "..\\src\\RTT\\SEGGER_RTT.h" #line 415 "..\\src\\RTT\\SEGGER_RTT.h" #line 8 "..\\src\\myprintf\\MyPrintf.c" static int bInitPrint = 0; static char buffer[256] = {0}; int MyPrintf(const char* fmt, ...) { va_list args; int tmp_size = 0; if(bInitPrint==0) { bInitPrint = 1; SEGGER_RTT_Init(); SEGGER_RTT_ConfigUpBuffer(0, 0, 0, 0, (2)); SEGGER_RTT_WriteString(0, "SEGGER Real-Time-Terminal Sample\r\n\r\n"); SEGGER_RTT_WriteString(0, "###### Testing SEGGER_printf() ######\r\n"); } __va_start(args, fmt); tmp_size = vsnprintf(buffer,sizeof(buffer),fmt,args); SEGGER_RTT_WriteString(0,buffer); __va_end(args); return tmp_size; }