Closed rocketbob closed 6 years ago
Removing the if statement, and the offending line, makes it work.
So if I change next to look like this, it works:
bool MenuSystem::next(bool loop) {
if (_p_curr_menu->_p_current_component->has_focus())
return _p_curr_menu->next(loop);
}
This seems to be more reliable:
bool MenuSystem::next(bool loop) { return _p_curr_menu->next(loop); }
Thinking about why this bandaid is working....possible that something funky is going on with the realloc call in add_component.
Please close, I figured out my issue. Nothing amiss with the library!
I noticed a previous bug that was closed for a similar issue I'm having on the Due. I can display a menu just fine but when calling prev(), next(), or back() my Arduino Due hangs.
I've narrowed it down to hanging on the following line, when calling next:
return _p_curr_menu->_p_current_component->next(loop);
It blows up on this line. I've put a Serial.println and commented out all of the next method's code and it never makes it to that point. So it blows up on this line, but its odd because the if statement works fine.
My menu code is per the examples, and I've commented out code out of my render methods to isolate them.
Do you have any suggestions on how to debug this?
My menu initialization code: