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.
xprintf.h@0:a2d3a9f771b8, 2014-04-04 (annotated)
- Committer:
- kunipm9
- Date:
- Fri Apr 04 14:01:24 2014 +0000
- Revision:
- 0:a2d3a9f771b8
1st
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| kunipm9 | 0:a2d3a9f771b8 | 1 | /*------------------------------------------------------------------------*/ |
| kunipm9 | 0:a2d3a9f771b8 | 2 | /* Universal string handler for user console interface (C)ChaN, 2011 */ |
| kunipm9 | 0:a2d3a9f771b8 | 3 | /*------------------------------------------------------------------------*/ |
| kunipm9 | 0:a2d3a9f771b8 | 4 | |
| kunipm9 | 0:a2d3a9f771b8 | 5 | #ifndef _STRFUNC |
| kunipm9 | 0:a2d3a9f771b8 | 6 | #define _STRFUNC |
| kunipm9 | 0:a2d3a9f771b8 | 7 | |
| kunipm9 | 0:a2d3a9f771b8 | 8 | #define _USE_XFUNC_OUT 1 /* 1: Use output functions */ |
| kunipm9 | 0:a2d3a9f771b8 | 9 | #define _CR_CRLF 1 /* 1: Convert \n ==> \r\n in the output char */ |
| kunipm9 | 0:a2d3a9f771b8 | 10 | |
| kunipm9 | 0:a2d3a9f771b8 | 11 | #define _USE_XFUNC_IN 0 /* 1: Use input function */ |
| kunipm9 | 0:a2d3a9f771b8 | 12 | #define _LINE_ECHO 0 /* 1: Echo back input chars in xgets function */ |
| kunipm9 | 0:a2d3a9f771b8 | 13 | |
| kunipm9 | 0:a2d3a9f771b8 | 14 | |
| kunipm9 | 0:a2d3a9f771b8 | 15 | #if _USE_XFUNC_OUT |
| kunipm9 | 0:a2d3a9f771b8 | 16 | #define xdev_out(func) xfunc_out = (void(*)(unsigned char))(func) |
| kunipm9 | 0:a2d3a9f771b8 | 17 | extern void (*xfunc_out)(unsigned char); |
| kunipm9 | 0:a2d3a9f771b8 | 18 | void xputc (char c); |
| kunipm9 | 0:a2d3a9f771b8 | 19 | void xputs (const char* str); |
| kunipm9 | 0:a2d3a9f771b8 | 20 | void xfputs (void (*func)(unsigned char), const char* str); |
| kunipm9 | 0:a2d3a9f771b8 | 21 | void xprintf (const char* fmt, ...); |
| kunipm9 | 0:a2d3a9f771b8 | 22 | void xsprintf (char* buff, const char* fmt, ...); |
| kunipm9 | 0:a2d3a9f771b8 | 23 | void xfprintf (void (*func)(unsigned char), const char* fmt, ...); |
| kunipm9 | 0:a2d3a9f771b8 | 24 | void put_dump (const void* buff, unsigned long addr, int len, int width); |
| kunipm9 | 0:a2d3a9f771b8 | 25 | #define DW_CHAR sizeof(char) |
| kunipm9 | 0:a2d3a9f771b8 | 26 | #define DW_SHORT sizeof(short) |
| kunipm9 | 0:a2d3a9f771b8 | 27 | #define DW_LONG sizeof(long) |
| kunipm9 | 0:a2d3a9f771b8 | 28 | #endif |
| kunipm9 | 0:a2d3a9f771b8 | 29 | |
| kunipm9 | 0:a2d3a9f771b8 | 30 | #if _USE_XFUNC_IN |
| kunipm9 | 0:a2d3a9f771b8 | 31 | #define xdev_in(func) xfunc_in = (unsigned char(*)(void))(func) |
| kunipm9 | 0:a2d3a9f771b8 | 32 | extern unsigned char (*xfunc_in)(void); |
| kunipm9 | 0:a2d3a9f771b8 | 33 | int xgets (char* buff, int len); |
| kunipm9 | 0:a2d3a9f771b8 | 34 | int xfgets (unsigned char (*func)(void), char* buff, int len); |
| kunipm9 | 0:a2d3a9f771b8 | 35 | int xatoi (char** str, long* res); |
| kunipm9 | 0:a2d3a9f771b8 | 36 | #endif |
| kunipm9 | 0:a2d3a9f771b8 | 37 | |
| kunipm9 | 0:a2d3a9f771b8 | 38 | #endif |