提交 0ef62c7b 编写于 作者: A amy qian

删除了demo.c文件修改了main.c,相应修改了readme

上级 220343ab
......@@ -84,18 +84,11 @@ CY8CKIT-062-BLE PSoC6 BLE Pioneer Kit 是赛普拉斯推出的一款32位双核C
```
\ | /
- RT - Thread Operating System
/ | \ 4.0.3 build Jan 3 2020
/ | \ 4.0.3 build Jan 6 2020
2006 - 2019 Copyright by rt-thread team
thread1 created ok
thread1 count: 0
thread2 created ok
thread2 count: 0
thread2 count: 1
thread2 count: 2
thread2 count: 3
thread1 count: 1
thread2 count: 4
thread2 count: 5
hello rt-thread
msh >hello rt-thread
hello rt-thread
```
## 联系人信息
......
#include <rtthread.h>
#include "board.h"
#include "cybsp.h"
#include "cy_device_headers.h"
#ifdef RT_USING_FINSH
#include <finsh.h>
#include <shell.h>
#endif
static rt_thread_t tid1 = RT_NULL;
static rt_thread_t tid2 = RT_NULL;
static void thread1_entry(void* parameter)
{
rt_uint32_t count = 0;
parameter = parameter;
rt_kprintf("thread1 created ok\n");
while (1)
{
rt_kprintf("thread1 count: %d\n",count++);
rt_thread_delay(RT_TICK_PER_SECOND);
}
}
static void thread2_entry(void* parameter)
{
rt_uint32_t count = 0;
parameter = parameter;
rt_kprintf("thread2 created ok\n");
while(1)
{
rt_kprintf("thread2 count: %d\n",count++);
rt_thread_delay(RT_TICK_PER_SECOND/4);
}
rt_thread_delay(RT_TICK_PER_SECOND * 4);
rt_thread_delete(tid1);
rt_kprintf("thread1 deleted ok\n");
}
int demo_init(void)
{
tid1 = rt_thread_create("thread1", thread1_entry, RT_NULL, 512, 6, 10);
if (tid1 != RT_NULL)
rt_thread_startup(tid1);
tid2 = rt_thread_create("thread2", thread2_entry, RT_NULL, 512, 6, 10);
if (tid2 != RT_NULL)
rt_thread_startup(tid2);
return 0;
}
......@@ -43,14 +43,23 @@
#include "cycfg.h"
#include "cy_device_headers.h"
#include "cycfg_peripherals.h"
#include <rtthread.h>
#include "board.h"
#include "cybsp.h"
#ifdef RT_USING_FINSH
#include <finsh.h>
#include <shell.h>
#endif
extern int demo_init(void);
int main(void)
{
demo_init();
for(;;)
{
rt_kprintf("hello rt-thread\n");
rt_thread_mdelay(1000);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册