summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorodewdney <oliver.dewdney@lbi.com>2020-02-02 14:18:38 +0000
committerDamien George <damien.p.george@gmail.com>2020-02-04 18:10:26 +1100
commitb51a2c266a50163f41cb4320f9b9f68a91132403 (patch)
treed16f7b052f0afa6dc804ac07db0e42c075491d84
parent0645478475d886e3dd958c2c2ae71fe66813c8f8 (diff)
downloadmicropython-b51a2c266a50163f41cb4320f9b9f68a91132403.tar.gz
micropython-b51a2c266a50163f41cb4320f9b9f68a91132403.zip
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.
-rw-r--r--lib/utils/pyexec.h2
1 files changed, 1 insertions, 1 deletions
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;