Motion_EC_Stm32_archived/App/Src/th_demo.c

40 lines
809 B
C
Raw Permalink Normal View History

2021-03-11 19:09:05 +08:00
/*
* @Description:
* @Date: 2021-03-09 18:19:26
* @LastEditors: CK.Zh
* @LastEditTime: 2021-03-10 15:07:01
* @FilePath: \NaviKit_EC_stm32\App\Src\th_demo.c
*/
2021-03-09 18:17:28 +08:00
#define LOG_TAG "TH-Demo"
#include <th_demo.h>
#include "main.h"
const osThreadAttr_t DemoTask1_attributes = {
.name = "DemoTask1",
2021-03-15 19:26:10 +08:00
.priority = (osPriority_t) osPriorityLow2,
2021-03-14 23:24:59 +08:00
.stack_size = 256 * 4
2021-03-09 18:17:28 +08:00
};
const osThreadAttr_t DemoTask2_attributes = {
.name = "DemoTask2",
2021-03-15 19:26:10 +08:00
.priority = (osPriority_t) osPriorityLow2,
2021-03-14 23:24:59 +08:00
.stack_size = 256 * 4
2021-03-09 18:17:28 +08:00
};
2021-03-15 19:26:10 +08:00
void DemoTask1(void *argument){
2021-03-09 18:17:28 +08:00
uint8_t i=0;
2021-03-12 13:38:28 +08:00
log_d("Start Demo Task1");
2021-03-09 18:17:28 +08:00
for(;;){
2021-03-11 19:09:05 +08:00
osDelay(100);
2021-03-15 19:26:10 +08:00
log_v("DemoTask1 counter [%d].",i++);
2021-03-09 18:17:28 +08:00
}
}
2021-03-15 19:26:10 +08:00
void DemoTask2(void *argument){
2021-03-09 18:17:28 +08:00
uint8_t i=0;
2021-03-12 13:38:28 +08:00
log_d("Start Demo Task2");
2021-03-09 18:17:28 +08:00
for(;;){
2021-03-11 19:09:05 +08:00
osDelay(100);
2021-03-12 13:38:28 +08:00
log_v("DemoTask2 counter [%d].",i++);
2021-03-09 18:17:28 +08:00
}
}