Skip to content

Commit 3fed5fd

Browse files
authored
Merge pull request #588 from howard0su/ram_save2
Use the array type for strings to let the const string live in ROM.
2 parents f7c1b21 + d9147a8 commit 3fed5fd

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/config/model.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ const char * const RADIO_TX_POWER_VAL[TXPOWER_LAST] =
4141
#define WRITE_FULL_MODEL 0
4242
static u8 auto_map;
4343

44-
const char *MODEL_NAME = "name";
45-
const char *MODEL_ICON = "icon";
46-
const char *MODEL_TYPE = "type";
47-
const char *MODEL_TEMPLATE = "template";
48-
const char *MODEL_AUTOMAP = "automap";
49-
const char *MODEL_MIXERMODE = "mixermode";
44+
const char MODEL_NAME[] = "name";
45+
const char MODEL_ICON[] = "icon";
46+
const char MODEL_TYPE[] = "type";
47+
const char MODEL_TEMPLATE[] = "template";
48+
const char MODEL_AUTOMAP[] = "automap";
49+
const char MODEL_MIXERMODE[] = "mixermode";
5050

5151
/* Section: Radio */
5252
static const char SECTION_RADIO[] = "radio";

src/config/model.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
#endif
1818

1919
/* INI file consts */
20-
extern const char *MODEL_NAME;
21-
extern const char *MODEL_ICON;
22-
extern const char *MODEL_TYPE;
23-
extern const char *MODEL_TEMPLATE;
20+
extern const char MODEL_NAME[];
21+
extern const char MODEL_ICON[];
22+
extern const char MODEL_TYPE[];
23+
extern const char MODEL_TEMPLATE[];
2424
#define UNKNOWN_ICON ("media/noicon" IMG_EXT)
2525

2626
//This cannot be computed, and must be manually updated

src/inputs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
#define BUTNAME_ENTER _tr("Enter")
112112
#define BUTNAME_EXIT _tr("Exit")
113113

114-
const char *tx_stick_names[4] = {
114+
const char * const tx_stick_names[4] = {
115115
_tr_noop("RIGHT_H"),
116116
_tr_noop("LEFT_V"),
117117
_tr_noop("RIGHT_V"),

src/mixer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ struct Curve {
9393
};
9494

9595
//The followingis defined bythe target
96-
extern const char *tx_stick_names[4];
96+
extern const char *const tx_stick_names[4];
9797

9898
enum TemplateType {
9999
MIXERTEMPLATE_NONE,

0 commit comments

Comments
 (0)