refresh doc

This commit is contained in:
daishengdong
2020-01-06 10:31:58 +08:00
parent c9556307df
commit f55b05429b
4 changed files with 24 additions and 24 deletions

View File

@@ -158,7 +158,7 @@ k_err_t tos_task_create(k_task_t *task,
3、编写main.c示例代码
```c
#include "tos.h" // 添加TencentOS tiny内核接口头文件
#include "tos_k.h" // 添加TencentOS tiny内核接口头文件
#include "mcu_init.h" // 包含mcu初始化头文件里面有board_init等板级启动代码函数原型声明
#define STK_SIZE_TASK_PRIO4 512 // 优先级为4的任务栈大小为512
@@ -300,7 +300,7 @@ int main(void)
2、编写main.c示例代码
```c
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_WRITER 512
@@ -450,7 +450,7 @@ int main(void)
2、编写main.c示例代码
```c
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_PRODUCER 512
@@ -615,7 +615,7 @@ int main(void)
2、编写main.c示例代码
```c
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_LISTENER 512
@@ -790,7 +790,7 @@ int main(void)
这个例子里创建了两个任务一个任务task_wait等待完成量完成另一个任务负责触发完成量让完成量完成
*/
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_WAIT 512
@@ -861,7 +861,7 @@ int main(void)
假设有这样的业务场景,共有三个勇士,此三个勇士分头去寻找三个武器的碎片,只有这三个勇士都找到碎片后,法师才能将三个碎片合成为武器。用代码看具体如何使用计数锁来完成这个模型。
*/
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_WIZARD 512
@@ -954,7 +954,7 @@ int main(void)
这里演示如何使用消息队列在sender和receiver任务之间传递消息一个指针此案例中这个指针信息指向的是一个字符串
*/
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_RECEIVER 512
@@ -1087,7 +1087,7 @@ int main(void)
/*
这里演示如何使用邮箱队列在sender和receiver任务之间传递邮箱此案例中邮件也就是邮箱要传递的内存数据为一个mail_t类型的结构体从此案例中可以看出来邮箱队列相对消息队列来说可以传递更为复杂的内存块数据
*/
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_RECEIVER 512
@@ -1233,7 +1233,7 @@ int main(void)
2、编写main.c示例代码
```c
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_RECEIVER 512
@@ -1327,7 +1327,7 @@ int main(void)
/*
这里演示了优先级邮箱队列的使用从sender任务中的逻辑可以看出来依次post了三个mail优先级按时间顺序依次为2、1、0数值越高优先级越低。如果是传统的邮箱队列那个receiver应该是依次收到优先级为2、1、0的邮件但这是优先级邮箱队列因而receiver会按优先级顺序收到这三个邮件也就是依次收到优先级为0、1、2的邮件。
*/
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_RECEIVER 512
@@ -1435,7 +1435,7 @@ int main(void)
3、编写main.c示例代码
```c
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_DEMO 512
@@ -1558,7 +1558,7 @@ k_err_t tos_mmblk_pool_create(k_mmblk_pool_t *mbp, void *pool_start, size_t blk_
2、编写main.c示例代码
```c
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_DEMO 512
@@ -1663,7 +1663,7 @@ int main(void)
2、编写main.c示例代码
```c
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_DEMO 512
@@ -1775,7 +1775,7 @@ k_err_t tos_timer_create(k_timer_t *tmr,
2、编写main.c示例代码
```c
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_DEMO 512
@@ -1858,7 +1858,7 @@ TencentOS tiny操作系统内核是一个抢占式内核抢占式内核的特
2、编写main.c示例代码
```c
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_DEMO 512
@@ -2026,7 +2026,7 @@ int main(void)
1、编写main.c示例代码
```c
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_DEMO 512
@@ -2133,7 +2133,7 @@ int main(void)
1、编写main.c示例代码
```c
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_DEMO 512
@@ -2303,7 +2303,7 @@ int main(void)
此案例展示了优先级队列的出队规则依次入队优先级为5、4、3、2、1的元素出队时的顺序是按照优先级来的也就是按优先级从高到低数值越大优先级越小依次出队优先级为1、2、3、4、5元素。
*/
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_DEMO 512
@@ -2504,7 +2504,7 @@ k_err_t tos_pm_cpu_lpwr_mode_set(k_cpu_lpwr_mode_t cpu_lpwr_mode);
3、编写main.c示例代码
```c
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#define STK_SIZE_TASK_DEMO 512
@@ -2551,7 +2551,7 @@ int main(void)
4、实现tos_bsp_tickless_setup回调参考board\TOS_tiny_EVK_STM32L431CBT6\BSP\Src\tickless\bsp_pwr_mgr.c、board\TOS_tiny_EVK_STM32L431CBT6\BSP\Src\tickless\bsp_tickless_alarm.c
```c
#include "tos.h"
#include "tos_k.h"
#include "tickless/bsp_pm_device.h"
#include "tickless/bsp_tickless_alarm.h"
@@ -2606,4 +2606,4 @@ __STATIC__ void knl_idle_entry(void *arg)
> timer callback: 18000
> idle entry: 18000
> entry task demo: 18002
> idle entry: 18002
> idle entry: 18002

View File

@@ -193,7 +193,7 @@ TencentOS tiny所有要添加的头文件目录如下
## 三、创建TencentOS tiny任务测试移植结果
### 1. 修改部分代码
#### 修改stm32l0xx_it.c的中断函数,在stm32l0xx_it.c文件中包含 tos.h 头文件
#### 修改stm32l0xx_it.c的中断函数,在stm32l0xx_it.c文件中包含 tos_k.h 头文件
![](https://main.qcloudimg.com/raw/172245ad4fd6768dca798fd2db209755.png)
在stm32l0xx_it.c文件中的PendSV_Handler函数前添加___weak关键字因为该函数在TencentOS tiny的调度汇编中已经重新实现同时在SysTick_Handler函数中添加TencentOS tiny的调度处理函数如下图所示

View File

@@ -195,7 +195,7 @@ cmsis os是TencentOS tiny为了兼容cmsis标准而适配的OS抽象层可以
### 三、创建TencentOS tiny任务测试移植结果
### 1. 修改部分代码
#### 修改stm32l0xx_it.c的中断函数,在stm32l0xx_it.c文件中包含 tos.h 头文件
#### 修改stm32l0xx_it.c的中断函数,在stm32l0xx_it.c文件中包含 tos_k.h 头文件
![](https://main.qcloudimg.com/raw/751577ee1cdb79d1ccb851d83eec3a27.png)
在stm32l0xx_it.c文件中的PendSV_Handler函数前添加___weak关键字因为该函数在TencentOS tiny的调度汇编中已经重新实现同时在SysTick_Handler函数中添加TencentOS tiny的调度处理函数如下图所示

View File

@@ -214,7 +214,7 @@ cmsis os是TencentOS tiny为了兼容cmsis标准而适配的OS抽象层可以
### 1. 修改部分代码
#### 修改stm32l0xx_it.c的中断函数
在stm32l0xx_it.cboard\NUCLEO_L073RZ\Src目录下文件中包含 tos.h 头文件
在stm32l0xx_it.cboard\NUCLEO_L073RZ\Src目录下文件中包含 tos_k.h 头文件
![](https://main.qcloudimg.com/raw/d3212faec1bb029a1de508697a619a31.png)
在stm32l0xx_it.c文件中的PendSV_Handler函数前添加__weak关键字因为该函数在TencentOS tiny的调度汇编中已经重新实现同时在SysTick_Handler函数中添加TencentOS tiny的调度处理函数如下图所示