Skip to content

1-wire(all): ensure halt is idempotent#1174

Merged
gen2thomas merged 1 commit intohybridgroup:devfrom
gen2thomas:fix/onewire_halt
Oct 4, 2025
Merged

1-wire(all): ensure halt is idempotent#1174
gen2thomas merged 1 commit intohybridgroup:devfrom
gen2thomas:fix/onewire_halt

Conversation

@gen2thomas
Copy link
Copy Markdown
Collaborator

@gen2thomas gen2thomas commented Oct 4, 2025

Solved issues and/or description of the change

see #1170

The fix is done in a generic way by adding unexposed wrapper functions in "onewire_driver.go". Those functions check for connection is nil before calling the "connection.Func()". Additionally on "driver.Halt()" the connection is set to nil explicitly, so potential users of "d.beforeHalt" (normally functions are named "shutdown") can decide on this variable what to do.

Manual test

none

Checklist

  • The PR's target branch is 'hybridgroup:dev'
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (e.g. by run make test_race)
  • No linter errors exist locally (e.g. by run make fmt_check)
  • I have performed a self-review of my own code

@gen2thomas gen2thomas marked this pull request as ready for review October 4, 2025 10:37
@gen2thomas gen2thomas merged commit ad67d07 into hybridgroup:dev Oct 4, 2025
2 checks passed
@gen2thomas gen2thomas deleted the fix/onewire_halt branch October 4, 2025 10:37
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.

1 participant