From 9c64c779dd08721f7d3b091ad9883edc01a87311 Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Tue, 30 Apr 2019 09:21:40 -0600 Subject: usb: add inline helper method for CC lines Expressing logic for CC lines can get very verbose. Add helper inline methods that logical describe the condition we are testing to clean up call sites. BRANCH=none BUG=none TEST=Builds, no functional change. Change-Id: I48c117437bc14f3c55473df7f7c778b55af2706d Signed-off-by: Jett Rink Reviewed-on: https://chromium-review.googlesource.com/1589906 Reviewed-by: Daisuke Nojiri Reviewed-by: Sam Hurst --- common/usb_pd_tcpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common/usb_pd_tcpc.c') diff --git a/common/usb_pd_tcpc.c b/common/usb_pd_tcpc.c index 2bdadcec7e..e39ca998f4 100644 --- a/common/usb_pd_tcpc.c +++ b/common/usb_pd_tcpc.c @@ -954,9 +954,9 @@ int tcpc_run(int port, int evt) */ return (get_time().val >= pd[port].low_power_ts.val && pd[port].cc_pull == TYPEC_CC_RD && - pd[port].cc_status[0] == TYPEC_CC_VOLT_OPEN && - pd[port].cc_status[1] == TYPEC_CC_VOLT_OPEN) ? 200 * MSEC : - 10 * MSEC; + cc_is_open(pd[port].cc_status[0], pd[port].cc_status[1])) + ? 200 * MSEC + : 10 * MSEC; #else return 10*MSEC; #endif -- cgit v1.2.1