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.
This commit is contained in:
odewdney 2020-02-02 14:18:38 +00:00 committed by Damien George
parent 0645478475
commit b51a2c266a

View File

@ -29,8 +29,8 @@
#include "py/obj.h" #include "py/obj.h"
typedef enum { typedef enum {
PYEXEC_MODE_RAW_REPL,
PYEXEC_MODE_FRIENDLY_REPL, PYEXEC_MODE_FRIENDLY_REPL,
PYEXEC_MODE_RAW_REPL,
} pyexec_mode_kind_t; } pyexec_mode_kind_t;
extern pyexec_mode_kind_t pyexec_mode_kind; extern pyexec_mode_kind_t pyexec_mode_kind;