summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-05-02 15:51:19 +1000
committerDamien George <damien.p.george@gmail.com>2018-05-02 15:51:19 +1000
commit6410e174c532395e9309300f550ced0942070040 (patch)
treebb889cd67be9668c8f7a9fe21d76e4ad8cd51340
parentdb2bdad8a2ed0814a64d0859fa6ea435a110d304 (diff)
esp8266: Disable DEBUG_PRINTERS for 512k build.
Disabling this saves around 6000 bytes of code space and gets the 512k build fitting in the available flash again (it increased lately due to an increase in the size of the ESP8266 SDK).
-rw-r--r--ports/esp8266/main.c14
-rw-r--r--ports/esp8266/mpconfigport_512k.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/ports/esp8266/main.c b/ports/esp8266/main.c
index d1b88a8ce..d2d2c34ec 100644
--- a/ports/esp8266/main.c
+++ b/ports/esp8266/main.c
@@ -137,3 +137,17 @@ void __assert(const char *file, int line, const char *expr) {
for (;;) {
}
}
+
+#if !MICROPY_DEBUG_PRINTERS
+// With MICROPY_DEBUG_PRINTERS disabled DEBUG_printf is not defined but it
+// is still needed by esp-open-lwip for debugging output, so define it here.
+#include <stdarg.h>
+int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args);
+int DEBUG_printf(const char *fmt, ...) {
+ va_list ap;
+ va_start(ap, fmt);
+ int ret = mp_vprintf(&MICROPY_DEBUG_PRINTER_DEST, fmt, ap);
+ va_end(ap);
+ return ret;
+}
+#endif
diff --git a/ports/esp8266/mpconfigport_512k.h b/ports/esp8266/mpconfigport_512k.h
index b84c13479..dc97efd35 100644
--- a/ports/esp8266/mpconfigport_512k.h
+++ b/ports/esp8266/mpconfigport_512k.h
@@ -5,6 +5,9 @@
#undef MICROPY_EMIT_INLINE_XTENSA
#define MICROPY_EMIT_INLINE_XTENSA (0)
+#undef MICROPY_DEBUG_PRINTERS
+#define MICROPY_DEBUG_PRINTERS (0)
+
#undef MICROPY_ERROR_REPORTING
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE)