From b51a2c266a50163f41cb4320f9b9f68a91132403 Mon Sep 17 00:00:00 2001 From: odewdney Date: Sun, 2 Feb 2020 14:18:38 +0000 Subject: [PATCH] lib/utils: Change default value of pyexec_mode_kind to 0 to put in bss. By simply reordering the enums for pyexec_mode_kind_t it eliminates a data variable which costs ROM to initialise it. And the minimal build now has nothing in the data section. It seems the compiler is smart enough so that the generated code for if-logic which tests these enum values is unchanged. --- lib/utils/pyexec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/pyexec.h b/lib/utils/pyexec.h index 573cb6d452..f69c5ce9a8 100644 --- a/lib/utils/pyexec.h +++ b/lib/utils/pyexec.h @@ -29,8 +29,8 @@ #include "py/obj.h" typedef enum { - PYEXEC_MODE_RAW_REPL, PYEXEC_MODE_FRIENDLY_REPL, + PYEXEC_MODE_RAW_REPL, } pyexec_mode_kind_t; extern pyexec_mode_kind_t pyexec_mode_kind;