From d0aa5bf76291764053d7e2720ef9fa91816c0c27 Mon Sep 17 00:00:00 2001 From: Wu Zhigang Date: Fri, 20 Jul 2018 10:49:21 +0800 Subject: [PATCH] component: draw the state machine flow chart this flow chart diagram only cover the right flow. if there is no event between two states, that means you will hit the error flow during state transfer. Signed-off-by: Wu Zhigang --- src/include/sof/audio/component.h | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index f5835283bd20..471332c751ca 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -49,16 +49,31 @@ * * States may transform as below:- * - * 1) i.e. Initialisation to playback and pause/release - * init --> setup --> prepare --> active <-> paused --+ - * ^ | - * +-----------------------------+ * - * 2) i.e. Suspend + * ------------- + * pause | | stop/xrun + * +-------------| ACTIVITY |---------------+ + * | | | | prepare + * | ------------- | +-----------+ + * | ^ ^ | | | + * | | | | | | + * v | | v | | + * ------------- | | ------------- | + * | | release | | start | | | + * | PAUSED |-----------+ +-------------| PREPARE |<-------+ + * | | | | + * ------------- ------------- + * | ^ ^ + * | stop/xrun | | + * +--------------------------------------+ | + * | prepare + * ------------- | + * | | | + * ----------->| READY |------------------+ + * reset | | + * ------------- + * * - * setup --> suspend --> setup OR - * prepare --> suspend -> prepare OR - * paused --> suspend --> paused */ #define COMP_STATE_INIT 0 /* component being initialised */