More info in console messages from charge state v2

Instead of printing "problem 2", print "problem 2 (set current)".

BUG=none
BRANCH=ToT
TEST=manual

Let the battery charge, watch the EC console for problems. Observe the new
messages.

Change-Id: I787c2fba4630421cdbd02050e96d8203b0268b3f
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/192873
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Bill Richardson
2014-04-02 12:18:30 -07:00
committed by chrome-internal-fetch
parent 2cd8a20204
commit a3b41f1ebc

View File

@@ -64,6 +64,16 @@ enum problem_type {
NUM_PROBLEM_TYPES
};
static const char * const prob_text[] = {
"static update",
"set voltage",
"set current",
"post init",
"chg params",
"batt params",
"custom profile",
};
BUILD_ASSERT(ARRAY_SIZE(prob_text) == NUM_PROBLEM_TYPES);
/*
* TODO(crosbug.com/p/27639): When do we decide a problem is real and not
@@ -71,7 +81,8 @@ enum problem_type {
*/
static void problem(enum problem_type p, int v)
{
ccprintf("[%T %s: problem %d, value 0x%x]\n", __FILE__, p, v);
ccprintf("[%T %s: problem %d (%s), value 0x%x]\n", __FILE__,
p, prob_text[p], v);
problems_exist = 1;
}