From deb6e400ffe1de0dbbbf85830227a83787e6559d Mon Sep 17 00:00:00 2001 From: zhaohe Date: Mon, 16 Oct 2023 13:15:58 +0800 Subject: [PATCH] update --- components/eq_20_asb_motor/eq20_servomotor.cpp | 4 ++-- components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/eq_20_asb_motor/eq20_servomotor.cpp b/components/eq_20_asb_motor/eq20_servomotor.cpp index 8333750..831b14b 100644 --- a/components/eq_20_asb_motor/eq20_servomotor.cpp +++ b/components/eq_20_asb_motor/eq20_servomotor.cpp @@ -74,7 +74,7 @@ write_pn_bit 1 1501 0 1 return 0; } -static int32_t abs(int32_t v) { +static int32_t prvabs(int32_t v) { if (v < 0) return -v; return v; } @@ -83,7 +83,7 @@ int32_t Eq20ServoMotor::rotate(int32_t rpm, int32_t acctime) { if (rpm == 0) return 0; int32_t direction = 1; if (rpm < 0) direction = -1; - rpm = abs(rpm); + rpm = prvabs(rpm); return move_by(direction * 100000 * 10000, rpm, acctime); } diff --git a/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp b/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp index 0c5b063..1b332f1 100644 --- a/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp +++ b/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp @@ -283,6 +283,7 @@ int32_t XYRobotCtrlModule::read_detailed_status(detailed_status_t& debug_info) { debug_info.iostate = 0xff; for (int i = 0; i < m_ngpio; i++) { if (i > 7) break; + ZLOGI(TAG, "read_detailed_status i:%d", i); if (!m_gpiotable[i].getState()) debug_info.iostate &= ~(1 << i); }