Skip to content

lis2mdl: Remove useless try/except around sleep_ms calls.#62

Merged
nedseb merged 2 commits intomainfrom
fix/lis2mdl-remove-useless-try-except
Mar 12, 2026
Merged

lis2mdl: Remove useless try/except around sleep_ms calls.#62
nedseb merged 2 commits intomainfrom
fix/lis2mdl-remove-useless-try-except

Conversation

@nedseb
Copy link
Copy Markdown
Contributor

@nedseb nedseb commented Mar 12, 2026

Summary

  • Remove unnecessary try/except blocks around sleep_ms() calls in soft_reset() and reboot() methods
  • sleep_ms() does not raise exceptions in normal operation — the try/except was dead code

Closes #59

Test plan

  • ruff check passes
  • Hardware test: verify soft_reset() and reboot() still work correctly on the board

@nedseb nedseb requested review from Charly-sketch and Copilot March 12, 2026 15:58
@nedseb nedseb added the enhancement New feature or request label Mar 12, 2026
@nedseb nedseb self-assigned this Mar 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes unnecessary try/except blocks around sleep_ms() calls in the LIS2MDL driver's soft_reset() and reboot() methods, and adds hardware-only test scenarios to verify these methods still work.

Changes:

  • Remove dead try/except wrappers around sleep_ms() in soft_reset() and reboot()
  • Add two hardware-only test scenarios for soft_reset() and reboot() followed by WHO_AM_I verification

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/lis2mdl/lis2mdl/device.py Remove try/except around sleep_ms in soft_reset and reboot
tests/scenarios/lis2mdl.yaml Add hardware test scenarios for soft_reset and reboot

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nedseb nedseb merged commit f3bf1a0 into main Mar 12, 2026
8 checks passed
@nedseb nedseb deleted the fix/lis2mdl-remove-useless-try-except branch March 15, 2026 14:31
@semantic-release-updater
Copy link
Copy Markdown

🎉 This PR is included in version 0.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

drivers: Replace bare except clauses with except Exception.

2 participants