From fd96d460ff3a978a7f63b33963b894698412e8e5 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Mon, 9 Nov 2015 09:08:18 +0000 Subject: De-inlined chprintf(). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8454 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/lib/streams/chprintf.c | 34 ++++++++++++++++++++++++++++++++++ os/hal/lib/streams/chprintf.h | 35 +---------------------------------- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/os/hal/lib/streams/chprintf.c b/os/hal/lib/streams/chprintf.c index 5f4ae4f87..fa2b105a4 100644 --- a/os/hal/lib/streams/chprintf.c +++ b/os/hal/lib/streams/chprintf.c @@ -276,6 +276,40 @@ unsigned_common: } } +/** + * @brief System formatted output function. + * @details This function implements a minimal @p printf() like functionality + * with output on a @p BaseSequentialStream. + * The general parameters format is: %[-][width|*][.precision|*][l|L]p. + * The following parameter types (p) are supported: + * - x hexadecimal integer. + * - X hexadecimal long. + * - o octal integer. + * - O octal long. + * - d decimal signed integer. + * - D decimal signed long. + * - u decimal unsigned integer. + * - U decimal unsigned long. + * - c character. + * - s string. + * . + * + * @param[in] chp pointer to a @p BaseSequentialStream implementing object + * @param[in] fmt formatting string + * + * @api + */ +int chprintf(BaseSequentialStream *chp, const char *fmt, ...) { + va_list ap; + int formatted_bytes; + + va_start(ap, fmt); + formatted_bytes = chvprintf(chp, fmt, ap); + va_end(ap); + + return formatted_bytes; +} + /** * @brief System formatted output function. * @details This function implements a minimal @p vprintf()-like functionality diff --git a/os/hal/lib/streams/chprintf.h b/os/hal/lib/streams/chprintf.h index 030640aa5..98a00e357 100644 --- a/os/hal/lib/streams/chprintf.h +++ b/os/hal/lib/streams/chprintf.h @@ -38,45 +38,12 @@ extern "C" { #endif int chvprintf(BaseSequentialStream *chp, const char *fmt, va_list ap); + int chprintf(BaseSequentialStream *chp, const char *fmt, ...); int chsnprintf(char *str, size_t size, const char *fmt, ...); #ifdef __cplusplus } #endif -/** - * @brief System formatted output function. - * @details This function implements a minimal @p printf() like functionality - * with output on a @p BaseSequentialStream. - * The general parameters format is: %[-][width|*][.precision|*][l|L]p. - * The following parameter types (p) are supported: - * - x hexadecimal integer. - * - X hexadecimal long. - * - o octal integer. - * - O octal long. - * - d decimal signed integer. - * - D decimal signed long. - * - u decimal unsigned integer. - * - U decimal unsigned long. - * - c character. - * - s string. - * . - * - * @param[in] chp pointer to a @p BaseSequentialStream implementing object - * @param[in] fmt formatting string - * - * @api - */ -static inline int chprintf(BaseSequentialStream *chp, const char *fmt, ...) { - va_list ap; - int formatted_bytes; - - va_start(ap, fmt); - formatted_bytes = chvprintf(chp, fmt, ap); - va_end(ap); - - return formatted_bytes; -} - #endif /* _CHPRINTF_H_ */ /** @} */ -- cgit v1.2.3