-
Notifications
You must be signed in to change notification settings - Fork 513
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
[Electron] Power management #1412
Conversation
- Implements getInputCurrentLimit() - Adds getChargeVoltageValue() returning voltage - Adds getRechargeThreshold()/setRechargeThreshold()
charge value based on termination voltage (upper bound) and 20% of physcial charge (lower bound).
- Adds DISCONNECTED state to battery_state_t - Adds power_source_t definition - Adds particle::SimpleEnumDiagnosticData<particle::power::power_source_t> diagnostic source
- Fixes DISCONNECTED battery state detection - Adds DIAG_ID_SYSTEM_POWER_SOURCE diagnostic source implementation
…ark_Idle_Events or listening mode event loop
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.
There is a lot going on here :) Most everything looks good to me, but I fear that staring at it will not be enough to know how well everything works. This one screams for some on-device tests to be added. I would love to see some of the conversion functions validated via unit tests as well, like getNormalizedSoC()
and getChargeVoltageValue()
. Also a comment about what the default setRechargeThreshold()
is be welcome. We'll also need Documentation straight away for this as it's a fairly big change. We also switched from power.disableDPDM();
to power.enableDPDM();
and I would like to know how this has been tested and what effects it will have on USB power sources and also USB power banks / USB wall adapters.
submission notes
Solution
This PR:
DIAG_ID_SYSTEM_POWER_SOURCE
diagnostics data source:POWER_SOURCE_UNKNOWN = 0
POWER_SOURCE_VIN = 1
POWER_SOURCE_USB_HOST = 2
POWER_SOURCE_USB_ADAPTER = 3
POWER_SOURCE_USB_OTG = 4
POWER_SOURCE_BATTERY = 5
BATTERY_STATE_DISCHARGING
)BATTERY_STATE_DISCONNECTED
battery_state
power_source
Steps to Test
N/A
Example App
N/A
References
Completeness