diff --git a/samples/subsys/zephyrbt/tutorial/lessons/lesson-4/resources/src/global_ctx.c b/samples/subsys/zephyrbt/tutorial/lessons/lesson-4/resources/src/global_ctx.c index 65bb76b..665dc54 100644 --- a/samples/subsys/zephyrbt/tutorial/lessons/lesson-4/resources/src/global_ctx.c +++ b/samples/subsys/zephyrbt/tutorial/lessons/lesson-4/resources/src/global_ctx.c @@ -21,7 +21,7 @@ zephyrbt_action_init_tree_init(struct zephyrbt_context *ctx, struct tutorial_context *global_ctx; global_ctx = k_malloc(sizeof(struct tutorial_context)); - self->ctx = global_ctx; + ctx->user_data = global_ctx; if (global_ctx == NULL) { LOG_ERR("Context can not be allocate. Need more memory!!"); diff --git a/samples/subsys/zephyrbt/tutorial/lessons/lesson-5/resources/src/global_ctx.c b/samples/subsys/zephyrbt/tutorial/lessons/lesson-5/resources/src/global_ctx.c index 65bb76b..665dc54 100644 --- a/samples/subsys/zephyrbt/tutorial/lessons/lesson-5/resources/src/global_ctx.c +++ b/samples/subsys/zephyrbt/tutorial/lessons/lesson-5/resources/src/global_ctx.c @@ -21,7 +21,7 @@ zephyrbt_action_init_tree_init(struct zephyrbt_context *ctx, struct tutorial_context *global_ctx; global_ctx = k_malloc(sizeof(struct tutorial_context)); - self->ctx = global_ctx; + ctx->user_data = global_ctx; if (global_ctx == NULL) { LOG_ERR("Context can not be allocate. Need more memory!!"); diff --git a/samples/subsys/zephyrbt/tutorial/prj.conf b/samples/subsys/zephyrbt/tutorial/prj.conf index 2b2aa38..57dfe19 100644 --- a/samples/subsys/zephyrbt/tutorial/prj.conf +++ b/samples/subsys/zephyrbt/tutorial/prj.conf @@ -10,6 +10,7 @@ CONFIG_ZEPHYR_BEHAVIOUR_TREE_DYNAMIC=y CONFIG_ZEPHYR_BEHAVIOUR_TREE_NODE_INFO=y CONFIG_ZEPHYR_BEHAVIOUR_TREE_NODE_INIT=y CONFIG_ZEPHYR_BEHAVIOUR_TREE_NODE_CONTEXT=y +CONFIG_ZEPHYR_BEHAVIOUR_TREE_USER_DATA=y CONFIG_ZEPHYR_BEHAVIOUR_TREE_LOG_LEVEL_DBG=y CONFIG_DYNAMIC_THREAD=y