learn rtos
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
348 B

4 months ago
// thread.h
#ifndef __THREAD_H
#define __THREAD_H
#include <stdint.h>
typedef struct
{
uint32_t *stack_ptr; // 任务栈指针
uint32_t task_id; // 任务 ID
// 其他成员:优先级、状态、等待事件等...
} tcb_t;
void init_task(tcb_t *tcb, void (*task_entry)(void *), void *arg);
void start_first_task(void);
#endif