Skip to content

Commit 10ecbcd

Browse files
author
dave
committed
Interim update of the examples
1 parent e44e416 commit 10ecbcd

File tree

3 files changed

+23
-102
lines changed

3 files changed

+23
-102
lines changed

examples/esp/esp32s2Saola/esp32s2Saola.emf

Lines changed: 15 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
"projectName": "eInk demonstration with digital joystick",
44
"author": "dave",
55
"items": [
6+
{
7+
"parentId": 0,
8+
"type": "actionMenu",
9+
"item": {
10+
"name": "Hibernate",
11+
"variableName": "Hibernate",
12+
"id": 21,
13+
"eepromAddress": -1,
14+
"functionName": "onHibernate",
15+
"readOnly": false,
16+
"localOnly": false,
17+
"visible": true,
18+
"staticDataInRAM": false
19+
}
20+
},
621
{
722
"parentId": 0,
823
"type": "analogItem",
@@ -100,85 +115,6 @@
100115
"staticDataInRAM": false
101116
}
102117
},
103-
{
104-
"parentId": 0,
105-
"type": "subMenu",
106-
"item": {
107-
"secured": false,
108-
"name": "Hibernate",
109-
"variableName": "Hibernate",
110-
"id": 6,
111-
"eepromAddress": -1,
112-
"functionName": "onHibernate",
113-
"readOnly": false,
114-
"localOnly": false,
115-
"visible": true,
116-
"staticDataInRAM": false
117-
}
118-
},
119-
{
120-
"parentId": 6,
121-
"type": "floatItem",
122-
"defaultValue": "0.0",
123-
"item": {
124-
"numDecimalPlaces": 3,
125-
"name": "Float 1",
126-
"variableName": "SelectMeFloat1",
127-
"id": 7,
128-
"eepromAddress": -1,
129-
"readOnly": false,
130-
"localOnly": false,
131-
"visible": true,
132-
"staticDataInRAM": false
133-
}
134-
},
135-
{
136-
"parentId": 6,
137-
"type": "floatItem",
138-
"defaultValue": "0.0",
139-
"item": {
140-
"numDecimalPlaces": 3,
141-
"name": "Float 2",
142-
"variableName": "SelectMeFloat2",
143-
"id": 8,
144-
"eepromAddress": -1,
145-
"readOnly": false,
146-
"localOnly": false,
147-
"visible": true,
148-
"staticDataInRAM": false
149-
}
150-
},
151-
{
152-
"parentId": 6,
153-
"type": "actionMenu",
154-
"item": {
155-
"name": "Press Me",
156-
"variableName": "SelectMePressMe",
157-
"id": 9,
158-
"eepromAddress": -1,
159-
"functionName": "pressMeActionRun",
160-
"readOnly": false,
161-
"localOnly": false,
162-
"visible": true,
163-
"staticDataInRAM": false
164-
}
165-
},
166-
{
167-
"parentId": 6,
168-
"type": "boolItem",
169-
"defaultValue": "true",
170-
"item": {
171-
"naming": "CHECKBOX",
172-
"name": "New BoolItem",
173-
"variableName": "SelectMeNewBoolItem",
174-
"id": 21,
175-
"eepromAddress": -1,
176-
"readOnly": false,
177-
"localOnly": false,
178-
"visible": true,
179-
"staticDataInRAM": false
180-
}
181-
},
182118
{
183119
"parentId": 0,
184120
"type": "subMenu",

examples/esp/esp32s2Saola/esp32s2Saola_menu.cpp

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use elsewhere.
99
*/
1010

11-
// Generated for Arduino ESP32 by TcMenu 4.5.0 on 2026-01-17T20:35:55.954392Z.
11+
// Generated for Arduino ESP32 by TcMenu 4.5.0 on 2026-01-18T09:39:52.216322Z.
1212

1313
#include <tcMenu.h>
1414
#include "esp32s2Saola_menu.h"
@@ -55,19 +55,8 @@ TextMenuItem menuExtrasText(&minfoExtrasText, "", 5, &menuExtrasColor, INFO_LOCA
5555
const PROGMEM SubMenuInfo minfoExtras = { "Extras", 10, 0xffff, 0, NO_CALLBACK };
5656
BackMenuItem menuBackExtras(&minfoExtras, &menuExtrasText, INFO_LOCATION_PGM);
5757
SubMenuItem menuExtras(&minfoExtras, &menuBackExtras, &menuConnectivity, INFO_LOCATION_PGM);
58-
const PROGMEM BooleanMenuInfo minfoSelectMeNewBoolItem = { "New BoolItem", 21, 0xffff, 1, NO_CALLBACK, NAMING_CHECKBOX };
59-
BooleanMenuItem menuSelectMeNewBoolItem(&minfoSelectMeNewBoolItem, true, nullptr, INFO_LOCATION_PGM);
60-
const PROGMEM AnyMenuInfo minfoSelectMePressMe = { "Press Me", 9, 0xffff, 0, pressMeActionRun };
61-
ActionMenuItem menuSelectMePressMe(&minfoSelectMePressMe, &menuSelectMeNewBoolItem, INFO_LOCATION_PGM);
62-
const PROGMEM FloatMenuInfo minfoSelectMeFloat2 = { "Float 2", 8, 0xffff, 3, NO_CALLBACK };
63-
FloatMenuItem menuSelectMeFloat2(&minfoSelectMeFloat2, 0.0, &menuSelectMePressMe, INFO_LOCATION_PGM);
64-
const PROGMEM FloatMenuInfo minfoSelectMeFloat1 = { "Float 1", 7, 0xffff, 3, NO_CALLBACK };
65-
FloatMenuItem menuSelectMeFloat1(&minfoSelectMeFloat1, 0.0, &menuSelectMeFloat2, INFO_LOCATION_PGM);
66-
const PROGMEM SubMenuInfo minfoHibernate = { "Hibernate", 6, 0xffff, 0, onHibernate };
67-
BackMenuItem menuBackHibernate(&minfoHibernate, &menuSelectMeFloat1, INFO_LOCATION_PGM);
68-
SubMenuItem menuHibernate(&minfoHibernate, &menuBackHibernate, &menuExtras, INFO_LOCATION_PGM);
6958
const PROGMEM BooleanMenuInfo minfoDoorOpen = { "Door Open", 5, 10, 1, NO_CALLBACK, NAMING_YES_NO };
70-
BooleanMenuItem menuDoorOpen(&minfoDoorOpen, false, &menuHibernate, INFO_LOCATION_PGM);
59+
BooleanMenuItem menuDoorOpen(&minfoDoorOpen, false, &menuExtras, INFO_LOCATION_PGM);
7160
const char enumStrFoods_0[] PROGMEM = "Pizza";
7261
const char enumStrFoods_1[] PROGMEM = "Pasta";
7362
const char enumStrFoods_2[] PROGMEM = "Salad";
@@ -81,6 +70,8 @@ const PROGMEM AnalogMenuInfo minfoDecEdit = { "Dec Edit", 2, 4, 1000, NO_CALLBAC
8170
AnalogMenuItem menuDecEdit(&minfoDecEdit, 0, &menuHalves, INFO_LOCATION_PGM);
8271
const PROGMEM AnalogMenuInfo minfoIntEdit = { "Int Edit", 1, 2, 100, NO_CALLBACK, 0, 1, "%" };
8372
AnalogMenuItem menuIntEdit(&minfoIntEdit, 0, &menuDecEdit, INFO_LOCATION_PGM);
73+
const PROGMEM AnyMenuInfo minfoHibernate = { "Hibernate", 21, 0xffff, 0, onHibernate };
74+
ActionMenuItem menuHibernate(&minfoHibernate, &menuIntEdit, INFO_LOCATION_PGM);
8475

8576
void setupMenu() {
8677
// First we set up eeprom and authentication (if needed).
@@ -90,15 +81,15 @@ void setupMenu() {
9081
authManager.initialise(menuMgr.getEepromAbstraction(), 200);
9182
menuMgr.setAuthenticator(&authManager);
9283
// Now add any readonly, non-remote and visible flags.
93-
menuConnectivityAuthenticator.setLocalOnly(true);
9484
menuConnectivityIoTMonitor.setLocalOnly(true);
85+
menuConnectivityAuthenticator.setLocalOnly(true);
9586

9687
// Code generated by plugins and new operators.
9788
display.init(115200, true, 10, false);
9889
display.setRotation(0);
9990
renderer.setUpdatesPerSecond(1);
10091
switches.init(internalDigitalIo(), SWITCHES_POLL_EVERYTHING, true);
101-
menuMgr.initFor4WayJoystick(&renderer, &menuIntEdit, 2, 1, 3, 4, -1, 20);
92+
menuMgr.initFor4WayJoystick(&renderer, &menuHibernate, 2, 1, 3, 4, -1, 20);
10293
remoteServer.addConnection(&ethernetConnection);
10394
applyTheme(renderer);
10495

examples/esp/esp32s2Saola/esp32s2Saola_menu.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,15 @@ extern Rgb32MenuItem menuExtrasColor;
5151
extern TextMenuItem menuExtrasText;
5252
extern BackMenuItem menuBackExtras;
5353
extern SubMenuItem menuExtras;
54-
extern BooleanMenuItem menuSelectMeNewBoolItem;
55-
extern ActionMenuItem menuSelectMePressMe;
56-
extern FloatMenuItem menuSelectMeFloat2;
57-
extern FloatMenuItem menuSelectMeFloat1;
58-
extern BackMenuItem menuBackHibernate;
59-
extern SubMenuItem menuHibernate;
6054
extern BooleanMenuItem menuDoorOpen;
6155
extern EnumMenuItem menuFoods;
6256
extern AnalogMenuItem menuHalves;
6357
extern AnalogMenuItem menuDecEdit;
6458
extern AnalogMenuItem menuIntEdit;
59+
extern ActionMenuItem menuHibernate;
6560

6661
// Provide a wrapper to get hold of the root menu item and export setupMenu
67-
inline MenuItem& rootMenuItem() { return menuIntEdit; }
62+
inline MenuItem& rootMenuItem() { return menuHibernate; }
6863
void setupMenu();
6964

7065
// Callback functions must always include CALLBACK_FUNCTION after the return type
@@ -73,6 +68,5 @@ void setupMenu();
7368
void CALLBACK_FUNCTION onListSelected(int id);
7469
int fnExtrasMyListRtCall(RuntimeMenuItem* item, uint8_t row, RenderFnMode mode, char* buffer, int bufferSize);
7570
void CALLBACK_FUNCTION onHibernate(int id);
76-
void CALLBACK_FUNCTION pressMeActionRun(int id);
7771

7872
#endif // MENU_GENERATED_CODE_H

0 commit comments

Comments
 (0)