Skip to content

Commit fe466bd

Browse files
committed
https://github.com/neu-rah/ArduinoMenu/issues/245
1 parent f62bbd1 commit fe466bd

File tree

4 files changed

+55
-5
lines changed

4 files changed

+55
-5
lines changed

examples/esp8266/WebMenu/WebMenu/WebMenu.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ result idle(menuOut& o,idleEvent e) {
217217
}
218218

219219
template<typename T>//some utill to help us calculate array sizes (known at compile time)
220-
constexpr inline size_t len(T& o) {return sizeof(o)/sizeof(decltype(o[0]));}
220+
constexpr inline size_t menuData_len(T& o) {return sizeof(o)/sizeof(decltype(o[0]));}
221221

222222
//serial menu navigation
223223
MENU_OUTLIST(out,&serverOut);
@@ -227,19 +227,19 @@ NAVROOT(nav,mainMenu,MAX_DEPTH,serial,out);
227227
//xml+http navigation control
228228
noInput none;//web uses its own API
229229
menuOut* web_outputs[]={&serverOut};
230-
outputsList web_out(web_outputs,len(web_outputs));
230+
outputsList web_out(web_outputs,menuData_len(web_outputs));
231231
navNode web_cursors[MAX_DEPTH];
232232
navRoot webNav(mainMenu, web_cursors, MAX_DEPTH, none, web_out);
233233

234234
//json+http navigation control
235235
menuOut* json_outputs[]={&jsonOut};
236-
outputsList json_out(json_outputs,len(json_outputs));
236+
outputsList json_out(json_outputs,menuData_len(json_outputs));
237237
navNode json_cursors[MAX_DEPTH];
238238
navRoot jsonNav(mainMenu, json_cursors, MAX_DEPTH, none, json_out);
239239

240240
//websockets navigation control
241241
menuOut* ws_outputs[]={&wsOut};
242-
outputsList ws_out(ws_outputs,len(ws_outputs));
242+
outputsList ws_out(ws_outputs,menuData_len(ws_outputs));
243243
navNode ws_cursors[MAX_DEPTH];
244244
navRoot wsNav(mainMenu, ws_cursors, MAX_DEPTH, none, ws_out);
245245

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
This directory is intended for project header files.
3+
4+
A header file is a file containing C declarations and macro definitions
5+
to be shared between several project source files. You request the use of a
6+
header file in your project source file (C, C++, etc) located in `src` folder
7+
by including it, with the C preprocessing directive `#include'.
8+
9+
```src/main.c
10+
11+
#include "header.h"
12+
13+
int main (void)
14+
{
15+
...
16+
}
17+
```
18+
19+
Including a header file produces the same results as copying the header file
20+
into each source file that needs it. Such copying would be time-consuming
21+
and error-prone. With a header file, the related declarations appear
22+
in only one place. If they need to be changed, they can be changed in one
23+
place, and programs that include the header file will automatically use the
24+
new version when next recompiled. The header file eliminates the labor of
25+
finding and changing all the copies as well as the risk that a failure to
26+
find one copy will result in inconsistencies within a program.
27+
28+
In C, the usual convention is to give header files names that end with `.h'.
29+
It is most portable to use only letters, digits, dashes, and underscores in
30+
header file names, and at most one dot.
31+
32+
Read more about using header files in official GCC documentation:
33+
34+
* Include Syntax
35+
* Include Operation
36+
* Once-Only Headers
37+
* Computed Includes
38+
39+
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
This directory is intended for PIO Unit Testing and project tests.
3+
4+
Unit Testing is a software testing method by which individual units of
5+
source code, sets of one or more MCU program modules together with associated
6+
control data, usage procedures, and operating procedures, are tested to
7+
determine whether they are fit for use. Unit testing finds problems early
8+
in the development cycle.
9+
10+
More information about PIO Unit Testing:
11+
- https://docs.platformio.org/page/plus/unit-testing.html

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.17.22
2+
version=4.17.23
33
author=Rui Azevedo, [email protected]
44
maintainer=neu-rah, [email protected]
55
sentence=Generic menu/interactivity system

0 commit comments

Comments
 (0)