Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
samples: intel_s1000: add background thread
Add background thread in audio sample app for Intel® Sue Creek S1000 board Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,30 @@ | |||
/* | |||
* Copyright (c) 2019 Intel Corporation | |||
* | |||
* SPDX-License-Identifier: Apache-2.0 | |||
*/ | |||
|
|||
#define LOG_LEVEL LOG_LEVEL_INF | |||
#include <logging/log.h> | |||
LOG_MODULE_REGISTER(framework); | |||
|
|||
#include <zephyr.h> | |||
|
|||
#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(); | |||
} | |||
} |