From a3b41f1ebcd5d279d9b989ca3f341a1b6a6eb47b Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Wed, 2 Apr 2014 12:18:30 -0700 Subject: [PATCH] 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 Reviewed-on: https://chromium-review.googlesource.com/192873 Reviewed-by: Randall Spangler --- common/charge_state_v2.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index 567ec29fa1..4a8d13f4c0 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -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; }