1 /*
2 * Copyright (c) 2020 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include <zephyr/kernel.h>
8 #include <zephyr/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 int main(void)
29 {
30 int ret;
31
32 ret = test();
33 printk("%d\n", ret);
34 return 0;
35 }
36
37 K_THREAD_DEFINE(thread, STACKSIZE, thread_entry, NULL, NULL, NULL,
38 7, K_USER, 0);
39