Skip to content

Commit 68f0a2f

Browse files
committed
using const char* on non AVR's
#307 #310 (comment)
1 parent f3a8cf3 commit 68f0a2f

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

examples/lolin32/lolin32/lolin32.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ altMENU(menu,timeMenu,"Time",doNothing,noEvent,noStyle,(systemStyles)(_asPad|Men
114114
,FIELD(mins,"","",0,59,10,1,doNothing,noEvent,wrapStyle)
115115
);
116116

117-
char* constMEM hexDigit MEMMODE="0123456789ABCDEF";
118-
char* constMEM hexNr[] MEMMODE={hexDigit};
117+
const char* constMEM hexDigit MEMMODE="0123456789ABCDEF";
118+
const char* constMEM hexNr[] MEMMODE={hexDigit};
119119
char buf1[]="0000";
120120

121-
char* constMEM alphaNum MEMMODE=" 0123456789.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,\\|!\"#$%&/()=?~*^+-{}[]€";
122-
char* constMEM alphaNumMask[] MEMMODE={alphaNum};
121+
const char* constMEM alphaNum MEMMODE=" 0123456789.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,\\|!\"#$%&/()=?~*^+-{}[]€";
122+
const char* constMEM alphaNumMask[] MEMMODE={alphaNum};
123123
char name[]=" ";
124124

125125
MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ArduinoMenu library
2-
version=4.20.4
2+
version=4.21.0
33
author=Rui Azevedo, [email protected]
44
maintainer=neu-rah, [email protected]
55
sentence=Generic menu/interactivity system

src/macros.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ Menu::outputsList id(id##_outPtrs,sizeof(id##_outPtrs)/sizeof(Menu::menuOut*));
298298
objType<typeof(target)> _menuField##cnt(fieldShadows##cnt.obj);
299299
// constMEM Menu::menuFieldShadow<typeof(target)>& _fieldShadow##cnt=*(Menu::menuFieldShadow<typeof(target)>*)&fieldShadowRaw##cnt;
300300
#define DECL_EDIT_(cnt,objType,ss,label,buf,valid,action,mask,style)\
301-
constText textFieldLabel##cnt[] MEMMODE=label;\
301+
const char textFieldLabel##cnt[] MEMMODE=label;\
302302
constMEM MEMMODE Menu::textFieldShadows textfieldShadows##cnt={\
303303
(Menu::callback)action,\
304304
ss,\

src/nav.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
//multiple panels
1616
class panelsList {
1717
public:
18-
constMEM panel* panels;
18+
const panel* panels;
1919
navNode** nodes;
2020
constMEM idx_t sz;
2121
idx_t cur=0;
22-
inline panelsList(constMEM panel p[],navNode* nodes[],idx_t sz):panels(p),nodes(nodes),sz(sz) {
22+
inline panelsList(const panel p[],navNode* nodes[],idx_t sz):panels(p),nodes(nodes),sz(sz) {
2323
reset();
2424
}
2525
void reset(idx_t from=0);

src/shadows.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
struct promptShadowRaw {
1111
actionRaw a;//the hooked callback function
1212
systemStyles sysStyles;
13-
constText*text;
13+
const char* text;
1414
constMEM eventMask events;//registered events
1515
styles style;
1616
};
1717
class promptShadow:public action {
1818
protected:
1919
public:
2020
systemStyles sysStyles;
21-
constText*text;
21+
const char* text;
2222
eventMask events;//registered events (mask)
2323
styles style;
2424
public:
25-
promptShadow(constText* t,action a=doNothing,eventMask e=noEvent,styles s=noStyle,systemStyles ss=_noStyle)
25+
promptShadow(const char* t,action a=doNothing,eventMask e=noEvent,styles s=noStyle,systemStyles ss=_noStyle)
2626
:action(a),sysStyles(ss),text(t),events(e),style(s) {}
2727
inline constText* getText() const {return (constText*)memPtr(text);}
2828
inline systemStyles _sysStyles() const {return (systemStyles)memEnum(&sysStyles);}
@@ -36,21 +36,21 @@
3636
struct textFieldShadowRaw {
3737
actionRaw a;
3838
systemStyles sysStyles;
39-
constText*text;
39+
const char*text;
4040
eventMask events;//registered events
4141
styles style;
4242
char* buffer;
43-
constText* const* validators;
43+
const char* const* validators;
4444
idx_t sz;
4545
};
4646
class textFieldShadow:public promptShadow {
4747
protected:
4848
public:
4949
char* buffer;
50-
constText* const* validators;
50+
const char* const* validators;
5151
idx_t sz;
5252
textFieldShadow(
53-
constText* label,
53+
const char* label,
5454
char* b,
5555
idx_t sz,
5656
char* const* v,
@@ -73,7 +73,7 @@
7373
struct menuNodeShadowRaw {
7474
actionRaw a;
7575
systemStyles sysStyles;
76-
constText*text;
76+
const char* text;
7777
eventMask events;//registered events
7878
styles style;
7979
idx_t sz;
@@ -103,7 +103,7 @@
103103
struct fieldBaseShadowRaw {
104104
actionRaw a;
105105
systemStyles sysStyles;
106-
constText*text;
106+
const char* text;
107107
eventMask events;//registered events
108108
styles style;
109109
constText* units;
@@ -119,7 +119,7 @@
119119
struct menuFieldShadowRaw {
120120
actionRaw a;
121121
systemStyles sysStyles;
122-
constText*text;
122+
const char* text;
123123
eventMask events;//registered events
124124
styles style;
125125
constText* units;
@@ -161,7 +161,7 @@
161161
struct menuValueShadowRaw {
162162
actionRaw a;
163163
systemStyles sysStyles;
164-
constText*text;
164+
const char* text;
165165
eventMask events;//registered events
166166
styles style;
167167
T value;
@@ -197,7 +197,7 @@
197197
struct menuVariantShadowRaw {
198198
actionRaw a;
199199
systemStyles sysStyles;
200-
constText*text;
200+
const char* text;
201201
constMEM eventMask events;//registered events
202202
styles style;
203203
idx_t sz;

0 commit comments

Comments
 (0)