Skip to content

Commit fa2c7ec

Browse files
committed
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.
1 parent fad3d08 commit fa2c7ec

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

extmod/modwebrepl.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,9 @@ typedef struct _mp_obj_webrepl_t {
6767
mp_obj_t cur_file;
6868
} mp_obj_webrepl_t;
6969

70-
// These get passed to functions which aren't force-l32, so can't be const
71-
STATIC char passwd_prompt[] = "Password: ";
72-
STATIC char connected_prompt[] = "\r\nWebREPL connected\r\n>>> ";
73-
STATIC char denied_prompt[] = "\r\nAccess denied\r\n";
70+
STATIC const char passwd_prompt[] = "Password: ";
71+
STATIC const char connected_prompt[] = "\r\nWebREPL connected\r\n>>> ";
72+
STATIC const char denied_prompt[] = "\r\nAccess denied\r\n";
7473

7574
STATIC char webrepl_passwd[10];
7675

@@ -138,7 +137,7 @@ STATIC void handle_op(mp_obj_webrepl_t *self) {
138137

139138
switch (self->hdr.type) {
140139
case GET_VER: {
141-
static char ver[] = {MICROPY_VERSION_MAJOR, MICROPY_VERSION_MINOR, MICROPY_VERSION_MICRO};
140+
static const char ver[] = {MICROPY_VERSION_MAJOR, MICROPY_VERSION_MINOR, MICROPY_VERSION_MICRO};
142141
write_webrepl(self->sock, ver, sizeof(ver));
143142
self->hdr_to_recv = sizeof(struct webrepl_file);
144143
return;

0 commit comments

Comments
 (0)