diff options
author | Delio Brignoli <brignoli.delio@gmail.com> | 2016-08-21 11:33:37 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-09-05 12:18:53 +1000 |
commit | e2ac8bb3f14b076a29244022865e3b47c6c0800a (patch) | |
tree | ba02f53ca3f6b488084df68d78e1d5dd9ee99d46 /lib/utils | |
parent | cac8dc34149686679b67037d393d3ea1c6aff779 (diff) | |
download | micropython-e2ac8bb3f14b076a29244022865e3b47c6c0800a.tar.gz micropython-e2ac8bb3f14b076a29244022865e3b47c6c0800a.zip |
py: Add MICROPY_USE_INTERNAL_PRINTF option, defaults to enabled.
This new config option allows to control whether MicroPython uses its own
internal printf or not (if not, an external one should be linked in).
Accompanying this new option is the inclusion of lib/utils/printf.c in the
core list of source files, so that ports no longer need to include it
themselves.
Diffstat (limited to 'lib/utils')
-rw-r--r-- | lib/utils/printf.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/utils/printf.c b/lib/utils/printf.c index 308525b6e8..303edfcca0 100644 --- a/lib/utils/printf.c +++ b/lib/utils/printf.c @@ -24,6 +24,10 @@ * THE SOFTWARE. */ +#include "py/mpconfig.h" + +#if MICROPY_USE_INTERNAL_PRINTF + #include <stdint.h> #include <string.h> #include <stdarg.h> @@ -127,3 +131,5 @@ int snprintf(char *str, size_t size, const char *fmt, ...) { va_end(ap); return ret; } + +#endif //MICROPY_USE_INTERNAL_PRINTF |