fix some calloc bug
1. some calloc fix 2. fix some document error 3. refactor kv API, to be compatible with ota API
This commit is contained in:
@@ -779,11 +779,7 @@ int main(void)
|
||||
|
||||
##### 编程实例
|
||||
|
||||
1、在tos_config.h中,配置完成量组件开关TOS_CFG_COMPLETION_EN:
|
||||
|
||||
`#define TOS_CFG_COMPLETION_EN 1u`
|
||||
|
||||
2、编写main.c示例代码:
|
||||
1、编写main.c示例代码:
|
||||
|
||||
```c
|
||||
/*
|
||||
@@ -898,11 +894,11 @@ void entry_task_wizard(void *arg)
|
||||
printf("wizard: I will set 3 warriors to find the fragments\n");
|
||||
tos_countdownlatch_create(&countdownlatch, 3);
|
||||
(void)tos_task_create(&task_warrior_0, "warrior_0", entry_task_warrior_0, NULL,
|
||||
4, stack_task_warrior_0, STK_SIZE_TASK_WIZARD, 0);
|
||||
4, stack_task_warrior_0, STK_SIZE_TASK_WARRIOR, 0);
|
||||
(void)tos_task_create(&task_warrior_1, "warrior_1", entry_task_warrior_1, NULL,
|
||||
4, stack_task_warrior_1, STK_SIZE_TASK_WIZARD, 0);
|
||||
4, stack_task_warrior_1, STK_SIZE_TASK_WARRIOR, 0);
|
||||
(void)tos_task_create(&task_warrior_2, "warrior_2", entry_task_warrior_2, NULL,
|
||||
4, stack_task_warrior_2, STK_SIZE_TASK_WIZARD, 0);
|
||||
4, stack_task_warrior_2, STK_SIZE_TASK_WARRIOR, 0);
|
||||
printf("wizard: now warriors are on their way, I will wait here until they all done the job\n");
|
||||
tos_countdownlatch_pend(&countdownlatch);
|
||||
printf("wizard: the warriors all have done their jobs, let's make the weapon\n");
|
||||
@@ -949,7 +945,6 @@ int main(void)
|
||||
#include "tos_k.h"
|
||||
#include "mcu_init.h"
|
||||
|
||||
#define STK_SIZE_TASK_WIZARD 512
|
||||
#define STK_SIZE_TASK_WARRIOR 512
|
||||
|
||||
k_stack_t stack_task_warrior_0[STK_SIZE_TASK_WARRIOR];
|
||||
@@ -996,11 +991,11 @@ int main(void)
|
||||
tos_barrier_create(&barrier, 3);
|
||||
|
||||
(void)tos_task_create(&task_warrior_0, "warrior_0", entry_task_warrior_0, NULL,
|
||||
4, stack_task_warrior_0, STK_SIZE_TASK_WIZARD, 0);
|
||||
4, stack_task_warrior_0, STK_SIZE_TASK_WARRIOR, 0);
|
||||
(void)tos_task_create(&task_warrior_1, "warrior_1", entry_task_warrior_1, NULL,
|
||||
4, stack_task_warrior_1, STK_SIZE_TASK_WIZARD, 0);
|
||||
4, stack_task_warrior_1, STK_SIZE_TASK_WARRIOR, 0);
|
||||
(void)tos_task_create(&task_warrior_2, "warrior_2", entry_task_warrior_2, NULL,
|
||||
4, stack_task_warrior_2, STK_SIZE_TASK_WIZARD, 0);
|
||||
4, stack_task_warrior_2, STK_SIZE_TASK_WARRIOR, 0);
|
||||
tos_knl_start();
|
||||
}
|
||||
```
|
||||
|
@@ -137,7 +137,7 @@ board\TencentOS_tiny_EVB_MX_Plus\KEIL\iap\application\TencentOS_tiny.bin
|
||||
|
||||

|
||||
|
||||
6. 等待镜像传输并烧写完毕后,在BootLoader的菜单选项下,点击菜单选项“4”执行刚才烧录的APP:
|
||||
6. 等待镜像传输并烧写完毕后,在BootLoader的菜单选项下,点击菜单选项“3”执行刚才烧录的APP:
|
||||
|
||||

|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 236 KiB After Width: | Height: | Size: 236 KiB |
Reference in New Issue
Block a user