Move execution of main from boot.py to apps/home/main.py#80
Open
Giannie wants to merge 2 commits into
Open
Conversation
Collaborator
|
Did you intend the app itself to call this if it wants the RAM, or for the app loader to do this for all apps? The main advantage of the former is that the wifi is not disconnected, and its a bit quicker. If we do decide to do the former, the following will need to be added to invoke a reset and run: if stm.mem8[0x40002850] == 0: # this battery backed RAM section is set to 0 when the name screen runs
with open('main.json', 'w') as f:
f.write('{"main":"apps/app_library/main.py"}')
stm.mem8[0x40002850] = 2 #set this address to != 0 so this if statement doesnt run next time
pyb.hard_reset() |
Contributor
Author
|
Currently I've been splitting off the apps into a main.py which writes the config and a run.py that is the actual worker script. So main.py would be moved to run.py and the new main.py would write: {"main":"apps/app_library/run.py"} Your solution is more elegant though. |
Collaborator
|
Ive taken your code into this branch and integrated it, it just needs testing now. https://github.com/emfcamp/Mk3-Firmware/compare/optional-reset-onrun?expand=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As suggested in #71, execution moved so that it does not get overwritten in a full reset