mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 00:51:29 +00:00
pd: more compact PD state trace
Make the PD port state string more friendly with console limited to 64-byte wide string (eg current USB console). Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=on Smaug, open the USB-console to the EC and type "pd 0 state" and see the current type-C port state string. Change-Id: I6903fd0f0b7371aef978f696370a6e3a200c7fa5 Reviewed-on: https://chromium-review.googlesource.com/286785 Reviewed-by: Alec Berg <alecaberg@chromium.org> Trybot-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
d737517db7
commit
d5afd8f968
@@ -2886,15 +2886,15 @@ static int command_pd(int argc, char **argv)
|
||||
} else
|
||||
#endif
|
||||
if (!strncasecmp(argv[2], "state", 5)) {
|
||||
ccprintf("Port C%d, %s - Role: %s-%s%s Polarity: CC%d "
|
||||
"Flags: 0x%04x, State: %s\n",
|
||||
port, pd_comm_enabled ? "Ena" : "Dis",
|
||||
ccprintf("Port C%d CC%d, %s - Role: %s-%s%s "
|
||||
"State: %s, Flags: 0x%04x\n",
|
||||
port, pd[port].polarity + 1,
|
||||
pd_comm_enabled ? "Ena" : "Dis",
|
||||
pd[port].power_role == PD_ROLE_SOURCE ? "SRC" : "SNK",
|
||||
pd[port].data_role == PD_ROLE_DFP ? "DFP" : "UFP",
|
||||
(pd[port].flags & PD_FLAGS_VCONN_ON) ? "-VC" : "",
|
||||
pd[port].polarity + 1,
|
||||
pd[port].flags,
|
||||
pd_state_names[pd[port].task_state]);
|
||||
pd_state_names[pd[port].task_state],
|
||||
pd[port].flags);
|
||||
} else {
|
||||
return EC_ERROR_PARAM1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user