From 75ff541a016f62aaa4bed92daeffb0459de659b8 Mon Sep 17 00:00:00 2001 From: Sathish Kuttan Date: Fri, 28 Jun 2019 12:59:30 -0700 Subject: [PATCH] samples: intel_s1000: add background thread MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add background thread in audio sample app for IntelĀ® Sue Creek S1000 board Signed-off-by: Sathish Kuttan --- .../intel_s1000_crb/audio/src/framework.c | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 samples/boards/intel_s1000_crb/audio/src/framework.c diff --git a/samples/boards/intel_s1000_crb/audio/src/framework.c b/samples/boards/intel_s1000_crb/audio/src/framework.c new file mode 100644 index 00000000000..9eab38bb6a3 --- /dev/null +++ b/samples/boards/intel_s1000_crb/audio/src/framework.c @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2019 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#define LOG_LEVEL LOG_LEVEL_INF +#include +LOG_MODULE_REGISTER(framework); + +#include + +#include "audio_core.h" + +extern int tun_drv_packet_handler(void); +static int framework_background_thread(void); + +K_THREAD_DEFINE(framework_bg_thread_id, FRAMEWORK_BG_THREAD_STACK_SIZE, + framework_background_thread, NULL, NULL, NULL, + FRAMEWORK_BG_THREAD_PRIORITY, 0, K_NO_WAIT); + +static int framework_background_thread(void) +{ + LOG_INF("Starting framework background thread ..."); + + while (true) { + tun_drv_packet_handler(); + audio_core_process_background_tasks(); + } +}