Browse Source

update

master
zhaohe 2 years ago
parent
commit
deb6e400ff
  1. 4
      components/eq_20_asb_motor/eq20_servomotor.cpp
  2. 1
      components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp

4
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);
}

1
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);
}

Loading…
Cancel
Save