1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-12-08 WangShun first version
*/
#include "rtthread.h"
#include "hal_fc_event.h"
#include <stdio.h>
#include <stdint.h>
#include "rtconfig.h"
#include "udma_uart_driver.h"
#include "stdlib.h"
/*Note:Bsp shell switch flag,do not modify*/
int irq_cli_flag = 1;
/*If add CorevMCU_CLI package,please put the code in example.c here*/
#define rtthread_task
static struct rt_thread test1_thread;
static rt_thread_t test2_thread = RT_NULL;
rt_align(RT_ALIGN_SIZE)
static rt_uint8_t rt_test1_thread_stack[1024];
static void test1_thread_entry(void* parameter);
static void test2_thread_entry(void* parameter);
void test_init(void)
{
rt_kprintf("Hello RT-Thread!\r\n");
}
INIT_APP_EXPORT(test_init);
int main(void)
{
#ifndef rtthread_task
rt_thread_init(&test1_thread,
"test1",
test1_thread_entry,
RT_NULL,
&rt_test1_thread_stack[0],
sizeof(rt_test1_thread_stack),
6,
20);
rt_thread_startup(&test1_thread);
test2_thread = rt_thread_create( "test2",
test2_thread_entry,
RT_NULL,
512,
5,
20);
rt_thread_startup(test2_thread);
#endif
}
static void test1_thread_entry(void* parameter)
{
while (1)
{
rt_kprintf("test1\r\n");
rt_thread_delay(500);
}
}
static void test2_thread_entry(void* parameter)
{
while (1)
{
rt_kprintf("test2\r\n");
rt_thread_delay(500);
}
}
|