From da8c4c2653b5121070f8c2872aead79d67d28441 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 12 Sep 2017 16:03:52 +1000 Subject: [PATCH] py/builtinhelp: Change signature of help text var from pointer to array. As a pointer (const char *) it takes up an extra word of storage which is in RAM. --- ports/cc3200/misc/help.c | 2 +- ports/esp8266/help.c | 2 +- ports/stm32/help.c | 2 +- ports/teensy/help.c | 2 +- ports/zephyr/help.c | 2 +- py/builtin.h | 2 +- py/builtinhelp.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ports/cc3200/misc/help.c b/ports/cc3200/misc/help.c index 739303e193..ea0c9501db 100644 --- a/ports/cc3200/misc/help.c +++ b/ports/cc3200/misc/help.c @@ -27,6 +27,6 @@ #include "py/builtin.h" -const char *cc3200_help_text = "Welcome to MicroPython!\n" +const char cc3200_help_text[] = "Welcome to MicroPython!\n" "For online help please visit http://micropython.org/help/.\n" "For further help on a specific object, type help(obj)\n"; diff --git a/ports/esp8266/help.c b/ports/esp8266/help.c index 2035cdd6cb..0a851f4c48 100644 --- a/ports/esp8266/help.c +++ b/ports/esp8266/help.c @@ -26,7 +26,7 @@ #include "py/builtin.h" -const char *esp_help_text = +const char esp_help_text[] = "Welcome to MicroPython!\n" "\n" "For online docs please visit http://docs.micropython.org/en/latest/esp8266/ .\n" diff --git a/ports/stm32/help.c b/ports/stm32/help.c index ea0b6921b0..f9d97b70d6 100644 --- a/ports/stm32/help.c +++ b/ports/stm32/help.c @@ -26,7 +26,7 @@ #include "py/builtin.h" -const char *stm32_help_text = +const char stm32_help_text[] = "Welcome to MicroPython!\n" "\n" "For online help please visit http://micropython.org/help/.\n" diff --git a/ports/teensy/help.c b/ports/teensy/help.c index ebe4bed6bf..a2370c04d2 100644 --- a/ports/teensy/help.c +++ b/ports/teensy/help.c @@ -26,7 +26,7 @@ #include "py/builtin.h" -const char *teensy_help_text = +const char teensy_help_text[] = "Welcome to MicroPython!\n" "\n" "For online help please visit http://micropython.org/help/.\n" diff --git a/ports/zephyr/help.c b/ports/zephyr/help.c index 0c7f279406..becc203f6f 100644 --- a/ports/zephyr/help.c +++ b/ports/zephyr/help.c @@ -26,7 +26,7 @@ #include "py/builtin.h" -const char *zephyr_help_text = +const char zephyr_help_text[] = "Welcome to MicroPython!\n" "\n" "Control commands:\n" diff --git a/py/builtin.h b/py/builtin.h index a637b6e222..84b99a8a4f 100644 --- a/py/builtin.h +++ b/py/builtin.h @@ -118,6 +118,6 @@ extern const mp_obj_module_t mp_module_webrepl; extern const mp_obj_module_t mp_module_framebuf; extern const mp_obj_module_t mp_module_btree; -extern const char *MICROPY_PY_BUILTINS_HELP_TEXT; +extern const char MICROPY_PY_BUILTINS_HELP_TEXT[]; #endif // MICROPY_INCLUDED_PY_BUILTIN_H diff --git a/py/builtinhelp.c b/py/builtinhelp.c index e10e48b7d9..c9992906dd 100644 --- a/py/builtinhelp.c +++ b/py/builtinhelp.c @@ -32,7 +32,7 @@ #if MICROPY_PY_BUILTINS_HELP -const char *mp_help_default_text = +const char mp_help_default_text[] = "Welcome to MicroPython!\n" "\n" "For online docs please visit http://docs.micropython.org/\n"