mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
This creates a 8051 build that can run in 24Kb of RAM
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@26 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+12
-9
@@ -81,23 +81,26 @@
|
||||
**********************************************************/
|
||||
|
||||
/************************************************************
|
||||
* printf
|
||||
* Name: printf
|
||||
**********************************************************/
|
||||
|
||||
int printf(const char *fmt, ...)
|
||||
{
|
||||
struct lib_stdstream_s stdstream;
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
||||
/* Wrap the stdout in a stream object and let lib_vsprintf
|
||||
* do the work.
|
||||
*/
|
||||
|
||||
lib_stdstream(&stdstream, stdout);
|
||||
|
||||
va_start(ap, fmt);
|
||||
ret= lib_vsprintf(&stdstream.public, fmt, ap);
|
||||
#if CONFIG_NFILE_STREAMS > 0
|
||||
ret = vfprintf(stdout, fmt, ap);
|
||||
#elif CONFIG_NFILE_DESCRIPTORS > 0
|
||||
ret = lib_rawvprintf(fmt, ap);
|
||||
#elif defined(CONFIG_ARCH_LOWPUTC)
|
||||
ret = lib_lowvprintf(fmt, ap);
|
||||
#else
|
||||
# warning "printf has no data sink"
|
||||
#endif
|
||||
va_end(ap);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user