summaryrefslogtreecommitdiff
path: root/common/usbc/usb_sm.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/usbc/usb_sm.c')
-rw-r--r--common/usbc/usb_sm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/usbc/usb_sm.c b/common/usbc/usb_sm.c
index 99bed2b1bb..04b7193c0f 100644
--- a/common/usbc/usb_sm.c
+++ b/common/usbc/usb_sm.c
@@ -6,6 +6,7 @@
#include "common.h"
#include "console.h"
#include "stdbool.h"
+#include "task.h"
#include "usb_pd.h"
#include "usb_sm.h"
#include "util.h"
@@ -159,6 +160,14 @@ void set_state(const int port, struct sm_ctx *const ctx,
* any remaining parent states.
*/
internal->running = false;
+
+ /*
+ * Since we are changing states, we want to ensure that we process the
+ * next state's run method as soon as we can to ensure that we don't
+ * delay important processing until the next task interval.
+ */
+ if (IS_ENABLED(HAS_TASK_PD_C0))
+ task_wake(PD_PORT_TO_TASK_ID(port));
}
/*