Skip to content

Commit ae89c74

Browse files
committed
Slightly modify custom menu code
1 parent df52883 commit ae89c74

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/Braccio++.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@ class BraccioClass {
6868
bool connected(int joint_index) {
6969
return _connected[joint_index];
7070
}
71-
void createMenu() {
72-
if (_customMenu != NULL) {
73-
_customMenu();
74-
} else {
75-
defaultMenu();
76-
}
77-
}
7871

7972
int getKey();
8073
void connectJoystickTo(lv_obj_t* obj);

src/Braccio.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,11 @@ bool BraccioClass::begin(voidFuncPtr customMenu) {
109109
p_objGroup = lv_group_create();
110110
lv_group_set_default(p_objGroup);
111111

112-
_customMenu = customMenu;
113-
createMenu();
112+
if (customMenu) {
113+
customMenu();
114+
} else {
115+
defaultMenu();
116+
}
114117

115118
gfx.fillScreen(TFT_BLACK);
116119
gfx.println("\n\nPlease\nconnect\npower");

0 commit comments

Comments
 (0)