summaryrefslogtreecommitdiff
path: root/include/usb_pe_sm.h
diff options
context:
space:
mode:
authorSam Hurst <shurst@google.com>2019-05-22 14:13:40 -0700
committerCommit Bot <commit-bot@chromium.org>2019-06-05 21:43:03 +0000
commitd76c396bf65e912c2aa2ca1e905daa74996cdb27 (patch)
treec34654adeebeb793d548215c2eaf6f4f4ba3bdfe /include/usb_pe_sm.h
parent184701a33a0f77dfbe38d231d05741db1f8ddbc6 (diff)
downloadchrome-ec-d76c396bf65e912c2aa2ca1e905daa74996cdb27.tar.gz
chocodile_vpdmcu: Firmware refactoring
Move code in header files into c source files. BUG=b:133341676 BRANCH=none TEST=manual Charge-Through was tested on an Atlas running a DRP USB-C/PD state machine with CTUnattached.SNK and CTAttached.SNK states. Change-Id: Ib1b51a778b937e02908f0bc8866bc91a39831163 Signed-off-by: Sam Hurst <shurst@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1626036 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Sam Hurst <shurst@google.com> Tested-by: Sam Hurst <shurst@google.com>
Diffstat (limited to 'include/usb_pe_sm.h')
-rw-r--r--include/usb_pe_sm.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/usb_pe_sm.h b/include/usb_pe_sm.h
index a8fd59b08c..ae925c270e 100644
--- a/include/usb_pe_sm.h
+++ b/include/usb_pe_sm.h
@@ -8,6 +8,8 @@
#ifndef __CROS_EC_USB_PE_H
#define __CROS_EC_USB_PE_H
+#include "usb_sm.h"
+
enum pe_error {
ERR_RCH_CHUNKED,
ERR_RCH_MSG_REC,
@@ -15,6 +17,12 @@ enum pe_error {
ERR_TCH_XMIT,
};
+/*
+ * PE_OBJ is a convenience macro to access struct sm_obj, which
+ * must be the first member of struct policy_engine.
+ */
+#define PE_OBJ(port) (SM_OBJ(pe[port]))
+
/**
* Initialize the Policy Engine State Machine
*