Skip to content

Commit 6999678

Browse files
committed
#44 fix mightycore compile error, #43 menu iteration does not traverse into submenus that don't match predicate
1 parent 74bd4f5 commit 6999678

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/BaseRenderers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ class TitleWidget {
8484
#ifdef __AVR__
8585
const uint8_t* getCurrentIcon() {
8686
changed = false;
87-
return pgm_read_ptr(&iconData[currentState]);
87+
return (const uint8_t *)pgm_read_ptr(&iconData[currentState]);
8888
}
8989
const uint8_t* getIcon(int num) {
9090
if(num >= maxStateIcons) num = 0;
91-
return pgm_read_ptr(&iconData[num]);
91+
return (const uint8_t *)pgm_read_ptr(&iconData[num]);
9292
}
9393
#else
9494
const uint8_t* getCurrentIcon() {

src/MenuIterator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ MenuItem* MenuItemIterator::nextItem() {
104104
processingSubMenu = true;
105105
return currentItem;
106106
}
107-
else processingSubMenu = true;
107+
else processingSubMenu = predicateMatches;
108108

109-
// we always follow submenus even if we don't report them. But we sometimes need
110-
// to do it in two iterations.
109+
// We should most certainly not follow a sub menu that does not match, because it's
110+
// highly unlikely to be useful and will probably cause problems in the remote side.
111111
if(processingSubMenu) {
112112
processingSubMenu = false;
113113
parentItems[level++] = currentItem;

0 commit comments

Comments
 (0)