|
|
@ -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
|
|
|
|