Fixed sending ack after move is done.

This commit is contained in:
Holger Weber
2026-02-27 00:56:23 +01:00
parent f44dcb2317
commit 3580e32142
4 changed files with 1008 additions and 29 deletions

View File

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

View File

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