drivers: modem: gsm_ppp: constify modem_cmd and setup_cmd structures
Constifying global data allows to save lots of RAM. This improvement allows to save 224 bytes of RAM when compiled on ARM, with default configuration. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
This commit is contained in:
parent
ddf2278c3f
commit
c934e74bf9
1 changed files with 4 additions and 4 deletions
|
@ -102,7 +102,7 @@ MODEM_CMD_DEFINE(gsm_cmd_error)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct modem_cmd response_cmds[] = {
|
||||
static const struct modem_cmd response_cmds[] = {
|
||||
MODEM_CMD("OK", gsm_cmd_ok, 0U, ""),
|
||||
MODEM_CMD("ERROR", gsm_cmd_error, 0U, ""),
|
||||
MODEM_CMD("CONNECT", gsm_cmd_ok, 0U, ""),
|
||||
|
@ -230,7 +230,7 @@ MODEM_CMD_DEFINE(on_cmd_atcmdinfo_iccid)
|
|||
#endif /* CONFIG_MODEM_SIM_NUMBERS */
|
||||
#endif /* CONFIG_MODEM_SHELL */
|
||||
|
||||
static struct setup_cmd setup_cmds[] = {
|
||||
static const struct setup_cmd setup_cmds[] = {
|
||||
/* no echo */
|
||||
SETUP_CMD_NOHANDLE("ATE0"),
|
||||
/* hang up */
|
||||
|
@ -273,10 +273,10 @@ MODEM_CMD_DEFINE(on_cmd_atcmdinfo_attached)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct modem_cmd check_attached_cmd =
|
||||
static const struct modem_cmd check_attached_cmd =
|
||||
MODEM_CMD("+CGATT:", on_cmd_atcmdinfo_attached, 1U, ",");
|
||||
|
||||
static struct setup_cmd connect_cmds[] = {
|
||||
static const struct setup_cmd connect_cmds[] = {
|
||||
/* connect to network */
|
||||
SETUP_CMD_NOHANDLE("ATD*99#"),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue