Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: xprintf.h
- Revision:
- 0:a2d3a9f771b8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xprintf.h Fri Apr 04 14:01:24 2014 +0000 @@ -0,0 +1,38 @@ +/*------------------------------------------------------------------------*/ +/* Universal string handler for user console interface (C)ChaN, 2011 */ +/*------------------------------------------------------------------------*/ + +#ifndef _STRFUNC +#define _STRFUNC + +#define _USE_XFUNC_OUT 1 /* 1: Use output functions */ +#define _CR_CRLF 1 /* 1: Convert \n ==> \r\n in the output char */ + +#define _USE_XFUNC_IN 0 /* 1: Use input function */ +#define _LINE_ECHO 0 /* 1: Echo back input chars in xgets function */ + + +#if _USE_XFUNC_OUT +#define xdev_out(func) xfunc_out = (void(*)(unsigned char))(func) +extern void (*xfunc_out)(unsigned char); +void xputc (char c); +void xputs (const char* str); +void xfputs (void (*func)(unsigned char), const char* str); +void xprintf (const char* fmt, ...); +void xsprintf (char* buff, const char* fmt, ...); +void xfprintf (void (*func)(unsigned char), const char* fmt, ...); +void put_dump (const void* buff, unsigned long addr, int len, int width); +#define DW_CHAR sizeof(char) +#define DW_SHORT sizeof(short) +#define DW_LONG sizeof(long) +#endif + +#if _USE_XFUNC_IN +#define xdev_in(func) xfunc_in = (unsigned char(*)(void))(func) +extern unsigned char (*xfunc_in)(void); +int xgets (char* buff, int len); +int xfgets (unsigned char (*func)(void), char* buff, int len); +int xatoi (char** str, long* res); +#endif + +#endif