-
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
Fixes abnormal battery charged behavior and adds a test for battery state deducing. #2290
Conversation
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.
This is a good candidate to have as a 'test application', however using the test framework here doesn't bring any benefits and will not allow us to easily migrate this test suite to be run in an automated manner.
Is there any way we can figure out several bite-sized test cases that we can run in a semi-automated manner similar to wiring/power_management
with appropriate assertions in place, so that we don't have to eyeball the behavior of the device?
I did take some time thinking how we can automate the test. My thinking was that the test application prompts tester to set up the hardware, for example, "Please plug the battery and USB", then the application would automatically enable/disable charging and make some assertion according to the current hardware setup. After the test case runs for a period, then prompt tester to set up the hardware in another manner and continue the next test case, and so on. The assertions would be that the power source and battery state should be consistent under certain hardware setup. How does the plan sound? |
@XuGuohui Yes, that sounds much better:
|
I had a similar feeling of wanting it to setup and verify something instead of display results. |
a39d97b
to
2e9f63f
Compare
return (System.batteryState()!= BATTERY_STATE_UNKNOWN) && (System.powerSource() == POWER_SOURCE_USB_HOST); | ||
}, 10000)); | ||
PMIC power; | ||
assertTrue(power.isChargingEnabled()); |
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.
This failed for me a number of with battery at around 4.02V.
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.
This fails only if the SystemPowerFeature::DISABLE_CHARGING
is true
or the battery is disconnected. Otherwise, the PMIC might have tweaked its register for some reason.
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.
It's probably that on startup we get continuous charged event even if when we raise the recharge threshold to be 300mV
…e to fix Electron builds
cda6155
to
602eee5
Compare
Add a manual test application for validating battery state. This is a supplement of #2272.
Completeness