ThinkNode M6: expose external-power and charger state - #3202
Open
F4FPR wants to merge 5 commits into
Open
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
MainBoard::isChargerActive()with a safe default offalse;existing
EXT_PWR_DETECT/EXT_CHRG_DETECTconventions;isExternalPowered()andisChargerActive()on the M6;powerCLI command returning battery millivolts, external-powerstate and charger-source state.
Example:
Why
The generic nRF52 implementation only checks MCU USB VBUS. The ThinkNode M6 also
has dedicated board signals for external input (P0.13, active HIGH) and its solar
charger (P0.15, active LOW). Exposing both makes USB/powerbank and solar behavior
observable without changing the charging path.
Semantics
ext:yesmeans that the dedicated external-input line, the active chargerline, or the nRF52 USB-VBUS fallback detects an external source;
charger:yesmeans that the solar charger signal is active or an external USBcharging source is present;
current from charge completion.
Scope
isChargerActive() == false;configuration;
strcmp, so it does not overlap withpoweroff;Testing
The board-state logic was compiled and exercised in an isolated C++11 harness
for no source, external USB input and active solar charging. Full target build
and on-device validation remain for CI/hardware.
Expected hardware checks:
ext:no charger:no;ext:yes charger:yes;ext:yes charger:yes;ext:no charger:noonce the charger line isinactive.