esp-hal
esp-hal copied to clipboard
Remove `EspWifiInitFor` & more granular init/deinit per driver
trafficstars
Thank you for your contribution!
We appreciate the time and effort you've put into this pull request. To help us review it efficiently, please ensure you've gone through the following checklist:
Submission Checklist 📝
- [ ] I have updated existing examples or added new ones (if applicable).
- [x] I have used
cargo xtask fmt-packagescommand to ensure that all changed code is formatted correctly. - [ ] My changes were added to the
CHANGELOG.mdin the proper section. - [ ] I have added necessary changes to user code to the Migration Guide.
- [x] My changes are in accordance to the esp-rs API guidelines
Extra:
- [x] I have read the CONTRIBUTING.md guide and followed its instructions.
Pull Request Details 📖
Description
- Rework
EspWifiInittoEspWifiController- bikeshedding welcome - No longer require EspWifiInitFor on
initialize - Add Drop impls for each driver, and add Drop for EspWifiController to fully deinit the stack
deinitno longer returns the used resources, instead the peripheral ref pattern will take care of this
I haven't updated all the examples yet, I'll do so after a bit of review.
Testing
Try this modified wifi_dhcp example: https://gist.github.com/MabezDev/78aac5133c482a56db9600697c179650