Skip to content

Restart the WASM module when stopping/starting/panicking #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 9, 2022

Conversation

microbit-matt-hillsdon
Copy link
Contributor

@microbit-matt-hillsdon microbit-matt-hillsdon commented Sep 8, 2022

Fixes panic HAL calls so the device is no longer operable afterwards.

  • Use the same logic for a normal stop/start.
  • Cache the WASM to avoid downloading and compiling it for each module
    instantiation.
  • Prefer using the _foo functions on the module vs cwrap.
  • Incidental fix to the radio message handling in demo.html

No editor changes needed, but given the level of change I've set up a review branch via the editor in case there are integration issues: https://review-python-editor-next.microbit.org/mod-sim-test/

@netlify
Copy link

netlify bot commented Sep 8, 2022

Deploy Preview for distracted-dubinsky-fd8a42 ready!

Name Link
🔨 Latest commit 3d48368
🔍 Latest deploy log https://app.netlify.com/sites/distracted-dubinsky-fd8a42/deploys/631b568ba92a310009de8d1d
😎 Deploy Preview https://deploy-preview-51--distracted-dubinsky-fd8a42.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@microbit-matt-hillsdon microbit-matt-hillsdon changed the title Experimental: Build with MODULARIZE. Restart the WASM module when stopping/starting/panicking Sep 9, 2022
@microbit-matt-hillsdon microbit-matt-hillsdon marked this pull request as ready for review September 9, 2022 13:43
Fixes panic HAL calls so the device is no longer operable afterwards.

- Use the same logic for a normal stop/start.
- Cache the WASM to avoid downloading and compiling it for each module
  instantiation.
- Prefer using the _foo functions on the module vs cwrap.
- Incidental fix to the radio message handling in demo.html
@microbit-matt-hillsdon
Copy link
Contributor Author

I still need to try this on Safari before merge.

@microbit-matt-hillsdon
Copy link
Contributor Author

I still need to try this on Safari before merge.

All good in Safari.

Copy link
Contributor

@microbit-robert microbit-robert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last suggested change, then it looks good to go.

Co-authored-by: Robert Knight <[email protected]>
@microbit-matt-hillsdon
Copy link
Contributor Author

microbit-matt-hillsdon commented Sep 9, 2022

One last suggested change, then it looks good to go.

Thanks, will test the level detection with that change in and then merge.

Copy link
Contributor

@microbit-robert microbit-robert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@microbit-matt-hillsdon microbit-matt-hillsdon merged commit 8279984 into main Sep 9, 2022
@microbit-matt-hillsdon microbit-matt-hillsdon deleted the modularize branch September 9, 2022 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants