Fixed sending ack after move is done.
This commit is contained in:
@@ -83,23 +83,23 @@ void stepperMove()
|
||||
int penStepsEBB = 0; // Pen
|
||||
int rotStepsEBB = 0; // Rot
|
||||
|
||||
moveToDestination();
|
||||
|
||||
if (!parseSMArgs(&duration, &penStepsEBB, &rotStepsEBB))
|
||||
{
|
||||
sendError();
|
||||
return;
|
||||
}
|
||||
|
||||
sendAck();
|
||||
|
||||
|
||||
if ((penStepsEBB == 0) && (rotStepsEBB == 0))
|
||||
{
|
||||
delay(duration);
|
||||
// delay(duration);
|
||||
sendAck();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
prepareMove(duration, penStepsEBB, rotStepsEBB);
|
||||
moveToDestination();
|
||||
sendAck();
|
||||
}
|
||||
|
||||
void setPen()
|
||||
@@ -110,7 +110,7 @@ void setPen()
|
||||
char *arg;
|
||||
char cstrMsg[20];
|
||||
|
||||
moveToDestination();
|
||||
// moveToDestination();
|
||||
|
||||
arg = nextCommandArg();
|
||||
if (arg != NULL)
|
||||
@@ -136,12 +136,12 @@ void setPen()
|
||||
{
|
||||
value = atoi(val);
|
||||
sendAck();
|
||||
delay(value);
|
||||
// delay(value);
|
||||
}
|
||||
if (val == NULL && arg != NULL)
|
||||
{
|
||||
sendAck();
|
||||
delay(500);
|
||||
// delay(500);
|
||||
}
|
||||
// Serial.println("delay");
|
||||
if (val == NULL && arg == NULL)
|
||||
@@ -154,7 +154,7 @@ void togglePen()
|
||||
int value;
|
||||
char *arg;
|
||||
|
||||
moveToDestination();
|
||||
// moveToDestination();
|
||||
|
||||
arg = nextCommandArg();
|
||||
if (arg != NULL)
|
||||
@@ -164,7 +164,7 @@ void togglePen()
|
||||
|
||||
doTogglePen();
|
||||
sendAck();
|
||||
delay(value);
|
||||
// delay(value);
|
||||
}
|
||||
|
||||
void doTogglePen()
|
||||
|
||||
@@ -230,16 +230,16 @@ void prepareMove(uint16_t duration, int penStepsEBB, int rotStepsEBB)
|
||||
|
||||
void moveOneStep()
|
||||
{
|
||||
while (g_pStepperPen->isRunning() || g_pStepperRotate->isRunning())
|
||||
;
|
||||
Log("moveOneStep done");
|
||||
Log("moveOneStep");
|
||||
while (g_pStepperPen->isRunning() || g_pStepperRotate->isRunning());
|
||||
Log("done");
|
||||
}
|
||||
|
||||
void moveToDestination()
|
||||
{
|
||||
while (g_pStepperPen->isRunning() || g_pStepperRotate->isRunning())
|
||||
;
|
||||
Log("moveToDestination done");
|
||||
Log("moveToDestination");
|
||||
while (g_pStepperPen->isRunning() || g_pStepperRotate->isRunning());
|
||||
Log("done");
|
||||
}
|
||||
|
||||
void setprgButtonState()
|
||||
|
||||
Reference in New Issue
Block a user