diff --git a/.vscode/settings.json b/.vscode/settings.json index 6b5447e..3034fdb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -41,6 +41,7 @@ "complex": "c", "usb_device.h": "c", "vofa_protocol.h": "c", - "master_process.h": "c" + "master_process.h": "c", + "stdint-gcc.h": "c" } } \ No newline at end of file diff --git a/modules/algorithm/LQR.c b/modules/algorithm/LQR.c new file mode 100644 index 0000000..e69de29 diff --git a/modules/algorithm/LQR.h b/modules/algorithm/LQR.h new file mode 100644 index 0000000..e69de29 diff --git a/modules/master_machine/master_process.c b/modules/master_machine/master_process.c index 1fa3c18..4a9f933 100644 --- a/modules/master_machine/master_process.c +++ b/modules/master_machine/master_process.c @@ -4,8 +4,8 @@ * @brief module for recv&send vision data * @version beta * @date 2022-11-03 - * - * @copyright Copyright (c) 2022 + * @todo 增加对串口调试助手协议的支持,包括vofa和serial debug + * @copyright Copyright (c) 2022 * */ #include "Master_process.h" @@ -27,12 +27,13 @@ static void DecodeVision() } /* 视觉通信初始化 */ -void VisionInit(UART_HandleTypeDef *handle) +Vision_Recv_s* VisionInit(UART_HandleTypeDef *handle) { vision_usart_instance.module_callback = DecodeVision; vision_usart_instance.recv_buff_size = VISION_RECV_SIZE; vision_usart_instance.usart_handle = handle; USARTRegister(&vision_usart_instance); + return &recv_data; } /** diff --git a/modules/master_machine/master_process.h b/modules/master_machine/master_process.h index e0d0df3..408029b 100644 --- a/modules/master_machine/master_process.h +++ b/modules/master_machine/master_process.h @@ -9,12 +9,19 @@ #define VISION_SEND_SIZE 36u +typedef struct +{ + +}; + + + /** * @brief 调用此函数初始化和视觉的串口通信 * * @param handle 用于和视觉通信的串口handle(C板上一般为USART1,丝印为USART2,4pin) */ -void VisionInit(UART_HandleTypeDef* handle); +Vision_Recv_s* VisionInit(UART_HandleTypeDef* handle); /** * @brief 发送视觉视觉 diff --git a/modules/referee/referee.h b/modules/referee/referee.h index e69de29..7f74007 100644 --- a/modules/referee/referee.h +++ b/modules/referee/referee.h @@ -0,0 +1,22 @@ +/** + * @file referee.h + * @author your name (you@domain.com) + * @brief + * @version 0.1 + * @date 2022-11-04 + * + * @copyright Copyright (c) 2022 + * + */ + +#ifndef REFEREE_H +#define REFEREE_H + +#include"bsp_usart.h" +#include"usart.h" + + + + + +#endif // !REFEREE_H \ No newline at end of file diff --git a/modules/referee/referee_UI.c b/modules/referee/referee_UI.c new file mode 100644 index 0000000..e69de29 diff --git a/modules/remote/remote_control.c b/modules/remote/remote_control.c index 12517da..e69fa0e 100644 --- a/modules/remote/remote_control.c +++ b/modules/remote/remote_control.c @@ -55,15 +55,16 @@ static void ReceiveCallback() sbus_to_rc(rc_usart_instance.recv_buff, &rc_ctrl); } -void RC_init(UART_HandleTypeDef *rc_usart_handle) +RC_ctrl_t* RC_init(UART_HandleTypeDef *rc_usart_handle) { rc_usart_instance.module_callback = ReceiveCallback; rc_usart_instance.usart_handle = rc_usart_handle; rc_usart_instance.recv_buff_size = REMOTE_CONTROL_FRAME_SIZE; USARTRegister(&rc_usart_instance); + return &rc_ctrl; } -const RC_ctrl_t *get_remote_control_point(void) +const *get_remote_control_point(void) { - return &rc_ctrl; + } \ No newline at end of file diff --git a/modules/remote/remote_control.h b/modules/remote/remote_control.h index b985162..d9676d0 100644 --- a/modules/remote/remote_control.h +++ b/modules/remote/remote_control.h @@ -5,10 +5,10 @@ * @brief 遥控器模块定义头文件 * @version beta * @date 2022-11-01 - * + * * @copyright Copyright (c) 2016 DJI corp * @copyright Copyright (c) 2022 HNU YueLu EC all rights reserved - * + * */ #ifndef REMOTE_CONTROL_H #define REMOTE_CONTROL_H @@ -73,20 +73,6 @@ typedef struct * @attention 注意分配正确的串口硬件,遥控器在C板上使用USART3 * */ -void RC_init(UART_HandleTypeDef *rc_usart_handle); - -/** - * @brief 获取遥控器的数据指针 - * - * @return const RC_ctrl_t* - */ -extern const RC_ctrl_t *get_remote_control_point(void); - -/** - * @brief 检查遥控器数据是否出错 - * - * @return uint8_t - */ -extern uint8_t RC_data_is_error(void); +RC_ctrl_t *RC_init(UART_HandleTypeDef *rc_usart_handle); #endif