@@ -19,12 +19,7 @@ for correcting unsigned values validation
1919 #define RSITE_ARDUINO_MENU_SYSTEM
2020 #include < Arduino.h>
2121 #if defined(DEBUG)
22- // #ifdef _U8G2LIB_HH
23- // because U8G2 already uses Streaming
2422 #include < Streaming.h>
25- // #else
26- // #include <streamFlow.h>
27- // #endif
2823 #endif
2924 #include " menuBase.h"
3025 #include " shadows.h"
@@ -104,9 +99,11 @@ for correcting unsigned values validation
10499 inline result operator ()(FUNC_PARAMS) const {return (*shadow)(FUNC_VALUES);}
105100 idx_t printRaw (menuOut& out,idx_t len) const ;
106101 virtual prompt* seek (idx_t * uri,idx_t len) {return len?NULL :this ;}
102+ #ifdef MENU_ASYNC
107103 virtual bool async (const char *uri,navRoot& root,idx_t lvl) {
108104 return ((!*uri)||(uri[0 ]==' /' &&!uri[1 ]));
109105 }
106+ #endif
110107
111108 // some functions to use on htmlFmt
112109 // for enumerations:
@@ -167,7 +164,9 @@ for correcting unsigned values validation
167164 bool tunning=false ;
168165 fieldBase (constMEM promptShadow& shadow):navTarget(shadow) {}
169166 virtual classes type () const {return fieldClass;}
170- bool async (const char *uri,navRoot& root,idx_t lvl) override ;
167+ #ifdef MENU_ASYNC
168+ bool async (const char *uri,navRoot& root,idx_t lvl) override ;
169+ #endif
171170 inline constMEM char * units () {return ((fieldBaseShadow*)shadow)->_units ();}
172171 void doNav (navNode& nav,navCmd cmd) override ;
173172 virtual bool canTune ()=0;
@@ -259,7 +258,9 @@ for correcting unsigned values validation
259258 inline idx_t sz () const {return ((menuNodeShadow*)shadow)->_sz ();}
260259 inline prompt* constMEM* data () const {return ((menuNodeShadow*)shadow)->_data ();}
261260 prompt* seek (idx_t * uri,idx_t len) override ;
262- bool async (const char *uri,navRoot& root,idx_t lvl=0 ) override ;
261+ #ifdef MENU_ASYNC
262+ bool async (const char *uri,navRoot& root,idx_t lvl=0 ) override ;
263+ #endif
263264 };
264265
265266 // --------------------------------------------------------------------------
@@ -703,32 +704,33 @@ for correcting unsigned values validation
703704 return sleepTask?idleChanged:node ().changed (out);
704705 }
705706 inline bool changed (idx_t n) const {return changed (out[n]);}
706- inline bool async (const char * at) {
707- navFocus=path[level].target ;
708- return active ().async (at, *this , 0 );
709- }
710- menuOut& printPath (menuOut& o) const {
711- for (idx_t n=0 ;n<level;n++) {
712- o.print (' /' );
713- o.print (path[n].sel );
707+ #ifdef MENU_ASYNC
708+ inline bool async (const char * at) {
709+ navFocus=path[level].target ;
710+ return active ().async (at, *this , 0 );
714711 }
715- return o;
716- }
712+ menuOut& printPath (menuOut& o) const {
713+ for (idx_t n=0 ;n<level;n++) {
714+ o.print (' /' );
715+ o.print (path[n].sel );
716+ }
717+ return o;
718+ }
719+ // async printMenu on arbitrary menuOut device
720+ Used printMenu (menuOut& o) const {
721+ _trace (Serial<<" navRoot::printMenu(menuOut& o)" <<endl);
722+ if ((active ().sysStyles ()&_parentDraw)&&level)
723+ return o.printMenu (path[level-1 ]);
724+ else return o.printMenu (node ());
725+ }
726+ #endif
717727 Used printMenu () const {
718728 trace (Serial<<" navRoot::printMenu" <<endl);
719729 if ((active ().sysStyles ()&_parentDraw)&&level)
720730 return out.printMenu (path[level-1 ]);
721731 else return out.printMenu (node ());
722732 }
723733
724- // async printMenu on arbitrary menuOut device
725- Used printMenu (menuOut& o) const {
726- _trace (Serial<<" navRoot::printMenu(menuOut& o)" <<endl);
727- if ((active ().sysStyles ()&_parentDraw)&&level)
728- return o.printMenu (path[level-1 ]);
729- else return o.printMenu (node ());
730- }
731-
732734 // menu IO - external iteration functions
733735 void doInput (menuIn& in);
734736 inline void doInput (const char *in) {
0 commit comments