From b0e9bb1b91567500475aa3fa6c4085423e774983 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Fri, 19 Jul 2019 23:20:56 -0400 Subject: [PATCH] Limit float formatting to only targets building Quake The Quake plugin is the only code that actually relies on float formatting. Because Quake only runs on targets with huge memory anyway, limiting their formatting to just those targets will minimize the increased memory use in the core. Change-Id: Icdbe26ec6ede564861cc01ac4add76a12b00ecd5 --- firmware/common/vuprintf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/firmware/common/vuprintf.c b/firmware/common/vuprintf.c index 8bb9451662..fb053ae7da 100644 --- a/firmware/common/vuprintf.c +++ b/firmware/common/vuprintf.c @@ -29,11 +29,18 @@ #include "ap_int.h" #ifndef BOOTLOADER + +/* Only the Quake plugin needs float formatting */ +#if defined(HAVE_LCD_COLOR) && \ + (!defined(LCD_STRIDEFORMAT) || (LCD_STRIDEFORMAT != VERTICAL_STRIDE)) && \ + (PLUGIN_BUFFER_SIZE > 0x14000) && (CONFIG_PLATFORM & PLATFORM_NATIVE) && defined(CPU_ARM) /* turn everything on */ #define FMT_LENMOD (0xffffffff) #define FMT_RADIX (0xffffffff) #endif +#endif + /* these are the defaults if no other preference is given */ #ifndef FMT_LENMOD #define FMT_LENMOD (FMT_LENMOD_l | \