-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Huawei: add HoldCharge #30598
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
Open
CiNcH83
wants to merge
27
commits into
evcc-io:master
Choose a base branch
from
CiNcH83:huawei_nocharge
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+192
−46
Open
Huawei: add HoldCharge #30598
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
92fd1ba
Huawei: add nocharge/holdcharge
CiNcH83 027e72e
naming
CiNcH83 6f7f639
Merge branch 'master' into huawei_nocharge
CiNcH83 7ff6897
also set max. charge power in force-charge mode
CiNcH83 869bdd9
Merge branch 'master' into huawei_nocharge
CiNcH83 3ca64e0
remove forceaccharging block in holdcharge
CiNcH83 6d99426
clamp all charge/discharge register writes
CiNcH83 a9d8a91
Merge branch 'master' into huawei_nocharge
CiNcH83 1d5a14e
Merge branch 'master' into huawei_nocharge
CiNcH83 2005d1c
Merge branch 'master' into huawei_nocharge
CiNcH83 e94672f
Merge branch 'master' into huawei_nocharge
CiNcH83 2de61ae
Merge branch 'master' into huawei_nocharge
CiNcH83 b90437c
Merge branch 'master' into huawei_nocharge
CiNcH83 af7728d
Update templates/definition/meter/huawei-sun2000-hybrid.yaml
CiNcH83 49210b8
implement review
CiNcH83 0a388b5
Huawei Sun2000 hybrid: explain why only charge needs periodic watchdo…
andig d32e9e8
add comment regarding charge watchdog
CiNcH83 535ef22
Merge branch 'master' into huawei_nocharge
CiNcH83 756a14d
Huawei: fix watchdog re-asserting 47100 after mode switch clears it
andig 1872726
Huawei: simplify watchdog switch using default fallback
andig a8ed20a
Merge branch 'master' into huawei_nocharge
CiNcH83 2acff85
Merge branch 'master' into huawei_nocharge
CiNcH83 856158d
Merge branch 'huawei_nocharge' of github.com:CiNcH83/evcc into huawei…
CiNcH83 36567e4
make stopWdt synchronous
CiNcH83 87fd6d0
fix race-condition - 47100 is now entirely handled by the watchdog
CiNcH83 df18297
fix watchdog switch/case
CiNcH83 b26caf0
Merge remote-tracking branch 'remotes/upstream/master' into huawei_no…
CiNcH83 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (complexity): Consider refactoring
stopWdtto return thewdtDonechannel and keep all lock manipulation at the call site so the watchdog shutdown flow is easier to reason about.The main complexity comes from the hidden
o.muunlock/lock insidestopWdt. You can keep the race‑fixing behavior (wait for the last tick to finish) while making the locking andwdtDonelifecycle easier to reason about by:stopWdtpure w.r.t. locking (noo.mu.Unlock()/Lock()).donechannel fromstopWdt, and having the caller handle lock release/ reacquisition around the blocking wait.This keeps all semantics (including “no tick races with subsequent writes”) but avoids subtle lock juggling hidden inside
stopWdt.Suggested refactor
Change
stopWdtto only manage cancellation and thewdtDonechannel:Then, at the call site (inside the returned setter closure where
o.muis held), explicitly handle the unlock/wait/lock pattern:This retains:
wdtDonelifecycle tied to each watchdog instance.But it:
stopWdt.