aboutsummaryrefslogtreecommitdiff
path: root/ports/esp8266/main.c
diff options
context:
space:
mode:
authorDamien George2018-05-02 15:51:19 +1000
committerDamien George2018-05-02 15:51:19 +1000
commit6410e174c532395e9309300f550ced0942070040 (patch)
treebb889cd67be9668c8f7a9fe21d76e4ad8cd51340 /ports/esp8266/main.c
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).
Diffstat (limited to 'ports/esp8266/main.c')
-rw-r--r--ports/esp8266/main.c14
1 files changed, 14 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