1 /*
2 * Copyright (c) 2020 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include <zephyr.h>
8 #include <sys/printk.h>
9
10 #define STACKSIZE 512
11
test(void)12 static int test(void)
13 {
14 int a;
15 int b;
16
17 a = 10;
18 b = a * 2;
19
20 return a + b;
21 }
22
thread_entry(void * p1,void * p2,void * p3)23 static void thread_entry(void *p1, void *p2, void *p3)
24 {
25 printk("Hello from user thread!\n");
26 }
27
main(void)28 void main(void)
29 {
30 int ret;
31
32 ret = test();
33 printk("%d\n", ret);
34 }
35
36 K_THREAD_DEFINE(thread, STACKSIZE, thread_entry, NULL, NULL, NULL,
37 7, K_USER, 0);
38