Skip to content

Commit

Permalink
samples: intel_s1000: add background thread
Browse files Browse the repository at this point in the history
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
Sathish Kuttan authored and nashif committed Jul 5, 2019
1 parent a2f1ad4 commit 75ff541
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions 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 <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();
}
}

0 comments on commit 75ff541

Please sign in to comment.