From 31f5461b6d4b39892951745c0de7cf6c9df03422 Mon Sep 17 00:00:00 2001 From: Lizongdi <1210855344@qq.com> Date: Mon, 7 Sep 2026 15:29:24 +0800 Subject: [PATCH] =?UTF-8?q?CV=E6=94=B9=E4=B8=BA=E5=85=A8=E5=B1=80=EF=BC=8C?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E4=B9=8B=E5=89=8D=E8=8E=B7=E5=8F=96CV?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RBcore/BHBF.c | 5 ----- RBcore/drv_interface.c | 3 +++ RBcore/include/BHBF.h | 1 - RBcore/include/drv_interface.h | 3 +++ project/paint_robot_new/paint_robot_new.c | 9 --------- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/RBcore/BHBF.c b/RBcore/BHBF.c index 20090c3..679663f 100644 --- a/RBcore/BHBF.c +++ b/RBcore/BHBF.c @@ -19,8 +19,6 @@ #include "BHBF.h" #include "common.h" #include "msg_center.h" -#include "bsp_EEPROM.h" -#include "bsp_CV.pb.h" /*----------------------------------------------* * 外部变量说明 * @@ -38,7 +36,6 @@ * 全局变量 * *----------------------------------------------*/ static uint32_t g_uiRBcoreModuleID = 0; -static CV_struct_define CV = {0}; /*----------------------------------------------* * 模块级变量 * @@ -92,12 +89,10 @@ static void RBcore_ModuleHandler(const Msg_t *pstMsg) void RBcore_Task(void *argument) { - GF_BSP_EEPROM_ReadBytes((uint8_t *)&CV, GF_BSP_EEPROM_CV_struct_define_Start_Address, sizeof(CV_struct_define)); while(1) { // 处理消息 MsgCenter_ProcessWait(g_uiRBcoreModuleID, 2); - MsgCenter_SendTo(MODULE_NAME_CUSTOM, CUSTOM_GET_CV, (void *)&CV, sizeof(CV)); } } diff --git a/RBcore/drv_interface.c b/RBcore/drv_interface.c index 348fdcd..03fdbf1 100644 --- a/RBcore/drv_interface.c +++ b/RBcore/drv_interface.c @@ -48,6 +48,8 @@ TComCtrl *g_ptlpuart; TComCtrl *g_ptCAN1; TComCtrl *g_ptCAN2; + +CV_struct_define g_stCV = {0}; /*----------------------------------------------* * 模块级变量 * *----------------------------------------------*/ @@ -257,6 +259,7 @@ void Drv_InterfaceInit(void) { GF_BSP_EEPROM_Init(); MsgCenter_Init(); + GF_BSP_EEPROM_ReadBytes((uint8_t *)&g_stCV, GF_BSP_EEPROM_CV_struct_define_Start_Address, sizeof(CV_struct_define)); SendIV_Init(); // ground_manger_init(); diff --git a/RBcore/include/BHBF.h b/RBcore/include/BHBF.h index 74519bb..a8e9f00 100644 --- a/RBcore/include/BHBF.h +++ b/RBcore/include/BHBF.h @@ -93,7 +93,6 @@ typedef enum { RBCORE_CMD_END = 0x0200, CUSTOM_GET_PV, // 获取PV - CUSTOM_GET_CV, // 获取CV CUSTOM_SET_IV, // 设置IV CUSTOM_GET_MK32, // 获取MK32 CUSTOM_CMD_END = 0x0300, diff --git a/RBcore/include/drv_interface.h b/RBcore/include/drv_interface.h index 99c3d3b..0ab031f 100644 --- a/RBcore/include/drv_interface.h +++ b/RBcore/include/drv_interface.h @@ -64,6 +64,7 @@ extern "C"{ #include "bsp_uart.h" #include "bsp_CAN.h" #include "fdcan.h" +#include "bsp_CV.pb.h" @@ -86,6 +87,8 @@ extern TComCtrl *g_ptlpuart; extern TComCtrl *g_ptCAN1; extern TComCtrl *g_ptCAN2; + +extern CV_struct_define g_stCV; /*==============================================* * routines' or functions' implementations * *----------------------------------------------*/ diff --git a/project/paint_robot_new/paint_robot_new.c b/project/paint_robot_new/paint_robot_new.c index aecf95a..0ddec48 100644 --- a/project/paint_robot_new/paint_robot_new.c +++ b/project/paint_robot_new/paint_robot_new.c @@ -46,7 +46,6 @@ static uint32_t g_uiCustomModuleID = 0; static SP_MSP_MK32_Button g_stMK32; static PV_struct_define g_stPV; -static CV_struct_define g_stCV; static IV_struct_define g_stIV; /*----------------------------------------------* @@ -68,14 +67,6 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg) switch (pstMsg->m_uiMsgID) { - case CUSTOM_GET_CV: - { - if (pstMsg->m_uiDataLen >= sizeof(g_stCV)) - { - RD_MEMCPY(&g_stCV, pstMsg->m_aucData, sizeof(g_stCV)); - } - break; - } case CUSTOM_GET_PV: { if (pstMsg->m_uiDataLen >= sizeof(g_stPV))