Browse Source

update

master
zhaohe 2 years ago
parent
commit
855e07612d
  1. 18
      usrc/main.cpp

18
usrc/main.cpp

@ -149,6 +149,24 @@ void regfn() {
cmdScheduler.registerCmd("help", //
[](int argc, char** argv, CmdScheduler::CmdProcessContext* context) { ZLOGI(TAG, "do_help"); });
cmdScheduler.registerCmd("stepmotor45_wait_to_reach_pos", [](int argc, char** argv, CmdScheduler::CmdProcessContext* context) {
// stepmotor45_rotate motorid direction
CHECK_ARGC(2);
int motorid = atoi(argv[1]);
if (motorid < 1 || motorid > 6) {
ZLOGE(TAG, "motorid out of range");
return;
}
while (true) {
if (g_step_motor45[motorid].isReachTargetPos()) {
break;
}
ZLOGI(TAG, "stepmotor45_wait_to_reach_pos %d", motorid);
osDelay(100);
}
});
// stepmotor45
cmdScheduler.registerCmd("stepmotor45_rotate", [](int argc, char** argv, CmdScheduler::CmdProcessContext* context) {
// stepmotor45_rotate motorid direction

Loading…
Cancel
Save