Understanding homePopup()

While working on an app, I find the following conditions to be consistent of the homePopup():

  • When in a supplied game like Invaderz, pressing HOME brings up the homePopup() and exiting from this returns you directly into the game where you left off.
  • However, when I press HOME in my custom apps, I get the homePopup() called but exiting from this ā€œrebootsā€ into the Main Loader instead of returning to my app.

So, what am I missing here? I have looked at the Invaderz code and I donā€™t see any special preparations for homePopup() to allow this return to happen properly. Iā€™m at a loss. For now, Iā€™ve employed mp.homePopupEnable(0) to disable homePopup() entirely and am using my own function for that button, but I would love to be able to get intoā€¦and out ofā€¦homePopup() properly.

EDIT: I also noticed that I have to employ mp.inCall=1 to prevent Ringo from trying to sleep. If allowed to attempt it, the display doesnā€™t actually sleepā€¦but ā€œwakingā€ it will result in a ā€œrebootā€ back to Loader (I think Iā€™ve seen this symptom described by someone else before, but struggle to find the thread again). I feel like maybe Iā€™m failing to include some critical parameter, function call, or something else that is resulting is this unusual behavior. Iā€™ve searched in the included game sources for clues (since they manage to all behave properly with these two functions), but havenā€™t hit on anything that stands out yet.

1 Like

Can anyone chime in here? Iā€™m still at a total loss for why I canā€™t return from homePopup() properly.

How are you trying to return from the pop up? Pressing the B button goes back to my app.

I figured it out. Turns out homePopup() doesnā€™t clear mp.buttons.released as it exits and I had a catch for the HOME button because I had homePopup() disabled. Now homePopup() exits without returning to loader. However, when returning from homePopup(), you get dumped to the main menu and the wifi gets disconnected. I probably need better return handling. I plan to add ā€œmemoryā€ to the wifi settings; store them to the SD, try to reconnect to that network when initially loading the main menuā€¦save the user time with subsequent launches (and probably squash whatever is causing the wifi to disconnect on return from homePopup()).

Throwing v0.3 up on github in a moment. This will include re-enablement of homePopup() now that it works, and the new live wifi signal strength I added last night in v0.2.2.

Then Iā€™ll get to work on preserving wifi settings for the next revision. Iā€™m still working on the DHCP Settings page behind the scenes, but itā€™s nowhere near ready yetā€¦mostly because I am still getting a handle on SD card storage, which will be needed for preserving wifi settings between launches anyway. So, I might release DHCP Settings and wifi settings preservation at the same time.

2 Likes

Sorry @TheWebMachine, mustā€™ve missed your post!

Feel free to ask here if anything else is left unclear. Some of the functions are very tricky to understand even for us who wrote them some time ago, so itā€™s no wonder that you have some questions about them! :sweat_smile:

Robert

1 Like