juanisVIG/MDK-ARM/RTX.h
2026-03-02 18:13:03 +08:00

30 lines
833 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// RTX.h 单独的文件放在Core/Inc目录
#ifndef RTX_H
#define RTX_H
// 引入必要依赖(只引一次,避免重复)
#include "stdint.h"
// 类型定义(只在头文件定义一次)
typedef uint16_t Data_Type;
// 宏定义(只定义一次)
#define DATA_COUNT 8
#define TRANSFER_LEN 16
// 外部变量声明(告诉编译器变量在其他文件定义)
extern uint8_t rx_complete_flag;
extern uint8_t rx_buf[TRANSFER_LEN];
extern uint8_t tx_buf[TRANSFER_LEN];
extern Data_Type recv_values[DATA_COUNT];
extern Data_Type send_values[DATA_COUNT];
// 函数声明注意函数名统一为UART1和main.c调用一致
void Pack_Values(Data_Type *values, uint8_t *buf, uint8_t count);
void Unpack_Values(uint8_t *buf, Data_Type *values, uint8_t count);
void UART1_DMA_Init_8Values(void); // 修正UART1和main.c调用一致
void Board_Send_8Values(Data_Type *values);
#endif /* RTX_H */