powermgmt: Better time estimation

This method, while far from perfect, is able to make use of
real-time battery usage information and updates frequently
in fine-grained increments. This should make time estimates
a lot more useful than they previously were.

Change-Id: I66c6daba88210f60a27e239fbbcc56869be3b878
This commit is contained in:
Aidan MacDonald 2021-12-23 02:49:50 +00:00
parent 90dd2f84a9
commit 96cfe329a6
2 changed files with 50 additions and 16 deletions

View file

@ -95,8 +95,8 @@ void powermgmt_init(void) INIT_ATTR;
#endif
#ifndef BATT_CURRENT_AVE_SAMPLES
/* TODO may need tweaking */
#define BATT_CURRENT_AVE_SAMPLES 16
/* semi arbitrary but needs to be 'large' for the time estimation algorithm */
#define BATT_CURRENT_AVE_SAMPLES 128
#endif
#ifndef POWER_THREAD_STEP_TICKS