diff --git a/RBcore/drv_interface.c b/RBcore/drv_interface.c index 0c56ca8..7cc9a17 100644 --- a/RBcore/drv_interface.c +++ b/RBcore/drv_interface.c @@ -309,4 +309,5 @@ void Drv_InterfaceInit(void) daemon_Init(); Timer_Init(); + log_i("BingooRobot Init success\nversion: %s", Rd_GetBuildTime()); } diff --git a/RBcore/include/BHBF.h b/RBcore/include/BHBF.h index 7280fed..c617755 100644 --- a/RBcore/include/BHBF.h +++ b/RBcore/include/BHBF.h @@ -99,6 +99,7 @@ typedef enum { CUSTOM_GET_SPEED, // 获取速度(电机回码) CUSTOM_GET_FAULT_CODE, // 获取错误码(电机回码) CUSTOM_GET_DAEMON_CODE, // 获取daemon错误码 + CUSTOM_GET_MOTOR_OK, // 获取电机初始化完毕 CUSTOM_CMD_PAINTGUN, // 控制喷枪 CUSTOM_CMD_STRAIGHT_DRIVE, // RBCORE_CMD_STRAIGHT_DRIVE命令停止后回调 CUSTOM_CMD_TURN_ANGLE, // RBCORE_CMD_TURN_ANGLE命令停止后回调 diff --git a/library/log/elog.c b/library/log/elog.c index 2855ded..5af6c1e 100644 --- a/library/log/elog.c +++ b/library/log/elog.c @@ -244,7 +244,7 @@ void elog_start(void) { #endif /* show version */ - log_i("EasyLogger V%s is initialize success.", ELOG_SW_VERSION); +// log_i("EasyLogger V%s is initialize success.", ELOG_SW_VERSION); } /** diff --git a/project/paint_robot_new/paint_robot_new.c b/project/paint_robot_new/paint_robot_new.c index aa88216..7896d82 100644 --- a/project/paint_robot_new/paint_robot_new.c +++ b/project/paint_robot_new/paint_robot_new.c @@ -115,6 +115,7 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg) static int iVehicleSpeed = 1; static int iIsStopOffPaint = 0; static int iPaint = 1; + static int iMotorOK = 0; switch (pstMsg->m_uiMsgID) { case CUSTOM_RESET_PAINT: @@ -174,6 +175,11 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg) } break; } + case CUSTOM_GET_MOTOR_OK: + { + iMotorOK = 1; + break; + } case CUSTOM_CMD_STRAIGHT_DRIVE: { MsgCenter_SendTo(MODULE_NAME_TIMER, TIMER_CMD_TURN_UP, NULL, 0); @@ -292,6 +298,11 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg) break; } + if (iMotorOK == 0) // 电机还没初始化完,不执行后边 + { + break; + } + // 按键处于默认位置安卓界面可控 if ((fabs(g_stMK32.CH2_LY_V) <= 200) && (fabs(g_stMK32.CH3_LY_H) <= 200) && (fabs(g_stMK32.CH0_RY_H) <= 200) && (fabs(g_stMK32.CH1_RY_V) <= 200) diff --git a/project/paint_robot_new/paint_robot_new_motors.c b/project/paint_robot_new/paint_robot_new_motors.c index 0a1689a..ccfa3ee 100644 --- a/project/paint_robot_new/paint_robot_new_motors.c +++ b/project/paint_robot_new/paint_robot_new_motors.c @@ -245,6 +245,7 @@ void MotorTask(void *argument) MotorMgr_SpeedModeInit(g_apstMotors[1]); g_isMotorInit = 1; g_iInitOnce = 1; + MsgCenter_SendTo(MODULE_NAME_CUSTOM, CUSTOM_GET_MOTOR_OK, NULL, 0); } else if (g_isMotorInit > 0) {