Skip to content

Commit 510086e

Browse files
committed
small fixes for other platforms
override `flush()` on output base jsonFmt remove stream operator usage `MENU_USERAM` not mandatory for non avr devices (disabled by USE_PGM)
1 parent 6d6b4b2 commit 510086e

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

src/macros.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
//////////////////////////////////////////////////////////////////////////////
77
// memory macros ------------------------------------------------------------
88
#ifndef __AVR_ARCH__
9-
#define MENU_USERAM
9+
#ifndef USE_PGM
10+
#define MENU_USERAM
11+
#endif
1012
#endif
1113
#if defined(ESP8266)
1214
#define MENU_ASYNC

src/menuIO/jsonFmt.hpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,20 @@
3434
#endif
3535
int cursorCtrl=0;
3636
void jsonOptions(menuOut& o,navNode &nav,menuNode& node,idx_t idx) {
37-
o<<",\"options\":[";
37+
// o<<",\"options\":[";
38+
o.print(",\"options\":[");
3839
// o<<node.sz();
39-
for(idx_t n=0;n<node.sz();n++)
40-
o<<(n?",":"")<<"\""<<node[n]<<"\"";
41-
o<<"],\"sel\":\""<<((menuVariantBase*)&node)->sync()<<"\"";
40+
for(idx_t n=0;n<node.sz();n++) {
41+
o.print(n?",":"");
42+
o.print("\"");
43+
o.print(node[n].getText());
44+
o.print("\"");
45+
// o<<(n?",":"")<<"\""<<node[n]<<"\"";
46+
}
47+
// o<<"],\"sel\":\""<<((menuVariantBase*)&node)->sync()<<"\"";
48+
o.print("],\"sel\":\"");
49+
o.print(((menuVariantBase*)&node)->sync());
50+
o.print("\"");
4251
}
4352
};
4453
#endif

src/menuIo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
virtual bool fieldMode() const;
1919
inline void fieldOn() {setFieldMode(true);}
2020
inline void fieldOff() {setFieldMode(false);}
21+
void flush() {}
2122
};
2223

2324
class noInput:public menuIn {

0 commit comments

Comments
 (0)