summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-07-03 12:50:13 +1000
committerDamien George <damien.p.george@gmail.com>2019-07-03 12:50:13 +1000
commitfa2c7ece8f0c48cab77098f8f4ffe940c459dfee (patch)
tree4b0a852231a79fa7a3cd0dba76162a04397c7de2
parentfad3d08d2df4b7e62627969510c1507615c5ad3c (diff)
extmod/modwebrepl: Make prompt/ver static arrays const to not use RAM.
The esp8266 lwip_open library is compiled with -mforce-l32 so these arrays do not need to be in RAM.
-rw-r--r--extmod/modwebrepl.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/extmod/modwebrepl.c b/extmod/modwebrepl.c
index c9ef77434..3c0cfe72f 100644
--- a/extmod/modwebrepl.c
+++ b/extmod/modwebrepl.c
@@ -67,10 +67,9 @@ typedef struct _mp_obj_webrepl_t {
mp_obj_t cur_file;
} mp_obj_webrepl_t;
-// These get passed to functions which aren't force-l32, so can't be const
-STATIC char passwd_prompt[] = "Password: ";
-STATIC char connected_prompt[] = "\r\nWebREPL connected\r\n>>> ";
-STATIC char denied_prompt[] = "\r\nAccess denied\r\n";
+STATIC const char passwd_prompt[] = "Password: ";
+STATIC const char connected_prompt[] = "\r\nWebREPL connected\r\n>>> ";
+STATIC const char denied_prompt[] = "\r\nAccess denied\r\n";
STATIC char webrepl_passwd[10];
@@ -138,7 +137,7 @@ STATIC void handle_op(mp_obj_webrepl_t *self) {
switch (self->hdr.type) {
case GET_VER: {
- static char ver[] = {MICROPY_VERSION_MAJOR, MICROPY_VERSION_MINOR, MICROPY_VERSION_MICRO};
+ static const char ver[] = {MICROPY_VERSION_MAJOR, MICROPY_VERSION_MINOR, MICROPY_VERSION_MICRO};
write_webrepl(self->sock, ver, sizeof(ver));
self->hdr_to_recv = sizeof(struct webrepl_file);
return;